commit
8c4d463f1e
96 files changed
+3319
No files matched your search
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
case "$1" in
|
||||
configure)
|
||||
if ! getent group easydns-ui >/dev/null 2>&1; then
|
||||
addgroup --system easydns-ui
|
||||
fi
|
||||
if ! id easydns-ui >/dev/null 2>&1; then
|
||||
adduser --system --ingroup easydns-ui --home /nonexistent --no-create-home --disabled-login --gecos 'EasyDNS web UI' easydns-ui
|
||||
fi
|
||||
if getent group easydns >/dev/null 2>&1; then
|
||||
usermod -a -G easydns easydns-ui
|
||||
fi
|
||||
mkdir -p /etc/easydns-ui
|
||||
chown root:easydns-ui /etc/easydns-ui
|
||||
chmod 0750 /etc/easydns-ui
|
||||
if [ ! -s /etc/easydns-ui/panel.password ]; then
|
||||
umask 077
|
||||
head -c 24 /dev/urandom | base64 | tr -d '\n' > /etc/easydns-ui/panel.password
|
||||
printf '\n' >> /etc/easydns-ui/panel.password
|
||||
fi
|
||||
if [ ! -s /etc/easydns-ui/session.key ]; then
|
||||
umask 077
|
||||
head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \n' > /etc/easydns-ui/session.key
|
||||
printf '\n' >> /etc/easydns-ui/session.key
|
||||
fi
|
||||
chown root:easydns-ui /etc/easydns-ui/panel.password /etc/easydns-ui/session.key
|
||||
chmod 0640 /etc/easydns-ui/panel.password /etc/easydns-ui/session.key
|
||||
if [ -f /etc/default/easydns-ui ]; then
|
||||
chown root:easydns-ui /etc/default/easydns-ui
|
||||
chmod 0640 /etc/default/easydns-ui
|
||||
fi
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl daemon-reload
|
||||
systemctl enable easydns-ui.service >/dev/null 2>&1 || true
|
||||
systemctl restart easydns-ui.service >/dev/null 2>&1 || true
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [ "$1" = purge ]; then
|
||||
rm -f /etc/easydns-ui/panel.password /etc/easydns-ui/session.key
|
||||
rmdir /etc/easydns-ui 2>/dev/null || true
|
||||
fi
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl daemon-reload >/dev/null 2>&1 || true
|
||||
fi
|
||||
exit 0
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [ "$1" = remove ] || [ "$1" = deconfigure ]; then
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl stop easydns-ui.service >/dev/null 2>&1 || true
|
||||
systemctl disable easydns-ui.service >/dev/null 2>&1 || true
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
@@ -0,0 +1,12 @@
|
||||
# EasyDNS-Web: independent Go admin panel. No token values are stored here.
|
||||
EASYDNS_UI_LISTEN=127.0.0.1:8088
|
||||
# Option 1: local TCP EasyDNS API; reads its already-generated control.token
|
||||
EASYDNS_API_URL=http://127.0.0.1:9953
|
||||
EASYDNS_API_TOKEN_FILE=/etc/easydns/data/control.token
|
||||
# Option 2: uncomment to use the local control socket; this needs easydns group rights.
|
||||
# EASYDNS_API_SOCKET=/etc/easydns/data/control.sock
|
||||
EASYDNS_UI_PASSWORD_FILE=/etc/easydns-ui/panel.password
|
||||
EASYDNS_UI_SESSION_KEY_FILE=/etc/easydns-ui/session.key
|
||||
EASYDNS_UI_USERNAME=admin
|
||||
# Set to true only if users access the browser over HTTPS (e.g. behind a TLS proxy).
|
||||
EASYDNS_UI_COOKIE_SECURE=false
|
||||
@@ -0,0 +1,33 @@
|
||||
[Unit]
|
||||
Description=EasyDNS Web Administration Panel
|
||||
Documentation=https://git.linuxiarz.pl/gru/EasyDNS
|
||||
Wants=network-online.target
|
||||
After=network-online.target easydns.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=easydns-ui
|
||||
Group=easydns-ui
|
||||
# Installer adds easydns-ui to the easydns group, if it exists.
|
||||
# Unix socket or generated control.token must be accessible to this user.
|
||||
EnvironmentFile=-/etc/default/easydns-ui
|
||||
ExecStart=/usr/bin/easydns-ui
|
||||
Restart=on-failure
|
||||
RestartSec=4s
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelModules=true
|
||||
ProtectControlGroups=true
|
||||
PrivateDevices=true
|
||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
||||
RestrictSUIDSGID=true
|
||||
LockPersonality=true
|
||||
UMask=0077
|
||||
CapabilityBoundingSet=
|
||||
AmbientCapabilities=
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in new issue
Block a user