From 188ffb6c709b09b0e625a418babf51eea153b3ba Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 22 Mar 2022 22:24:15 +0100 Subject: [PATCH] systemd migration --- ressources/adguardhome/debmaker | 39 ++++++++++++------- .../adguardhome/rootfs/DEBIAN/conffiles | 1 + ressources/adguardhome/rootfs/DEBIAN/control | 4 +- .../rootfs/etc/defaults/adguardhome | 4 ++ .../lib}/systemd/system/adguardhome.service | 4 +- .../lib}/systemd/system/authelia.service | 0 .../lib}/systemd/system/gitea.service | 0 ressources/glpi/debmaker | 2 +- .../lib}/systemd/system/gotify.service | 0 .../lib}/systemd/system/joplin-server.service | 0 .../systemd/system/mautrix-syncproxy.service | 0 .../systemd/system/mautrix-whatsapp.service | 0 .../systemd/system/mautrix-wsproxy.service | 0 .../lib}/systemd/system/metabase.service | 0 .../lib}/systemd/system/tt-rss.service | 0 .../lib}/systemd/system/vaultwarden.service | 0 .../lib}/systemd/system/zigbee2mqtt.service | 0 17 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 ressources/adguardhome/rootfs/DEBIAN/conffiles create mode 100644 ressources/adguardhome/rootfs/etc/defaults/adguardhome rename ressources/adguardhome/rootfs/{etc => usr/lib}/systemd/system/adguardhome.service (71%) rename ressources/authelia/rootfs/{etc => usr/lib}/systemd/system/authelia.service (100%) rename ressources/gitea/rootfs/{etc => usr/lib}/systemd/system/gitea.service (100%) rename ressources/gotify/rootfs/{etc => usr/lib}/systemd/system/gotify.service (100%) rename ressources/libretranslate/rootfs/{etc => usr/lib}/systemd/system/joplin-server.service (100%) rename ressources/mautrix-syncproxy/rootfs/{etc => usr/lib}/systemd/system/mautrix-syncproxy.service (100%) rename ressources/mautrix-whatsapp/rootfs/{etc => usr/lib}/systemd/system/mautrix-whatsapp.service (100%) rename ressources/mautrix-wsproxy/rootfs/{etc => usr/lib}/systemd/system/mautrix-wsproxy.service (100%) rename ressources/metabase/rootfs/{etc => usr/lib}/systemd/system/metabase.service (100%) rename ressources/tt-rss/rootfs/{etc => usr/lib}/systemd/system/tt-rss.service (100%) rename ressources/vaultwarden/rootfs/{etc => usr/lib}/systemd/system/vaultwarden.service (100%) rename ressources/zigbee2mqtt/rootfs/{etc => usr/lib}/systemd/system/zigbee2mqtt.service (100%) diff --git a/ressources/adguardhome/debmaker b/ressources/adguardhome/debmaker index df85112..63cc1a5 100755 --- a/ressources/adguardhome/debmaker +++ b/ressources/adguardhome/debmaker @@ -1,32 +1,43 @@ #!/bin/bash +VERSION=0.108.0-b.4 +RELEASE=1 + [ -e ./lib/function.sh ] && source ./lib/function.sh + APP=adguardhome - -VERSION=0.108.0-b.3 -GIT_VERSION=v$VERSION -DEB_VERSION=$VERSION-1 - +DEPOT=https://github.com/AdguardTeam/AdGuardHome.git +GIT_VERSION=v${VERSION} +DEB_VERSION=${VERSION}-${RELEASE} DEBIAN_VERSION_CODENAME=bullseye IMAGE_SIZE=4 STEP="envinit prebuild build makedeb" envinit() { - apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot - wget -qO - https://deb.nodesource.com/setup_16.x | bash - wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg - echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list - apt-get update - apt-get install -y nodejs yarn - wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz + if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ]; + then + apt-get update + apt-get dist-upgrade -y + else + apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot + wget -qO - https://deb.nodesource.com/setup_16.x | bash + wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y nodejs yarn + wget -qO - https://go.dev/dl/go1.18.linux-amd64.tar.gz | tar -C /usr/local -xz + fi } prebuild(){ - git clone --depth 1 -b ${GIT_VERSION} https://github.com/AdguardTeam/AdGuardHome.git /tmp/adguardhome + [ -e /tmp/git ] && rm -fr /tmp/git + [ -e /tmp/${APP} ] || mkdir /tmp/${APP} + git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/git + cp -r /tmp/git/. /tmp/${APP} } build() { - cd /tmp/adguardhome + cd /tmp/${APP} PATH=$PATH:/usr/local/go/bin make } diff --git a/ressources/adguardhome/rootfs/DEBIAN/conffiles b/ressources/adguardhome/rootfs/DEBIAN/conffiles new file mode 100644 index 0000000..31bfc49 --- /dev/null +++ b/ressources/adguardhome/rootfs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/defaults/adguardhome diff --git a/ressources/adguardhome/rootfs/DEBIAN/control b/ressources/adguardhome/rootfs/DEBIAN/control index 80e440d..a88b0f8 100644 --- a/ressources/adguardhome/rootfs/DEBIAN/control +++ b/ressources/adguardhome/rootfs/DEBIAN/control @@ -3,5 +3,5 @@ Version: %VERSION% Section: base Priority: optional Architecture: amd64 -Maintainer: Thomas Legay -Description: adguardhome +Maintainer: Thomas Legay +Description: AdGuard Home is a network-wide software for blocking ads & tracking. After you set it up, it’ll cover ALL your home devices, and you don’t need any client-side software for that. With the rise of Internet-Of-Things and connected devices, it becomes more and more important to be able to control your whole network. diff --git a/ressources/adguardhome/rootfs/etc/defaults/adguardhome b/ressources/adguardhome/rootfs/etc/defaults/adguardhome new file mode 100644 index 0000000..d1c19e3 --- /dev/null +++ b/ressources/adguardhome/rootfs/etc/defaults/adguardhome @@ -0,0 +1,4 @@ +# Options to pass to adguardhome +# see /usr/bin/adguardhome --help + +ADGH_OPTS=-c /etc/adguardhome.yaml -w /var/lib/adguardhome diff --git a/ressources/adguardhome/rootfs/etc/systemd/system/adguardhome.service b/ressources/adguardhome/rootfs/usr/lib/systemd/system/adguardhome.service similarity index 71% rename from ressources/adguardhome/rootfs/etc/systemd/system/adguardhome.service rename to ressources/adguardhome/rootfs/usr/lib/systemd/system/adguardhome.service index 323c536..b8ec2cb 100644 --- a/ressources/adguardhome/rootfs/etc/systemd/system/adguardhome.service +++ b/ressources/adguardhome/rootfs/usr/lib/systemd/system/adguardhome.service @@ -4,10 +4,10 @@ ConditionFileIsExecutable=/usr/bin/adguardhome After=syslog.target network-online.target [Service] -EnvironmentFile=-/etc/default/adguardhome +EnvironmentFile=/etc/default/adguardhome StartLimitInterval=5 StartLimitBurst=10 -ExecStart=/usr/bin/adguardhome -c /etc/adguardhome.yaml -w /var/lib/adguardhome +ExecStart=/usr/bin/adguardhome $ADGH_OPTS WorkingDirectory=/var/lib/adguardhome Restart=always diff --git a/ressources/authelia/rootfs/etc/systemd/system/authelia.service b/ressources/authelia/rootfs/usr/lib/systemd/system/authelia.service similarity index 100% rename from ressources/authelia/rootfs/etc/systemd/system/authelia.service rename to ressources/authelia/rootfs/usr/lib/systemd/system/authelia.service diff --git a/ressources/gitea/rootfs/etc/systemd/system/gitea.service b/ressources/gitea/rootfs/usr/lib/systemd/system/gitea.service similarity index 100% rename from ressources/gitea/rootfs/etc/systemd/system/gitea.service rename to ressources/gitea/rootfs/usr/lib/systemd/system/gitea.service diff --git a/ressources/glpi/debmaker b/ressources/glpi/debmaker index 1b8a3ff..5083ef8 100755 --- a/ressources/glpi/debmaker +++ b/ressources/glpi/debmaker @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=10.0.0-rc2 +VERSION=10.0.0-rc3 [ -e ./lib/function.sh ] && source ./lib/function.sh diff --git a/ressources/gotify/rootfs/etc/systemd/system/gotify.service b/ressources/gotify/rootfs/usr/lib/systemd/system/gotify.service similarity index 100% rename from ressources/gotify/rootfs/etc/systemd/system/gotify.service rename to ressources/gotify/rootfs/usr/lib/systemd/system/gotify.service diff --git a/ressources/libretranslate/rootfs/etc/systemd/system/joplin-server.service b/ressources/libretranslate/rootfs/usr/lib/systemd/system/joplin-server.service similarity index 100% rename from ressources/libretranslate/rootfs/etc/systemd/system/joplin-server.service rename to ressources/libretranslate/rootfs/usr/lib/systemd/system/joplin-server.service diff --git a/ressources/mautrix-syncproxy/rootfs/etc/systemd/system/mautrix-syncproxy.service b/ressources/mautrix-syncproxy/rootfs/usr/lib/systemd/system/mautrix-syncproxy.service similarity index 100% rename from ressources/mautrix-syncproxy/rootfs/etc/systemd/system/mautrix-syncproxy.service rename to ressources/mautrix-syncproxy/rootfs/usr/lib/systemd/system/mautrix-syncproxy.service diff --git a/ressources/mautrix-whatsapp/rootfs/etc/systemd/system/mautrix-whatsapp.service b/ressources/mautrix-whatsapp/rootfs/usr/lib/systemd/system/mautrix-whatsapp.service similarity index 100% rename from ressources/mautrix-whatsapp/rootfs/etc/systemd/system/mautrix-whatsapp.service rename to ressources/mautrix-whatsapp/rootfs/usr/lib/systemd/system/mautrix-whatsapp.service diff --git a/ressources/mautrix-wsproxy/rootfs/etc/systemd/system/mautrix-wsproxy.service b/ressources/mautrix-wsproxy/rootfs/usr/lib/systemd/system/mautrix-wsproxy.service similarity index 100% rename from ressources/mautrix-wsproxy/rootfs/etc/systemd/system/mautrix-wsproxy.service rename to ressources/mautrix-wsproxy/rootfs/usr/lib/systemd/system/mautrix-wsproxy.service diff --git a/ressources/metabase/rootfs/etc/systemd/system/metabase.service b/ressources/metabase/rootfs/usr/lib/systemd/system/metabase.service similarity index 100% rename from ressources/metabase/rootfs/etc/systemd/system/metabase.service rename to ressources/metabase/rootfs/usr/lib/systemd/system/metabase.service diff --git a/ressources/tt-rss/rootfs/etc/systemd/system/tt-rss.service b/ressources/tt-rss/rootfs/usr/lib/systemd/system/tt-rss.service similarity index 100% rename from ressources/tt-rss/rootfs/etc/systemd/system/tt-rss.service rename to ressources/tt-rss/rootfs/usr/lib/systemd/system/tt-rss.service diff --git a/ressources/vaultwarden/rootfs/etc/systemd/system/vaultwarden.service b/ressources/vaultwarden/rootfs/usr/lib/systemd/system/vaultwarden.service similarity index 100% rename from ressources/vaultwarden/rootfs/etc/systemd/system/vaultwarden.service rename to ressources/vaultwarden/rootfs/usr/lib/systemd/system/vaultwarden.service diff --git a/ressources/zigbee2mqtt/rootfs/etc/systemd/system/zigbee2mqtt.service b/ressources/zigbee2mqtt/rootfs/usr/lib/systemd/system/zigbee2mqtt.service similarity index 100% rename from ressources/zigbee2mqtt/rootfs/etc/systemd/system/zigbee2mqtt.service rename to ressources/zigbee2mqtt/rootfs/usr/lib/systemd/system/zigbee2mqtt.service