Initial commit.

This commit is contained in:
2025-10-11 17:15:56 +00:00
commit 2b61d99951
23 changed files with 1755 additions and 0 deletions

10
debian/DEBIAN/control vendored Normal file
View File

@@ -0,0 +1,10 @@
Package: wild-cloud-central
Version: VERSION_PLACEHOLDER
Section: net
Priority: optional
Architecture: ARCH_PLACEHOLDER
Depends: dnsmasq, nginx
Maintainer: Wild Cloud Team <paul@payne.io>
Description: Wild Cloud Central Management Service
A web-based management service for wild-cloud infrastructure
providing DNS, DHCP, and PXE boot services configuration.

62
debian/DEBIAN/postinst vendored Normal file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
set -e
case "$1" in
configure)
echo "Configuring wild-cloud-central..."
# Create wildcloud user if it doesn't exist
if ! id wildcloud >/dev/null 2>&1; then
useradd --system --home-dir /var/lib/wild-cloud-central --create-home --shell /bin/false wildcloud
fi
# Create required directories
mkdir -p /var/lib/wild-cloud-central
mkdir -p /var/log/wild-cloud-central
mkdir -p /var/www/html/talos
mkdir -p /var/ftpd
# Set ownership of wildcloud-managed files and directories
chown wildcloud:wildcloud /var/lib/wild-cloud-central
chown wildcloud:wildcloud /var/log/wild-cloud-central
# Force ownership of talos directory (critical for PXE assets)
echo "Setting ownership of /var/www/html/talos/ to wildcloud"
chown -R wildcloud:wildcloud /var/www/html/talos/
echo "Setting ownership of /var/ftpd/ to wildcloud"
chown -R wildcloud:wildcloud /var/ftpd
# Set ownership of dnsmasq.conf if it exists
if [ -f /etc/dnsmasq.conf ]; then
chown wildcloud:wildcloud /etc/dnsmasq.conf
# TODO: /etc/dnsmasq.d/wild-cloud.conf
fi
# Install sudoers file
if [ -f /etc/wild-cloud-central/wild-cloud-central.sudoers ]; then
mkdir -p /etc/sudoers.d
cp /etc/wild-cloud-central/wild-cloud-central.sudoers /etc/sudoers.d/wild-cloud-central
chmod 440 /etc/sudoers.d/wild-cloud-central
fi
# Enable and start the service
systemctl daemon-reload
systemctl enable wild-cloud-central.service
echo "wild-cloud-central configured successfully"
echo "Start the service with: sudo systemctl start wild-cloud-central"
echo "View logs with: sudo journalctl -u wild-cloud-central -f"
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0

46
debian/DEBIAN/postrm vendored Normal file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
set -e
case "$1" in
purge)
echo "Purging wild-cloud-central configuration..."
# Remove sudoers file
if [ -f /etc/sudoers.d/wild-cloud-central ]; then
rm -f /etc/sudoers.d/wild-cloud-central
fi
# Remove configuration directory
if [ -d /etc/wild-cloud-central ]; then
rm -rf /etc/wild-cloud-central
fi
# Remove log directory
if [ -d /var/log/wild-cloud-central ]; then
rm -rf /var/log/wild-cloud-central
fi
# Remove lib directory
if [ -d /var/lib/wild-cloud-central ]; then
rm -rf /var/lib/wild-cloud-central
fi
# Remove wildcloud user
if id wildcloud >/dev/null 2>&1; then
userdel wildcloud || true
fi
echo "wild-cloud-central purged successfully"
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0

28
debian/DEBIAN/prerm vendored Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
set -e
case "$1" in
remove|upgrade|deconfigure)
echo "Stopping wild-cloud-central service..."
# Stop and disable the service
if systemctl is-active --quiet wild-cloud-central; then
systemctl stop wild-cloud-central
fi
if systemctl is-enabled --quiet wild-cloud-central; then
systemctl disable wild-cloud-central
fi
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0