Files
c-relay-pg/systemd/c-relay.service
T

44 lines
1.2 KiB
Desktop File

[Unit]
Description=C Nostr Relay Server (PostgreSQL Backend)
Documentation=https://github.com/your-repo/c-relay-pg
After=network.target network-online.target postgresql.service
Wants=network-online.target
Requires=postgresql.service
[Service]
Type=simple
User=c-relay-pg
Group=c-relay-pg
WorkingDirectory=/opt/c-relay-pg
ExecStart=/usr/local/bin/c_relay_pg/c_relay_pg --debug-level=0 --db-host /var/run/postgresql --db-name crelay --db-user c-relay-pg
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=c-relay-pg
# Security settings
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/opt/c-relay-pg
PrivateTmp=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
# Network security
PrivateNetwork=false
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
# Resource limits
LimitNOFILE=65536
LimitNPROC=4096
# Event-based configuration system
# No config files needed - configuration is stored as signed Nostr events
# Database files (<relay_pubkey>.db) are created by the relay in WorkingDirectory
# Admin private key is shown once on first startup only
[Install]
WantedBy=multi-user.target