mirror of
https://github.com/taigrr/github-to-signal.git
synced 2026-04-02 03:09:09 -07:00
feat: add systemd services and nginx config
- signal-cli-bot.service: runs signal-cli daemon on 127.0.0.1:8081 - github-to-signal.service: depends on signal-cli-bot, auto-starts it - nginx reverse proxy with TLS termination - README updated with full deployment instructions
This commit is contained in:
28
deploy/github-to-signal.nginx.conf
Normal file
28
deploy/github-to-signal.nginx.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name ghwebhook.example.com;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/ghwebhook.example.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/ghwebhook.example.com/privkey.pem;
|
||||
|
||||
location /webhook {
|
||||
proxy_pass http://127.0.0.1:9900;
|
||||
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;
|
||||
|
||||
# GitHub webhooks are small and fast
|
||||
proxy_read_timeout 30s;
|
||||
client_max_body_size 1m;
|
||||
}
|
||||
|
||||
location /health {
|
||||
proxy_pass http://127.0.0.1:9900;
|
||||
}
|
||||
|
||||
# Block everything else
|
||||
location / {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
23
deploy/github-to-signal.service
Normal file
23
deploy/github-to-signal.service
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=GitHub webhook to Signal notifications
|
||||
After=signal-cli-bot.service
|
||||
Requires=signal-cli-bot.service
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStart=/usr/local/bin/github-to-signal
|
||||
WorkingDirectory=/etc/github-to-signal
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
# Hardening
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
|
||||
User=signal-bot
|
||||
Group=signal-bot
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
23
deploy/signal-cli-bot.service
Normal file
23
deploy/signal-cli-bot.service
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=signal-cli daemon for github-to-signal bot
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStart=/usr/local/bin/signal-cli -a +1YOURNUMBER daemon --http 127.0.0.1:8081 --no-receive-stdout
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
# Hardening
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=read-only
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/home/signal-bot/.local/share/signal-cli
|
||||
|
||||
User=signal-bot
|
||||
Group=signal-bot
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user