tutorial

Monitoring Pastefy with Vigilmon

Pastefy is a modern self-hosted paste service with encrypted pastes, folders, and API access. Here's how to monitor its web server, database, paste APIs, authentication, and TLS certificates with Vigilmon.

Pastefy is a clean, open-source alternative to Pastebin — a Go backend with a React/TypeScript frontend that supports syntax highlighting, encrypted pastes, folders, link shortening, OAuth2 login, and a full REST API. Once you host it yourself, no one else is watching it for you. Vigilmon gives you uptime monitoring, API response-time tracking, database health checks, and TLS certificate alerts so you know the moment something goes wrong.

What You'll Set Up

  • HTTP uptime monitor for the Pastefy web interface (port 5000)
  • Paste creation API endpoint response-time tracking (POST /api/paste)
  • Paste retrieval endpoint health check
  • Encrypted paste service (client-side handshake) verification
  • User authentication service check (OAuth2/local login endpoint)
  • Folder management API health
  • Link shortener service check
  • Admin panel accessibility monitor
  • Cron heartbeat for the expired-paste cleanup job
  • SSL/TLS certificate expiry alert

Prerequisites

  • Pastefy running and accessible (default port 5000)
  • A free Vigilmon account

Step 1: Monitor the Pastefy Web Interface

The most critical check is whether the Pastefy frontend is responding.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Pastefy URL: https://paste.yourdomain.com.
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

If Pastefy sits behind a reverse proxy (nginx, Caddy), this monitor catches proxy failures and application crashes in the same check.


Step 2: Track Paste Creation API Response Times

The POST /api/paste endpoint is the core action users take. Slow response times here directly affect every paste submission.

  1. Click Add MonitorHTTP / HTTPS.
  2. Set URL to https://paste.yourdomain.com/api/paste.
  3. Set Method to POST.
  4. Add the header Content-Type: application/json.
  5. Set Request body to:
{"content": "vigilmon-health-check", "type": "text"}
  1. Set Expected HTTP status to 200 or 201.
  2. Enable Response time alerting and set a threshold of 2000 ms.
  3. Click Save.

This confirms that paste creation — including any database write — completes within your SLA.


Step 3: Monitor the Paste Retrieval Endpoint

Reads should be faster than writes. Create a dedicated monitor for an existing paste:

  1. Create a test paste manually and copy its ID (e.g. abc123).
  2. Add a monitor for https://paste.yourdomain.com/api/paste/abc123.
  3. Set Method to GET, Expected status to 200.
  4. Set a response-time alert at 1000 ms.

If paste retrieval slows down while creation stays fast, you likely have a read-path issue (caching, index degradation, or replica lag if using read replicas).


Step 4: Verify the Encrypted Paste Service

Pastefy encrypts pastes client-side using a key embedded in the URL fragment. The server never sees the plaintext, but the API endpoint still handles the ciphertext store and retrieve cycle. Add a monitor that confirms the /api/paste endpoint accepts the encrypted flag:

  1. Add an HTTP monitor for https://paste.yourdomain.com/api/paste.
  2. Set Method to POST, body:
{"content": "dGVzdA==", "type": "text", "encrypted": true}
  1. Set Expected status to 200 or 201.

A failure here means encrypted paste users get errors even though regular pastes may still work.


Step 5: Check the Authentication Endpoint

Pastefy supports local accounts and OAuth2 providers (GitHub, GitLab, etc.). Monitor the login endpoint to catch auth-service outages:

  1. Add an HTTP monitor for https://paste.yourdomain.com/api/user/login (or the OAuth2 redirect URL your instance uses).
  2. Set Method to GET, Expected status to 200 or 302 (redirect to provider).
  3. Label it Auth service.

An unreachable login endpoint locks users out even when paste creation still works.


Step 6: Monitor Folder Management and the Link Shortener

Pastefy's folder API and link shortener are secondary services but power important workflows.

Folder API:

  1. Add an HTTP monitor for https://paste.yourdomain.com/api/folder.
  2. Set Method to GET, Expected status to 200 or 401 (unauthenticated request is still a healthy response).

Link shortener:

  1. Add an HTTP monitor for https://paste.yourdomain.com/s (the shortener base path).
  2. Set Expected status to 200 or 301.

Step 7: Confirm Admin Panel Accessibility

The admin panel at /admin lets you manage users and system settings. An inaccessible admin panel means you can't respond to abuse or configuration issues:

  1. Add an HTTP monitor for https://paste.yourdomain.com/admin.
  2. Set Expected status to 200 or 302 (redirect to login is healthy; 500 is not).
  3. Set Check interval to 5 minutes — admin panel checks are lower priority than API checks.

Step 8: Heartbeat for the Expired-Paste Cleanup Job

Pastefy can delete pastes after a set expiry. This runs as a background cron job. If the job stops running, expired pastes accumulate and storage fills up silently.

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to match your cleanup schedule (e.g. 60 minutes).
  3. Copy the heartbeat URL: https://vigilmon.online/heartbeat/YOUR_ID.

Add the ping to your cleanup script or cron entry:

# Example: run every hour
0 * * * * /usr/local/bin/pastefy-cleanup && curl -s https://vigilmon.online/heartbeat/YOUR_ID

Or if you run Pastefy via Docker and the cleanup is a scheduled container command:

# docker-compose.yml (example cron container)
command: >
  sh -c "pastefy-cleanup && curl -s https://vigilmon.online/heartbeat/YOUR_ID"

If the job crashes mid-run, it never sends the ping and Vigilmon alerts after the expected interval.


Step 9: SSL/TLS Certificate Expiry Alert

  1. Open the web-interface monitor from Step 1.
  2. Enable Monitor SSL certificate.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

Let's Encrypt renewal is automatic only if your ACME client and port 80 challenge are both healthy. A 21-day window gives you time to investigate and renew manually before users see browser warnings.


Step 10: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and connect Slack, email, or a webhook.
  2. On the paste creation and retrieval monitors, set Consecutive failures before alert to 2 — transient network blips should not page you.
  3. On the heartbeat monitor, keep it at 1 — a missed cleanup job should alert immediately.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web interface | https://paste.yourdomain.com | App crash, proxy failure | | Paste creation API | POST /api/paste | DB write failure, slow performance | | Paste retrieval | GET /api/paste/:id | Read-path degradation | | Encrypted paste | POST /api/paste (encrypted flag) | Encrypted paste flow broken | | Auth endpoint | /api/user/login | Login service down | | Folder API | GET /api/folder | Folder feature broken | | Link shortener | GET /s | Shortener broken | | Admin panel | GET /admin | Admin inaccessible | | Cleanup heartbeat | Cron heartbeat URL | Expired-paste job not running | | SSL certificate | paste.yourdomain.com | TLS cert expiry |

Pastefy gives you a self-hosted paste service with real privacy guarantees — but self-hosted means self-monitored. With Vigilmon watching every layer from the web UI to the cleanup cron, you catch failures before your users do.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →