A service that monitors website availability using UptimeRobot API and sends notifications via Bark when websites go down.
- Monitors websites using UptimeRobot API
- Sends notifications to your iOS devices via Bark when websites go down
- Sends recovery notifications when websites come back online (configurable)
- Can be run as a standalone service or deployed to various platforms
- Configurable monitoring schedule
- Filter monitoring to specific websites
- Fully configurable via environment variables - no code changes needed
- Customizable notification sounds
- Node.js 14 or higher
- UptimeRobot account with API key
- Bark app installed on your iOS device
git clone https://github.com/yourusername/UptimeRobot-BarkPush.git
cd UptimeRobot-BarkPush
npm install
You have two options for configuration:
Create a .env
file by copying the provided example:
cp .env.example .env
Then edit the .env
file with your values:
UPTIMEROBOT_API_KEY=your_api_key
BARK_DEVICE_KEY=your_device_key
Additional environment variables you can set:
BARK_SERVER_URL
(optional): Custom Bark server URL (default: https://api.day.app)CRON_SCHEDULE
(optional): Custom check schedule (default: */5 * * * *)MONITOR_IDS
(optional): Comma-separated list of monitor IDs to checkSEND_RECOVERY_NOTIFICATIONS
(optional): Set to 'false' to disable recovery notificationsDOWN_NOTIFICATION_SOUND
(optional): Custom sound for down notificationsRECOVERY_NOTIFICATION_SOUND
(optional): Custom sound for recovery notificationsSEND_STARTUP_NOTIFICATION
(optional): Set to 'false' to disable startup notificationsNOTIFICATION_LANGUAGE
(optional): Set to 'zh' for Chinese or 'en' for English (default)NOTIFY_ONLY_ON_STATUS_CHANGE
(optional): Set to 'true' to only send notifications when websites go down, without startup and recovery notifications
Copy the example config and edit it:
cp config.example.js config.js
Then edit config.js
with your values:
module.exports = {
uptimeRobotApiKey: 'your_uptimerobot_api_key',
barkServerUrl: 'https://api.day.app',
barkDeviceKey: 'your_bark_device_key',
cronSchedule: '*/5 * * * *',
// Optional configuration
// monitorIds: ['m1234567', 'm7654321'],
// sendRecoveryNotifications: false,
// downNotificationSound: 'alert',
// recoveryNotificationSound: 'complete',
// sendStartupNotification: true,
// notificationLanguage: 'en' // Use 'zh' for Chinese
// notifyOnlyOnStatusChange: true // Only send notifications when websites go down
};
npm start
The service will check the status of your websites according to the schedule in config.
# Using docker-compose (recommended)
docker-compose up -d
# Or with Docker directly
docker build -t uptimerobot-bark .
docker run -e UPTIMEROBOT_API_KEY=your_key -e BARK_DEVICE_KEY=your_key uptimerobot-bark
Note: Vercel's free plan (Hobby) only supports running cron jobs once per day, which is not frequent enough for website monitoring. Consider using one of the alternatives below.
If you have a Vercel Pro plan:
-
Push your repository to GitHub
-
Create a new project on Vercel and connect it to your GitHub repository
-
Add the following environment variables in Vercel:
UPTIMEROBOT_API_KEY
: Your UptimeRobot API keyBARK_DEVICE_KEY
: Your Bark device key- Optionally,
BARK_SERVER_URL
if you're using a custom Bark server - Optionally,
MONITOR_IDS
as a comma-separated list of monitor IDs
-
Deploy the project
If you don't have a Vercel Pro plan, consider these free alternatives:
GitHub Actions can run scheduled workflows for free, as frequently as every 5 minutes.
📖 Detailed GitHub Actions Deployment Guide
Cloudflare Workers has a free plan that allows Cron Triggers:
📖 Detailed Cloudflare Workers Deployment Guide
Render offers free cron jobs that can be set to run multiple times per hour:
📖 Detailed Render.com Deployment Guide
If you have a computer or server that's always online, you can run this service using Docker:
You can test the service by running the code manually:
node index.js
- The service uses the UptimeRobot API to check the status of your websites
- If a website changes from "Up" to "Down" or "Seems Down", a notification is sent via Bark
- If a website changes from "Down" to "Up", a recovery notification is sent
- The service maintains a cache of website statuses to avoid sending duplicate notifications
- 0: Paused
- 1: Not checked yet
- 2: Up
- 8: Seems Down
- 9: Down
MIT