From ed80d22552c3c7e5bef150c391214f4eee73d97e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 3 Feb 2022 22:51:24 +0100 Subject: [PATCH] Add zigbee2mqtt Add gotify (not work) --- README.MD | 36 ++++++++++++------- element-web2deb | 2 +- gotify | 10 ++++++ joplin-server2deb | 4 +-- lib/function.sh | 33 ++++++++++++++--- ressources/gotify/build | 4 +++ ressources/gotify/envinit | 8 +++++ ressources/gotify/makedeb | 8 +++++ ressources/gotify/prebuild | 6 ++++ ressources/gotify/rootfs/DEBIAN/changelog | 0 ressources/gotify/rootfs/DEBIAN/conffiles | 1 + ressources/gotify/rootfs/DEBIAN/control | 7 ++++ ressources/gotify/rootfs/DEBIAN/postinst | 4 +++ .../rootfs/etc/systemd/system/gotify.service | 13 +++++++ .../joplin-server/rootfs/DEBIAN/postinst | 4 +-- ressources/zigbee2mqtt/build | 4 +++ ressources/zigbee2mqtt/envinit | 3 ++ ressources/zigbee2mqtt/makedeb | 8 +++++ ressources/zigbee2mqtt/prebuild | 6 ++++ .../zigbee2mqtt/rootfs/DEBIAN/changelog | 0 .../zigbee2mqtt/rootfs/DEBIAN/conffiles | 1 + ressources/zigbee2mqtt/rootfs/DEBIAN/control | 8 +++++ ressources/zigbee2mqtt/rootfs/DEBIAN/postinst | 4 +++ .../rootfs/etc/default/zigbee2mqtt | 2 ++ .../etc/systemd/system/zigbee2mqtt.service | 16 +++++++++ vaultwarden2deb | 4 +-- zigbee2mqtt2deb | 9 +++++ 27 files changed, 181 insertions(+), 24 deletions(-) create mode 100755 gotify create mode 100755 ressources/gotify/build create mode 100755 ressources/gotify/envinit create mode 100644 ressources/gotify/makedeb create mode 100755 ressources/gotify/prebuild create mode 100644 ressources/gotify/rootfs/DEBIAN/changelog create mode 100644 ressources/gotify/rootfs/DEBIAN/conffiles create mode 100644 ressources/gotify/rootfs/DEBIAN/control create mode 100755 ressources/gotify/rootfs/DEBIAN/postinst create mode 100644 ressources/gotify/rootfs/etc/systemd/system/gotify.service create mode 100755 ressources/zigbee2mqtt/build create mode 100755 ressources/zigbee2mqtt/envinit create mode 100644 ressources/zigbee2mqtt/makedeb create mode 100755 ressources/zigbee2mqtt/prebuild create mode 100644 ressources/zigbee2mqtt/rootfs/DEBIAN/changelog create mode 100644 ressources/zigbee2mqtt/rootfs/DEBIAN/conffiles create mode 100644 ressources/zigbee2mqtt/rootfs/DEBIAN/control create mode 100755 ressources/zigbee2mqtt/rootfs/DEBIAN/postinst create mode 100644 ressources/zigbee2mqtt/rootfs/etc/default/zigbee2mqtt create mode 100644 ressources/zigbee2mqtt/rootfs/etc/systemd/system/zigbee2mqtt.service create mode 100755 zigbee2mqtt2deb diff --git a/README.MD b/README.MD index 6ef440f..df30f99 100644 --- a/README.MD +++ b/README.MD @@ -13,17 +13,6 @@ allstep ### package are available without compilation -#### vaultwarden - -```bash -wget -qO - https://deb.lgy.fr/install.sh | bash -apt install vaultwarden vaultwarden-web - -#Edit /etc/default/vaultwarden - -systemctl enable --now vaultwarden -``` - #### joplin server ```bash @@ -36,4 +25,27 @@ apt-get install -y joplin-server #Edit /etc/default/joplin-server systemctl enable --now joplin-server -``` \ No newline at end of file +``` + +#### vaultwarden + +```bash +wget -qO - https://deb.lgy.fr/install.sh | bash +apt install vaultwarden vaultwarden-web + +#Edit /etc/default/vaultwarden + +systemctl enable --now vaultwarden +``` + +#### zigbee2mqtt + +```bash +apt install -y wget ca-certificates +wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get install -y zigbee2mqtt + +#Edit /etc/zigbee2mqtt/configuration.yaml + +systemctl enable --now zigbee2mqtt +``` diff --git a/element-web2deb b/element-web2deb index 7f6fa92..6bd2d9e 100755 --- a/element-web2deb +++ b/element-web2deb @@ -1,7 +1,7 @@ #!/bin/bash APP=element-web -VERSION=1.9.9 +VERSION=1.10.1 GIT_VERSION=v$VERSION DEB_VERSION=$VERSION-2 DEBIAN_VERSION_CODENAME=bullseye diff --git a/gotify b/gotify new file mode 100755 index 0000000..abd9b61 --- /dev/null +++ b/gotify @@ -0,0 +1,10 @@ +#!/bin/bash + +APP=gotify +VERSION=2.1.4 +GIT_VERSION=v$VERSION +DEB_VERSION=$VERSION-1 +DEBIAN_VERSION_CODENAME=bullseye + +source ./lib/function.sh + diff --git a/joplin-server2deb b/joplin-server2deb index 3f3d705..6932790 100755 --- a/joplin-server2deb +++ b/joplin-server2deb @@ -1,9 +1,9 @@ #!/bin/bash APP=joplin-server -VERSION=2.7.3 +VERSION=2.7.4 GIT_VERSION=server-v$VERSION -DEB_VERSION=$VERSION-1 +DEB_VERSION=$VERSION-2 DEBIAN_VERSION_CODENAME=bullseye source ./lib/function.sh diff --git a/lib/function.sh b/lib/function.sh index 45872b2..e461161 100644 --- a/lib/function.sh +++ b/lib/function.sh @@ -63,7 +63,7 @@ step4(){ step5(){ rm -fr dist/${APP} mkdir dist/${APP} - cp -fr ressources/${APP}/rootfs/* dist/$APP/ + cp -pfr ressources/${APP}/rootfs/* dist/$APP/ bash ressources/${APP}/makedeb ${CACHE_STEP4} dist/${APP} ${GIT_VERSION} sed -i "s/%VERSION%/$DEB_VERSION/" dist/${APP}/DEBIAN/control fakeroot dpkg-deb -Z gzip --build dist/${APP} dist @@ -78,23 +78,36 @@ allstep(){ step5 } -StartFromStep1(){ +DeleteStep1(){ rm -fr ${CACHE_STEP1} ${CACHE_STEP2} ${CACHE_STEP3} ${CACHE_STEP4} +} +DeleteStep2(){ + rm -fr ${CACHE_STEP2} ${CACHE_STEP3} ${CACHE_STEP4} +} +DeleteStep3(){ + rm -fr ${CACHE_STEP3} ${CACHE_STEP4} +} +DeleteStep4(){ + rm -fr ${CACHE_STEP4} +} + +StartFromStep1(){ + DeleteStep1 allstep } StartFromStep2(){ - rm -fr ${CACHE_STEP2} ${CACHE_STEP3} ${CACHE_STEP4} + DeleteStep2 allstep } StartFromStep3(){ - rm -fr ${CACHE_STEP3} ${CACHE_STEP4} + DeleteStep3 allstep } StartFromStep4(){ - rm -fr ${CACHE_STEP4} + DeleteStep4 allstep } @@ -111,5 +124,15 @@ GotoStep3(){ } GotoStep4(){ + mount -t proc proc ${CACHE_STEP4}/proc/ chroot ${CACHE_STEP4} + umount ${CACHE_STEP4}/proc/ } + +Clean(){ + rm -fr cache/* +} + +CleanAll(){ + rm -fr cache/* +} diff --git a/ressources/gotify/build b/ressources/gotify/build new file mode 100755 index 0000000..0332f67 --- /dev/null +++ b/ressources/gotify/build @@ -0,0 +1,4 @@ +#!/bin/bash +cd /tmp/server/ +. /root/.bashrc +PATH=$PATH:/usr/local/go/bin make diff --git a/ressources/gotify/envinit b/ressources/gotify/envinit new file mode 100755 index 0000000..a661b77 --- /dev/null +++ b/ressources/gotify/envinit @@ -0,0 +1,8 @@ +#/bin/bash +apt install -y build-essential git wget ca-certificates +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.6.linux-amd64.tar.gz | tar -C /usr/local -xz diff --git a/ressources/gotify/makedeb b/ressources/gotify/makedeb new file mode 100644 index 0000000..a69b1d3 --- /dev/null +++ b/ressources/gotify/makedeb @@ -0,0 +1,8 @@ +#!/bin/bash +PATH_BUILD=$1 +PATH_DEB=$2 +GIT_VERSION=$3 + +cp ${PATH_BUILD}/tmp/gotify/dist/gotify ${PATH_DEB}/usr/bin/gotify +cp ${PATH_BUILD}/tmp/authelia/config.template.yml ${PATH_DEB}/etc/authelia/configuration.yml + diff --git a/ressources/gotify/prebuild b/ressources/gotify/prebuild new file mode 100755 index 0000000..397f4f8 --- /dev/null +++ b/ressources/gotify/prebuild @@ -0,0 +1,6 @@ +#!/bin/bash +VERSION=$1 +cd /tmp/ +git clone https://github.com/gotify/server.git +cd server/ +git checkout $VERSION diff --git a/ressources/gotify/rootfs/DEBIAN/changelog b/ressources/gotify/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/gotify/rootfs/DEBIAN/conffiles b/ressources/gotify/rootfs/DEBIAN/conffiles new file mode 100644 index 0000000..2bde2fd --- /dev/null +++ b/ressources/gotify/rootfs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/authelia/configuration.yml diff --git a/ressources/gotify/rootfs/DEBIAN/control b/ressources/gotify/rootfs/DEBIAN/control new file mode 100644 index 0000000..c0e0f13 --- /dev/null +++ b/ressources/gotify/rootfs/DEBIAN/control @@ -0,0 +1,7 @@ +Package: gotify +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Maintainer: Thomas Legay +Description: gotify diff --git a/ressources/gotify/rootfs/DEBIAN/postinst b/ressources/gotify/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..7783fc1 --- /dev/null +++ b/ressources/gotify/rootfs/DEBIAN/postinst @@ -0,0 +1,4 @@ +#!/bin/bash + +id authelia &> /dev/null || useradd authelia -r -s /bin/false + diff --git a/ressources/gotify/rootfs/etc/systemd/system/gotify.service b/ressources/gotify/rootfs/etc/systemd/system/gotify.service new file mode 100644 index 0000000..2b2f4e6 --- /dev/null +++ b/ressources/gotify/rootfs/etc/systemd/system/gotify.service @@ -0,0 +1,13 @@ +[Unit] +Description=gotify service +Documentation=https://github.com/gotify/server +After=network.target + +[Service] +User=gotify +Group=gotify +ExecStart=/usr/bin/gotify-linux-amd64 +WorkingDirectory=/usr/lib/gotify + +[Install] +WantedBy=multi-user.target diff --git a/ressources/joplin-server/rootfs/DEBIAN/postinst b/ressources/joplin-server/rootfs/DEBIAN/postinst index 80ee09d..dabaf66 100755 --- a/ressources/joplin-server/rootfs/DEBIAN/postinst +++ b/ressources/joplin-server/rootfs/DEBIAN/postinst @@ -2,7 +2,7 @@ id joplin-server &> /dev/null || useradd joplin-server -r -s /bin/false -md /var/lib/joplin-server ## issue https://github.com/laurent22/joplin/issues/5980 -mkdir /usr/lib/joplin-server/server/temp/ -mkdir /usr/lib/joplin-server/server/logs/ +[ ! -e /usr/lib/joplin-server/server/temp/ ] && mkdir /usr/lib/joplin-server/server/temp/ +[ ! -e /usr/lib/joplin-server/server/logs/ ] && mkdir /usr/lib/joplin-server/server/logs/ chown joplin-server:joplin-server /usr/lib/joplin-server/server/temp/ chown joplin-server:joplin-server /usr/lib/joplin-server/server/logs/ diff --git a/ressources/zigbee2mqtt/build b/ressources/zigbee2mqtt/build new file mode 100755 index 0000000..950a1be --- /dev/null +++ b/ressources/zigbee2mqtt/build @@ -0,0 +1,4 @@ +#!/bin/bash +cd /tmp/zigbee2mqtt/ +npm ci +npm run build diff --git a/ressources/zigbee2mqtt/envinit b/ressources/zigbee2mqtt/envinit new file mode 100755 index 0000000..4a9e8d7 --- /dev/null +++ b/ressources/zigbee2mqtt/envinit @@ -0,0 +1,3 @@ +#/bin/bash +apt install -y wget ca-certificates nodejs npm git make g++ gcc + diff --git a/ressources/zigbee2mqtt/makedeb b/ressources/zigbee2mqtt/makedeb new file mode 100644 index 0000000..e7dd874 --- /dev/null +++ b/ressources/zigbee2mqtt/makedeb @@ -0,0 +1,8 @@ +#!/bin/bash +PATH_BUILD=$1 +PATH_DEB=$2 +GIT_VERSION=$3 + +cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/data/configuration.yaml ${PATH_DEB}/etc/zigbee2mqtt/configuration.yaml +cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/* ${PATH_DEB}/usr/lib/zigbee2mqtt/ + diff --git a/ressources/zigbee2mqtt/prebuild b/ressources/zigbee2mqtt/prebuild new file mode 100755 index 0000000..dde8021 --- /dev/null +++ b/ressources/zigbee2mqtt/prebuild @@ -0,0 +1,6 @@ +#!/bin/bash +VERSION=$1 +cd /tmp/ +git clone https://github.com/Koenkk/zigbee2mqtt.git +cd zigbee2mqtt/ +git checkout $VERSION diff --git a/ressources/zigbee2mqtt/rootfs/DEBIAN/changelog b/ressources/zigbee2mqtt/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/zigbee2mqtt/rootfs/DEBIAN/conffiles b/ressources/zigbee2mqtt/rootfs/DEBIAN/conffiles new file mode 100644 index 0000000..981e5f3 --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/zigbee2mqtt/configuration.yaml diff --git a/ressources/zigbee2mqtt/rootfs/DEBIAN/control b/ressources/zigbee2mqtt/rootfs/DEBIAN/control new file mode 100644 index 0000000..3d68e93 --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/DEBIAN/control @@ -0,0 +1,8 @@ +Package: zigbee2mqtt +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Depends: nodejs, npm +Maintainer: Thomas Legay +Description: zigbee2mqtt diff --git a/ressources/zigbee2mqtt/rootfs/DEBIAN/postinst b/ressources/zigbee2mqtt/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..1dc58be --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/DEBIAN/postinst @@ -0,0 +1,4 @@ +#!/bin/bash + +id zigbee2mqtt &> /dev/null || useradd zigbee2mqtt -r -s /bin/false -md /var/lib/zigbee2mqtt +chown zigbee2mqtt:zigbee2mqtt /var/lib/zigbee2mqtt/ diff --git a/ressources/zigbee2mqtt/rootfs/etc/default/zigbee2mqtt b/ressources/zigbee2mqtt/rootfs/etc/default/zigbee2mqtt new file mode 100644 index 0000000..d488b74 --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/etc/default/zigbee2mqtt @@ -0,0 +1,2 @@ +ZIGBEE2MQTT_CONFIG=/etc/zigbee2mqtt/configuration.yaml +ZIGBEE2MQTT_DATA=/var/lib/zigbee2mqtt diff --git a/ressources/zigbee2mqtt/rootfs/etc/systemd/system/zigbee2mqtt.service b/ressources/zigbee2mqtt/rootfs/etc/systemd/system/zigbee2mqtt.service new file mode 100644 index 0000000..9260be1 --- /dev/null +++ b/ressources/zigbee2mqtt/rootfs/etc/systemd/system/zigbee2mqtt.service @@ -0,0 +1,16 @@ +[Unit] +Description=zigbee2mqtt +After=network.target + +[Service] +EnvironmentFile=/etc/default/zigbee2mqtt +ExecStart=/usr/bin/npm start +WorkingDirectory=/usr/lib/zigbee2mqtt +StandardOutput=inherit +StandardError=inherit +Restart=always +User=zigbee2mqtt +Group=zigbee2mqtt + +[Install] +WantedBy=multi-user.target diff --git a/vaultwarden2deb b/vaultwarden2deb index beeef82..2510225 100755 --- a/vaultwarden2deb +++ b/vaultwarden2deb @@ -1,9 +1,9 @@ #!/bin/bash APP=vaultwarden -VERSION=1.23.1 +VERSION=1.24.0 GIT_VERSION=$VERSION -DEB_VERSION=$VERSION-3 +DEB_VERSION=$VERSION-1 DEBIAN_VERSION_CODENAME=bullseye source ./lib/function.sh diff --git a/zigbee2mqtt2deb b/zigbee2mqtt2deb new file mode 100755 index 0000000..f639839 --- /dev/null +++ b/zigbee2mqtt2deb @@ -0,0 +1,9 @@ +#!/bin/bash + +APP=zigbee2mqtt +VERSION=1.23.0 +GIT_VERSION=$VERSION +DEB_VERSION=$VERSION-3 +DEBIAN_VERSION_CODENAME=bullseye + +source ./lib/function.sh