webhook setup
This commit is contained in:
@@ -7,7 +7,7 @@ DefaultDependencies=no
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME=/root"
|
||||
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker kill virt-nexus-timer 2>/dev/null || true'
|
||||
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker stop -t 3 virt-nexus-timer 2>/dev/null || true'
|
||||
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker rm virt-nexus-timer 2>/dev/null || true'
|
||||
|
||||
ExecStart=/usr/bin/env docker run \
|
||||
@@ -17,7 +17,7 @@ ExecStart=/usr/bin/env docker run \
|
||||
--label-file /virt/nexus-timer/labels \
|
||||
virt-nexus-timer
|
||||
|
||||
ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker kill virt-nexus-timer 2>/dev/null || true'
|
||||
ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker stop -t 3 virt-nexus-timer 2>/dev/null || true'
|
||||
ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker rm virt-nexus-timer 2>/dev/null || true'
|
||||
|
||||
Restart=always
|
||||
|
||||
35
systemd/webhook.service
Normal file
35
systemd/webhook.service
Normal file
@@ -0,0 +1,35 @@
|
||||
[Unit]
|
||||
Description=Small server for creating HTTP endpoints (hooks)
|
||||
Documentation=https://github.com/adnanh/webhook/
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
ConditionPathExists=/etc/webhook.conf
|
||||
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
# Clear any existing ExecStart from a base unit file, if any
|
||||
ExecStart=
|
||||
# Path to webhook, IP, port, path to hooks config, verbose logging, hot-reloading config
|
||||
ExecStart=/usr/bin/webhook -ip 10.0.0.1 -port 9000 -verbose -nopanic -hooks /etc/webhook.conf
|
||||
|
||||
# --- Security & User (Recommended) ---
|
||||
# 1. Create a dedicated user:
|
||||
# sudo useradd --system --no-create-home --shell /bin/false webhooksvc
|
||||
# 2. Ensure this user can read /etc/webhook.conf and execute redeploy.sh
|
||||
# sudo chown webhooksvc:webhooksvc /etc/webhook.conf && sudo chmod 640 /etc/webhook.conf
|
||||
# Also grant sudo rights for systemctl restart as mentioned in Step 3.1.
|
||||
# Uncomment and use if you created the 'webhooksvc' user:
|
||||
# User=webhooksvc
|
||||
# Group=webhooksvc
|
||||
# If running as root (less secure), leave User/Group commented.
|
||||
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
TimeoutStopSec=30s
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user