diff --git a/README.MD b/README.MD index dca08af..e7fffbf 100644 --- a/README.MD +++ b/README.MD @@ -15,6 +15,7 @@ debmaker_run ### packages available in shared repository - [authelia](#authelia) + - [adguardhome](#adguardhome) - [element-web](#element-web) - [gotify](#gotify) - [grocy](#grocy) @@ -26,6 +27,16 @@ debmaker_run - [wallabag](#wallabag) - [zigbee2mqtt](#zigbee2mqtt) +#### adguardhome +apt install -y wget ca-certificates +wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update +apt-get install -y adguardhome + +systemctl enable --now adguardhome + +#configuration with http://:3000 + #### authelia apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash diff --git a/adguardhome2deb b/adguardhome2deb new file mode 100755 index 0000000..ba99ac9 --- /dev/null +++ b/adguardhome2deb @@ -0,0 +1,10 @@ +#!/bin/bash + +APP=adguardhome +VERSION=0.108.0-b.3 +GIT_VERSION=v$VERSION +DEB_VERSION=$VERSION-1 +DEBIAN_VERSION_CODENAME=bullseye +IMAGE_SIZE=4 + +source ./lib/function.sh diff --git a/lib/function.sh b/lib/function.sh index f6828db..c1a0c34 100644 --- a/lib/function.sh +++ b/lib/function.sh @@ -1,15 +1,18 @@ #!/bin/bash + source ressources/${APP}/${APP} DEBOOTSTRAP_DIR=cache/debootstrap/ MOUNT_PATH=/mnt/debmaker zdebmaker_getDep(){ + sudo sleep 0 [ -d cache ] || mkdir cache [ -d dist ] || mkdir dist [ -d ${DEBOOTSTRAP_DIR} ] || debmaker_debootstrapUpdate } zdebmaker_createOS(){ + zdebmaker_getDep dd if=/dev/zero of=cache/${DEBIAN_VERSION_CODENAME}.tmp bs=100M count=5 sudo mkfs.ext4 cache/${DEBIAN_VERSION_CODENAME}.tmp [ -d ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}/ ] || sudo mkdir -p ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}/ @@ -20,6 +23,7 @@ zdebmaker_createOS(){ } zdebmaker_createAppOS(){ + zdebmaker_getDep [ -f cache/${DEBIAN_VERSION_CODENAME} ] || zdebmaker_createOS [ "${IMAGE_SIZE}" == "" ] && IMAGE_SIZE=2 @@ -37,18 +41,21 @@ zdebmaker_createAppOS(){ } zdebmaker_inject(){ + zdebmaker_getDep sudo mount cache/${APP} ${MOUNT_PATH}/${APP}/ [ -d ${MOUNT_PATH}/${APP}/tmp/dist ] || sudo mkdir ${MOUNT_PATH}/${APP}/tmp/dist/ [ -d ${MOUNT_PATH}/${APP}/tmp/src ] && sudo rm -rf ${MOUNT_PATH}/${APP}/tmp/src/ sudo mkdir -p ${MOUNT_PATH}/${APP}/tmp/src sudo cp -fr ressources/${APP}/* ${MOUNT_PATH}/${APP}/tmp/src sudo cp -fr lib/exec_in_chroot.sh ${MOUNT_PATH}/${APP}/tmp/src + find ${MOUNT_PATH}/${APP}/tmp/src -name .gitkeep -exec rm {} \; sudo umount ${MOUNT_PATH}/${APP}/ } debmaker_mount_proc_sys(){ OPEN_FILE=$1 OPEN_DIR=$2 + zdebmaker_getDep [ -d ${OPEN_FILE} ] || sudo mkdir -p ${OPEN_DIR} sudo mount ${OPEN_FILE} ${OPEN_DIR} [ -d ${OPEN_DIR}/proc ] || sudo mkdir -p ${OPEN_DIR}/proc @@ -59,6 +66,7 @@ debmaker_mount_proc_sys(){ debmaker_umount_proc_sys(){ OPEN_DIR=$1 + zdebmaker_getDep sudo umount ${OPEN_DIR}/sys sudo umount ${OPEN_DIR}/proc sudo umount ${OPEN_DIR} @@ -66,12 +74,14 @@ debmaker_umount_proc_sys(){ debmaker_chroot() { OPEN_FILE=$1 + zdebmaker_getDep debmaker_mount_proc_sys ${OPEN_FILE} ${MOUNT_PATH}/${APP}/ sudo chroot ${MOUNT_PATH}/${APP}/ debmaker_umount_proc_sys ${MOUNT_PATH}/${APP}/ } debmaker_run(){ + zdebmaker_getDep [ -f cache/${APP} ] || zdebmaker_createAppOS zdebmaker_inject debmaker_mount_proc_sys cache/${APP} ${MOUNT_PATH}/${APP}/ @@ -84,11 +94,9 @@ debmaker_run(){ } debmaker_debootstrapUpdate(){ + zdebmaker_getDep [ -d ${DEBOOTSTRAP_DIR} ] || mkdir ${DEBOOTSTRAP_DIR} URL=https://salsa.debian.org/installer-team/debootstrap/-/archive/master/debootstrap-master.tar.gz FILES="debootstrap-master/debootstrap debootstrap-master/scripts/ debootstrap-master/functions" wget -qO - ${URL} | tar -C ${DEBOOTSTRAP_DIR} --strip-components=1 -zx ${FILES} } - -zdebmaker_getDep - diff --git a/ressources/adguardhome/adguardhome b/ressources/adguardhome/adguardhome new file mode 100755 index 0000000..367c400 --- /dev/null +++ b/ressources/adguardhome/adguardhome @@ -0,0 +1,34 @@ +#!/bin/bash + +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 +} + +prebuild(){ + GIT_VERSION=$1 + git clone --depth 1 -b ${GIT_VERSION} https://github.com/AdguardTeam/AdGuardHome.git /tmp/adguardhome +} + +build() { + cd /tmp/adguardhome + PATH=$PATH:/usr/local/go/bin + make +} + +makedeb(){ + GIT_VERSION=$1 + DEB_VERSION=$2 + PATH_DEB=/tmp/src/rootfs + + cp /tmp/adguardhome/AdGuardHome ${PATH_DEB}/usr/bin/adguardhome + sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control + fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist +} diff --git a/ressources/adguardhome/rootfs/DEBIAN/changelog b/ressources/adguardhome/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/adguardhome/rootfs/DEBIAN/control b/ressources/adguardhome/rootfs/DEBIAN/control new file mode 100644 index 0000000..80e440d --- /dev/null +++ b/ressources/adguardhome/rootfs/DEBIAN/control @@ -0,0 +1,7 @@ +Package: adguardhome +Version: %VERSION% +Section: base +Priority: optional +Architecture: amd64 +Maintainer: Thomas Legay +Description: adguardhome diff --git a/ressources/adguardhome/rootfs/etc/systemd/system/adguardhome.service b/ressources/adguardhome/rootfs/etc/systemd/system/adguardhome.service new file mode 100644 index 0000000..323c536 --- /dev/null +++ b/ressources/adguardhome/rootfs/etc/systemd/system/adguardhome.service @@ -0,0 +1,17 @@ +[Unit] +Description=AdGuard Home: Network-level blocker +ConditionFileIsExecutable=/usr/bin/adguardhome +After=syslog.target network-online.target + +[Service] +EnvironmentFile=-/etc/default/adguardhome +StartLimitInterval=5 +StartLimitBurst=10 +ExecStart=/usr/bin/adguardhome -c /etc/adguardhome.yaml -w /var/lib/adguardhome +WorkingDirectory=/var/lib/adguardhome + +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/ressources/adguardhome/rootfs/usr/bin/.gitkeep b/ressources/adguardhome/rootfs/usr/bin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/adguardhome/rootfs/var/lib/adguardhome/.gitkeep b/ressources/adguardhome/rootfs/var/lib/adguardhome/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/authelia/rootfs/etc/authelia/.gitkeep b/ressources/authelia/rootfs/etc/authelia/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/authelia/rootfs/usr/bin/.gitkeep b/ressources/authelia/rootfs/usr/bin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/element-web/rootfs/etc/element-web/.gitkeep b/ressources/element-web/rootfs/etc/element-web/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/element-web/rootfs/usr/lib/element-web/.gitkeep b/ressources/element-web/rootfs/usr/lib/element-web/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/gotify/rootfs/etc/gotify/.gitkeep b/ressources/gotify/rootfs/etc/gotify/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/gotify/rootfs/usr/bin/.gitkeep b/ressources/gotify/rootfs/usr/bin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/gotify/rootfs/usr/share/grocy/.gitkeep b/ressources/gotify/rootfs/usr/share/grocy/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/gotify/rootfs/var/lib/gotify/.gitkeep b/ressources/gotify/rootfs/var/lib/gotify/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/grocy/rootfs/etc/grocy/.gitkeep b/ressources/grocy/rootfs/etc/grocy/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/grocy/rootfs/etc/grocy/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/grocy/rootfs/usr/share/grocy/.gitkeep b/ressources/grocy/rootfs/usr/share/grocy/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/grocy/rootfs/usr/share/grocy/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/grocy/rootfs/var/lib/grocy/.gitkeep b/ressources/grocy/rootfs/var/lib/grocy/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/grocy/rootfs/var/lib/grocy/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/joplin-server/rootfs/usr/lib/joplin-server/.gitkeep b/ressources/joplin-server/rootfs/usr/lib/joplin-server/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/joplin-server/rootfs/usr/lib/joplin-server/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/mautrix-syncproxy/rootfs/usr/bin/.gitkeep b/ressources/mautrix-syncproxy/rootfs/usr/bin/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/mautrix-syncproxy/rootfs/usr/bin/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/mautrix-whatsapp/rootfs/etc/mautrix-whatsapp/.gitkeep b/ressources/mautrix-whatsapp/rootfs/etc/mautrix-whatsapp/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/mautrix-whatsapp/rootfs/etc/mautrix-whatsapp/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/mautrix-whatsapp/rootfs/usr/lib/mautrix-whatsapp/.gitkeep b/ressources/mautrix-whatsapp/rootfs/usr/lib/mautrix-whatsapp/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/mautrix-whatsapp/rootfs/usr/lib/mautrix-whatsapp/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/mautrix-wsproxy/rootfs/usr/bin/.gitkeep b/ressources/mautrix-wsproxy/rootfs/usr/bin/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/mautrix-wsproxy/rootfs/usr/bin/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/rss-bridge/rootfs/etc/rss-bridge/.gitkeep b/ressources/rss-bridge/rootfs/etc/rss-bridge/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/rss-bridge/rootfs/etc/rss-bridge/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/standardnotes-web/rootfs/usr/lib/standardnotes/web/.gitkeep b/ressources/standardnotes-web/rootfs/usr/lib/standardnotes/web/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/standardnotes-web/rootfs/usr/lib/standardnotes/web/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/tt-rss/rootfs/etc/tt-rss/.gitkeep b/ressources/tt-rss/rootfs/etc/tt-rss/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/tt-rss/rootfs/etc/tt-rss/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/tt-rss/rootfs/usr/share/tt-rss/.gitkeep b/ressources/tt-rss/rootfs/usr/share/tt-rss/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/tt-rss/rootfs/usr/share/tt-rss/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/tt-rss/rootfs/var/lib/tt-rss/.gitkeep b/ressources/tt-rss/rootfs/var/lib/tt-rss/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/tt-rss/rootfs/var/lib/tt-rss/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/vaultwarden-web/rootfs/usr/share/vaultwarden-web/.gitkeep b/ressources/vaultwarden-web/rootfs/usr/share/vaultwarden-web/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/vaultwarden-web/rootfs/usr/share/vaultwarden-web/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/vaultwarden/rootfs/usr/lib/vaultwarden/.gitkeep b/ressources/vaultwarden/rootfs/usr/lib/vaultwarden/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/vaultwarden/rootfs/usr/lib/vaultwarden/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/vaultwarden/rootfs/var/lib/vaultwarden/.gitkeep b/ressources/vaultwarden/rootfs/var/lib/vaultwarden/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/vaultwarden/rootfs/var/lib/vaultwarden/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/wallabag/rootfs/etc/wallabag/.gitkeep b/ressources/wallabag/rootfs/etc/wallabag/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/wallabag/rootfs/etc/wallabag/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/wallabag/rootfs/usr/share/wallabag/.gitkeep b/ressources/wallabag/rootfs/usr/share/wallabag/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/wallabag/rootfs/usr/share/wallabag/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/wallabag/rootfs/var/lib/wallabag/.gitkeep b/ressources/wallabag/rootfs/var/lib/wallabag/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/wallabag/rootfs/var/lib/wallabag/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/zigbee2mqtt/rootfs/etc/zigbee2mqtt/.gitkeep b/ressources/zigbee2mqtt/rootfs/etc/zigbee2mqtt/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/etc/zigbee2mqtt/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/zigbee2mqtt/rootfs/usr/lib/zigbee2mqtt/.gitkeep b/ressources/zigbee2mqtt/rootfs/usr/lib/zigbee2mqtt/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/usr/lib/zigbee2mqtt/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/zigbee2mqtt/rootfs/var/lib/zigbee2mqtt/.gitkeep b/ressources/zigbee2mqtt/rootfs/var/lib/zigbee2mqtt/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/var/lib/zigbee2mqtt/.gitkeep @@ -0,0 +1 @@ +