modern-watcher
by @imkylejk
Status page that monitors websites and checks they're up, with /health and an hourly scheduled check.
modern-watcher.noconfig.online
README.md
# modern-watcher [](https://noconfig.lol/p/modern-watcher) A self-hosted status page that watches your websites and shows whether they are up. It has a public status page, a password-protected admin panel, webhook alerts, incident history and a `/health` endpoint for scheduled checks. No dependencies, no database server: it is plain Node.js with a JSON file for storage. ## Getting started ### 1. Remix it Click the **Remix on noconfig** badge above. NoConfig copies the project into your account and starts it within seconds. Dependencies are not needed, so there is nothing to install. ### 2. Run the setup wizard Open your new project's URL and go to `/setup` (for example `https://your-project.noconfig.online/setup`). The first page of a fresh remix also shows a banner linking to it. The wizard has five steps: 1. **Name**: the title and optional tagline of your status page. 2. **Account**: your admin username and password (minimum 10 characters, mixing at least two character types, or 16 or more characters). 3. **Watchers**: up to 10 websites to monitor. You can add more later. 4. **Theme**: Classic, Midnight, Forest or Sunset, plus an optional custom accent colour. The page previews your choice live. 5. **Finish**: choose whether to show the Remix badge, and optionally add an alert webhook. Finish setup straight away. Until an admin account exists, the first person to open `/setup` can claim the instance. ### 3. Schedule the hourly check The status page only gets new data when checks run. Create a scheduled job in NoConfig for your project: | Setting | Value | | --- | --- | | Method | `GET` | | Path | `/health` | | Cron | `0 * * * *` (every hour) | | Timezone | your own, for example `Europe/London` | NoConfig adds an `X-Noconfig-Scheduler` header to scheduled calls. When `/health` sees it, it runs every active watcher, records the results, opens or closes incidents and fires your webhooks. Free accounts can run jobs at most hourly. Pro accounts can go down to every minute. A normal visit to `/health` (without that header) only runs the internal self-checks. ### 4. Sign in Go to `/admin` and sign in with the username and password you chose. ## Where to find things | What | Where | | --- | --- | | Public status page | `/` | | Admin panel | `/admin` | | First-time setup | `/setup` (only usable until setup is done) | | Health endpoint | `/health` | | Public status data (JSON) | `/api/status` | | Your data (watchers, history, login hash) | `.data/monitors.json` | ### Admin panel tabs - **Overview**: counts of watchers up and down, average 90-day uptime, recent incidents and a "Run all checks now" button. - **Watchers**: add, edit, pause, resume, delete and manually check websites. Each watcher can have an expected HTTP status code. Without one, any 2xx or 3xx response counts as up. - **Webhooks**: add alert URLs, choose down and/or recovered events, send a test, enable or disable them. The JSON body includes `text` and `content` fields, so Discord and Slack-style webhooks work. - **Incidents**: history of outages with start time, reason and duration. - **Appearance**: name, tagline, theme, accent colour, and the toggle that shows or hides the Remix badge. - **Security**: change password, view active sessions, sign out other sessions and see recent sign-in activity. ### Project files | File | Purpose | | --- | --- | | `server.js` | The whole backend: checks, incidents, webhooks, auth, API | | `public/index.html`, `public/app.js` | Public status page | | `public/admin.html`, `public/admin.js` | Admin panel | | `public/setup.html`, `public/setup.js` | First-run setup wizard | | `public/style.css` | Shared styles (uses CSS variables) | | `/theme.css` (generated by `server.js`) | The colours for your chosen theme | To add or change theme presets, edit the `PRESETS` object near the top of `server.js`. ## Settings and environment variables | Variable | Required | What it does | | --- | --- | --- | | `ADMIN_TOKEN` | No | If set, it is asked for as a "setup key" in step 2 of the wizard. Use it to stop strangers claiming a new deployment. It is not used for normal login. | Add variables in the project's `.env` file or through NoConfig's environment settings. Remixes receive `.env` with blank values. ## Security notes - Passwords are hashed with scrypt and a random salt. - Sign-ins are rate limited: 5 failures from one IP in 15 minutes locks that IP out for the rest of the window. The limits live in memory and reset on restart. - Sessions use HttpOnly, SameSite=Strict cookies and last 12 hours (30 days with "keep me signed in"). - Watchers and webhooks can only target public http(s) addresses. Private and internal IP ranges are blocked. - The public page never shows watcher URLs. - This project is public on NoConfig, so anyone can read the code, but `.data` and `.env` values are not copied into remixes. ## Troubleshooting - **The status page says "Waiting for first check"**: add a watcher, or run "Run all checks now" in the admin Overview tab, and make sure the hourly schedule exists. - **I forgot my password**: sign-in cannot be reset from the web. Open the project's files in the NoConfig editor, delete the `auth` entry from `.data/monitors.json` (or delete the file to reset everything), and run `/setup` again. - **A watcher always shows Down**: check the URL opens publicly, and set an expected status code if the site returns something other than 2xx or 3xx. - **Webhook shows an error**: use the Test button in the Webhooks tab. Private addresses and non-http(s) URLs are rejected. - **Free-plan apps sleep when idle**: the scheduled `/health` call wakes the app, so hourly checks still run.
Comments 0
- No comments yet. Say something nice.
Sign in or create an account to comment and react.