Transmissions can be deployed as a Docker service, running NewsMonitor as a continuously updating feed aggregator with an HTTP server for generated HTML.
- Transmissions Container: Runs periodic feed updates and serves dynamic web frontend via HTTP
- Web Frontend: Modern, responsive UI with real-time post summaries and search
- REST API: JSON endpoints for posts, feeds, and statistics
- Fuseki Server: External SPARQL endpoint (fuseki.hyperdata.it or localhost:3030)
- HTTPS Proxy: Your existing proxy forwards HTTPS traffic to the HTTP port
The NewsMonitor frontend provides:
- Real-time Updates: Auto-refreshes every 5 minutes
- Search: Filter posts by title, content, author, or feed
- Pagination: Browse through posts with customizable page size
- Responsive Design: Works on desktop, tablet, and mobile
- Feed Statistics: View total posts and subscribed feeds
GET /api/posts?limit=50&offset=0- Get recent posts with summariesGET /api/count- Get total post countGET /api/feeds- Get list of subscribed feeds with statistics
# Copy example environment file
cp .env.example .env
# Edit with your settings
nano .envProduction .env example:
NODE_ENV=production
FUSEKI_USERNAME=admin
FUSEKI_PASSWORD=your-secure-password
FUSEKI_BASEURL=https://fuseki.hyperdata.it
NEWSMONITOR_PORT=6010
UPDATE_INTERVAL=3600000
RENDER_INTERVAL=300000# Build the image
docker compose build --no-cache
# Start the service
docker compose up -d
# View logs
docker compose logs -f newsmonitorPoint your existing HTTPS proxy to:
- Target:
http://localhost:6010(or your configured NEWSMONITOR_PORT) - Path: Forward all requests to the container
Example nginx configuration:
server {
listen 443 ssl;
server_name newsmonitor.hyperdata.it;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:6010;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}| Variable | Default | Description |
|---|---|---|
NODE_ENV |
production |
Environment (development/production/test) |
FUSEKI_USERNAME |
- | Fuseki admin username |
FUSEKI_PASSWORD |
- | Fuseki admin password |
FUSEKI_BASEURL |
From config | Override Fuseki base URL |
NEWSMONITOR_PORT |
6010 |
HTTP server port |
UPDATE_INTERVAL |
3600000 |
Feed update interval (ms) |
RENDER_INTERVAL |
300000 |
HTML render interval (ms) |
Edit config/services.json for:
- Environment-specific endpoints
- Port defaults
- Dataset configurations
docker compose up -ddocker compose stopdocker compose restart# Follow logs
docker compose logs -f newsmonitor
# Last 100 lines
docker compose logs --tail=100 newsmonitor# Pull latest code
git pull
# Rebuild and restart
docker compose down
docker compose build
docker compose up -dRun transmissions commands inside the container:
# Subscribe to a new feed
docker compose exec newsmonitor ./trans src/apps/newsmonitor/subscribe -m '{"url":"https://example.com/feed.xml"}'
# Update all feeds now
docker compose exec newsmonitor ./trans src/apps/newsmonitor/update-all
# Render HTML now
docker compose exec newsmonitor ./trans src/apps/newsmonitor/render-to-html
# Shell access
docker compose exec newsmonitor shThe container mounts ./src/apps/newsmonitor/data for persistence:
- Generated HTML files
- Feed lists
- Configuration files
This directory persists across container restarts.
The scheduler (docker/newsmonitor-scheduler.js):
- Startup: Generates endpoints.json from Config
- Initial Run: Updates feeds and renders HTML
- Periodic Updates: Fetches new entries from all subscribed feeds
- Periodic Rendering: Regenerates HTML from SPARQL data
- HTTP Server: Serves generated HTML on configured port
Docker health check runs every 30 seconds:
# Check health status
docker compose ps# Watch for errors
docker compose logs -f newsmonitor | grep -i error
# Watch for updates
docker compose logs -f newsmonitor | grep -i "updating all feeds"Check logs:
docker compose logs newsmonitorCommon issues:
- Missing
.envfile - Invalid Fuseki credentials
- Port conflict on 6010
- Check Fuseki connectivity:
docker compose exec newsmonitor curl -u admin:password http://fuseki-host:3030/newsmonitor/query- Check feed subscriptions:
docker compose exec newsmonitor ./trans src/apps/newsmonitor/subscribe -m '{"url":"https://hnrss.org/frontpage"}'- Force update:
docker compose exec newsmonitor ./trans src/apps/newsmonitor/update-all- Force render:
docker compose exec newsmonitor ./trans src/apps/newsmonitor/render-to-html- Check output file:
ls -lah src/apps/newsmonitor/data/index.html- Verify container is running:
docker compose ps- Test HTTP endpoint:
curl http://localhost:6010/- Check port mapping:
docker compose port newsmonitor 6010For local development with localhost Fuseki:
# .env for development
NODE_ENV=development
FUSEKI_USERNAME=admin
FUSEKI_PASSWORD=admin123
NEWSMONITOR_PORT=6010Run without Docker:
# Generate endpoints
node src/apps/newsmonitor/generate-endpoints.js
# Run scheduler locally
node docker/newsmonitor-scheduler.js# Backup SPARQL data (via Fuseki admin interface or backup tools)
# Backup feed list
cp src/apps/newsmonitor/data/feeds.md feeds.md.backup# Restore feed list
cp feeds.md.backup src/apps/newsmonitor/data/feeds.md
# Re-subscribe
docker compose exec newsmonitor ./trans src/apps/newsmonitor/subscribe-from-file
# Update all
docker compose exec newsmonitor ./trans src/apps/newsmonitor/update-all- Credentials: Never commit
.envto version control - HTTPS: Always use HTTPS proxy in production
- Firewall: Don't expose Docker port directly to internet
- Updates: Keep base image and dependencies updated
Balance freshness vs. server load:
- High-frequency:
UPDATE_INTERVAL=1800000(30 minutes) - Standard:
UPDATE_INTERVAL=3600000(1 hour) - Low-frequency:
UPDATE_INTERVAL=21600000(6 hours)
Add to docker compose.yml:
services:
newsmonitor:
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256MFor issues:
- Check logs:
docker compose logs newsmonitor - Verify configuration in
config/services.json - Test Fuseki connectivity
- Review NewsMonitor README