first commit
This commit is contained in:
10
DEBIAN/control
Normal file
10
DEBIAN/control
Normal file
@@ -0,0 +1,10 @@
|
||||
Package: webhookd
|
||||
Version: 1.0
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Depends: python3, python3-pip
|
||||
Maintainer: Alex Rennie-Lis <a.lis@cornwall-insight.com>
|
||||
Description: A webhook service that executes shell scripts on incoming requests
|
||||
A simple webhook service configured via systemd and /etc/webhookd.conf.
|
||||
|
||||
28
DEBIAN/postinst
Executable file
28
DEBIAN/postinst
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure the configuration directory exists
|
||||
if [ ! -f /etc/webhookd.conf ]; then
|
||||
cat <<EOL > /etc/webhookd.conf
|
||||
# Webhook Daemon Configuration
|
||||
SCRIPT_FOLDER=/webhooks/
|
||||
HOST=0.0.0.0
|
||||
PORT=8443
|
||||
CERT_FILE=/etc/ssl/certs/webhookd.crt
|
||||
KEY_FILE=/etc/ssl/private/webhookd.key
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Create the system user if not exists
|
||||
if ! id -u webhookd >/dev/null 2>&1; then
|
||||
useradd -r -s /bin/false webhookd
|
||||
fi
|
||||
|
||||
# Set ownership for the script folder
|
||||
mkdir -p /webhooks/
|
||||
chown -R webhookd:webhookd /webhooks/
|
||||
|
||||
# Reload systemd and enable the service
|
||||
systemctl daemon-reload
|
||||
systemctl enable webhookd.service
|
||||
systemctl start webhookd.service
|
||||
|
||||
Reference in New Issue
Block a user