No description
Find a file
2025-10-18 18:20:01 +02:00
public can personalize UI message 2025-10-18 18:13:47 +02:00
scripts all working 2025-10-17 19:35:19 +02:00
.gitignore all working 2025-10-17 19:35:19 +02:00
Dockerfile small adjustemnts in readme and envars 2025-10-18 14:34:43 +02:00
env.example can personalize UI message 2025-10-18 18:13:47 +02:00
package-lock.json all working 2025-10-17 19:35:19 +02:00
package.json all working 2025-10-17 19:35:19 +02:00
README.md can personalize UI message 2025-10-18 18:13:47 +02:00
server.js small changes on message 2025-10-18 18:20:01 +02:00

ntfy emergency app - Message Webapp

This is a simple web application that allows users to send emergency messages to a ntfy server.

tldr: I look at messaging apps very infrequently and have no notifications for them. But what happens if there's a real emergency and someone needs to grab my attention? The only app in my phone that has notifications is the ntfy client, which I use to monitor servers and services. Why not receive a ntfy alert? This small webapp lets my trusted ones send me a high priority message if needed.

More details:

  • You can deploy in a single docker run, simply passing the ntfy details through env vars.
  • You can use it with both the official ntfy instance or with a selfhosted instance of your own.
  • Deals with ntfy username/password auth if needed.
  • No auth or spam protection: either roll your own, or simply pray nobody spams you.

Dev setup

  1. Install dependencies:
npm install
  1. Configure environment variables:
cp env.example .env
# Edit .env with your values
  1. Run the application:
npm start

Environment Variables in detail

  • NTFY_URL: URL of your ntfy server (required)
  • NTFY_USER: Username for ntfy authentication (required)
  • NTFY_PASSWORD: Password for ntfy authentication (required)
  • NTFY_TOPIC: ntfy topic/channel to send messages to (optional, defaults to "emergencia")
  • PORT: Port to run the application on (optional, defaults to 3000)
  • UI_MESSAGE: Custom message to display in the UI (optional, defaults to "Emergency Message")

Docker Registry Variables (Optional, needed to push to private registry)

Note that we assume that you docker cli is authenticated for the registry you want to use.

  • DOCKER_REGISTRY: Custom registry to publish the image to (optional)
  • DOCKER_USERNAME: Username/organization in the registry (optional)
  • DOCKER_TAG: Tag for the Docker image (optional, defaults to "latest")

Deployment

Option 1: Docker Run

  1. Create a .env file with your credentials:
NTFY_URL=https://your-ntfy-server.com
NTFY_USER=your-username
NTFY_PASSWORD=your-password
NTFY_TOPIC=emergencia
UI_MESSAGE=Send an emergency message
  1. Run with Docker:
docker run -d \
  --name ntfy-emergency-app \
  -p 3000:3000 \
  --env-file .env \
  forgejo.contrapeso.xyz/counterweight/ntfy-emergency-app:latest

The application will be available at http://localhost:3000

Option 2: Direct Installation

  1. Upload files to the server
  2. Install Node.js (version 14 or higher)
  3. Create a .env file with your credentials:
NTFY_URL=https://your-ntfy-server.com
NTFY_USER=your-username
NTFY_PASSWORD=your-password
NTFY_TOPIC=emergencia
UI_MESSAGE=Send an emergency message
  1. Install dependencies:
npm install
  1. Start the application:
npm start

Docker Image Publishing

npm run docker:build-tag-push