not so small webring backend, written in go
Go to file
2026-02-16 00:33:15 +03:00
.github/workflows refactor: update site structure, add CSRF, tests, telegram notifications 2025-11-10 14:43:25 +03:00
cmd/server implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00
docs moved docs to api/docs 2025-12-08 18:51:34 +03:00
internal implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00
messages implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00
migrations feat: Add enabled status to sites and enabled toggle 2026-01-12 00:17:13 +03:00
nix build(nix): Update package vendorHash 2026-02-16 00:33:15 +03:00
static feat: Add enabled status to sites and enabled toggle 2026-01-12 00:17:13 +03:00
.air.toml added telegram oauth, submittions, dispaly order, admin 2025-08-08 16:36:09 +03:00
.env.template implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00
.gitguardian.yml refactor: update site structure, add CSRF, tests, telegram notifications 2025-11-10 14:43:25 +03:00
.gitignore added favicon for sites, list all sites api and page, disabled cors for api, minor fixes 2024-07-17 02:48:53 +03:00
.golangci.yml enhance error handling and user feedback for site requests 2025-12-02 00:14:00 +03:00
Dockerfile implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00
embedded.go refactor: update swagger handlers to use embedded file system for api docs 2025-11-30 18:21:20 +03:00
flake.lock build: Implement nix flake (#5) 2025-11-27 19:18:51 +03:00
flake.nix build: Implement nix flake (#5) 2025-11-27 19:18:51 +03:00
go.mod implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00
go.sum implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00
Makefile refactor: update site structure, add CSRF, tests, telegram notifications 2025-11-10 14:43:25 +03:00
README.md implement Telegram message templates for notifications 2026-02-10 20:56:01 +03:00

Webring Relay Service

This project is a webring relay service built with Go. It manages a list of websites, checks their uptime, and provides a dashboard for administration.

Features

  • Dashboard for managing websites in the webring
  • Automatic uptime checking of websites (with proxy support)
  • API endpoints for navigating the webring
  • Telegram authentication and user management
  • Site submission and update request workflow with admin approval
  • Telegram notifications for status changes, submissions and approvals
  • Customizable notification messages via template files
  • Basic authentication for the dashboard

Prerequisites

  • Go 1.16 or later
  • PostgreSQL database

Installation

edit .env to set correct path to database

go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
go mod tidy
cp .env.template .env
make migrate-up

Local Run

go run cmd/server/main.go

or download prebuild version

wget https://github.com/Alexander-D-Karpov/webring/releases/latest/download/webring
chmod +x webring
./webring

Customizing Notification Messages

Telegram notification templates live in the messages/ directory (configurable via MESSAGES_DIR env var). Each file is plain text with Go template syntax and MarkdownV2 formatting.

To customize a message, edit the corresponding .txt file.

Available templates:

File Event
new_request_create.txt Admin notification: new site submitted
new_request_update.txt Admin notification: site update requested
approved_create.txt User notification: site submission approved
approved_update.txt User notification: site update approved
declined_create.txt User notification: site submission declined
declined_update.txt User notification: site update declined
admin_approved_create.txt Other admins: site creation approved
admin_approved_update.txt Other admins: site update approved
admin_declined_create.txt Other admins: site creation declined
admin_declined_update.txt Other admins: site update declined
site_online.txt Owner notification: site back online
site_offline.txt Owner notification: site went offline

Usage

  • Access the dashboard at http://localhost:8080/dashboard (use the credentials set in your .env file)
  • API endpoints:
    • Next site: GET /{slug}/next/data
    • Previous site: GET /{slug}/prev/data
    • Random site: GET /{slug}/random/data
    • Full data for a site: GET /{slug}/data
  • Redirect endpoints:
    • Visit site: GET /{slug}
    • Next site: GET /{slug}/next
    • Previous site: GET /{slug}/prev
    • Random site: GET /{slug}/random