add uptime-kuma

This commit is contained in:
Thomas Legay 2023-09-15 23:10:23 +02:00
parent c42003ad1b
commit 8c08708c5b
11 changed files with 83 additions and 11 deletions

View File

@ -31,13 +31,14 @@ configure_depot_yarn() {
configure_depot_nodejs() { configure_depot_nodejs() {
NODE_MAJOR=16 NODE_MAJOR=16
[ ! "$1" == "" ] && NODE_MAJOR=$1 [ ! "$1" == "" ] && NODE_MAJOR=$1
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list
wget -qO - https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo -e "Package: nodejs\\nPin: version $NODE_MAJOR.*\\nPin-Priority: 1000" > /etc/apt/preferences.d/nodejs echo -e "Package: nodejs\\nPin: version $NODE_MAJOR.*\\nPin-Priority: 1000" > /etc/apt/preferences.d/nodejs
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list
[ -f /etc/apt/keyrings/nodesource.gpg ] || wget -qO - https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
} }
install_go() { install_go() {
GO_VERSION=1.20.7 GO_VERSION=1.21.1
[ ! "$1" == "" ] && GO_VERSION=$1 [ ! "$1" == "" ] && GO_VERSION=$1
PATH=$PATH:/usr/local/go/bin PATH=$PATH:/usr/local/go/bin
if [ -e /usr/local/go/bin/go ] || [ ! "$(go version)" == "go version go${GO_VERSION} linux/amd64" ] ; if [ -e /usr/local/go/bin/go ] || [ ! "$(go version)" == "go version go${GO_VERSION} linux/amd64" ] ;

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION=0.108.0-b.43 VERSION=0.108.0-b.46
APP=adguardhome APP=adguardhome
DEPOT=https://github.com/AdguardTeam/AdGuardHome.git DEPOT=https://github.com/AdguardTeam/AdGuardHome.git
GIT_VERSION=v${VERSION} GIT_VERSION=v${VERSION}

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION=2023.8.2 VERSION=2023.8.3
APP=bitwarden-desktop APP=bitwarden-desktop
DEPOT=https://github.com/bitwarden/clients.git DEPOT=https://github.com/bitwarden/clients.git
GIT_VERSION=desktop-v${VERSION} GIT_VERSION=desktop-v${VERSION}

View File

@ -1,19 +1,19 @@
#!/bin/bash #!/bin/bash
VERSION=1.20.3-0 VERSION=1.20.4-0
APP=forgejo APP=forgejo
DEPOT=https://codeberg.org/forgejo/forgejo DEPOT=https://codeberg.org/forgejo/forgejo
GIT_VERSION=v${VERSION} GIT_VERSION=v${VERSION}
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bookworm DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=6 IMAGE_SIZE=6
PACKAGE_DEPENDENCY="build-essential nodejs golang" PACKAGE_DEPENDENCY="build-essential nodejs"
main() { main() {
base_package_upgrade base_package_upgrade
configure_depot_nodejs 18 configure_depot_nodejs 18
install_package_dependency install_package_dependency
# install_go install_go
get_git_source get_git_source
build build
makedeb makedeb

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
VERSION=2.12.14 VERSION=2.12.17
APP=joplin-desktop APP=joplin-desktop
GIT_VERSION=v${VERSION} GIT_VERSION=v${VERSION}
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M) DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEPOT=https://github.com/laurent22/joplin.git DEPOT=https://github.com/laurent22/joplin.git
DEBIAN_VERSION_CODENAME=bookworm DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=10 IMAGE_SIZE=10

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION=0.47.0 VERSION=0.47.1
APP=metabase APP=metabase
DEPOT=https://github.com/metabase/metabase.git DEPOT=https://github.com/metabase/metabase.git
GIT_VERSION=v$VERSION GIT_VERSION=v$VERSION

View File

View File

@ -0,0 +1,8 @@
Package: uptime-kuma
Version: %VERSION%
Section: contrib
Priority: optional
Architecture: all
Depends: nodejs
Maintainer: Thomas Legay <thomas@lgy.fr>
Description: uptime-kuma

View File

@ -0,0 +1,7 @@
#!/bin/bash
APPUSER=uptime-kuma
id $APPUSER &> /dev/null || useradd $APPUSER -r -s /bin/false -d /var/lib/$APPUSER/
chown -R $APPUSER:$APPUSER /var/lib/$APPUSER/

43
ressources/uptime-kuma/debmaker Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
VERSION=1.23.1
APP=uptime-kuma
GIT_VERSION=${VERSION}
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
DEPOT=https://github.com/louislam/uptime-kuma.git
DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=10
PACKAGE_DEPENDENCY="nodejs yarn build-essential"
main(){
base_package_upgrade
configure_depot_yarn
configure_depot_nodejs
install_package_dependency
get_git_source
build
makedeb
}
build() {
cd /tmp/${APP}
yarn
yarn build
}
makedeb(){
PATH_DEB=/tmp/src/rootfs/
cp -fr /tmp/src/DEBIAN $PATH_DEB
mkdir -p $PATH_DEB/usr/share/uptime-kuma/
mkdir -p $PATH_DEB/var/lib/uptime-kuma/data
cp -fr /tmp/${APP}/{db,dist,node_modules,package.json,server,src} $PATH_DEB/usr/share/uptime-kuma/
ln -s /var/lib/uptime-kuma/ $PATH_DEB/usr/share/uptime-kuma/data
mkdir -p ${PATH_DEB}/usr/lib/systemd/system/
cp -p /tmp/src/uptime-kuma.service ${PATH_DEB}/usr/lib/systemd/system/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}

View File

@ -0,0 +1,13 @@
[Unit]
Description=linkding
After=network.target
[Service]
ExecStart=/usr/bin/nodejs /var/lib/uptime-kuma/server/server.js
WorkingDirectory=/var/lib/uptime-kuma
Restart=always
User=uptime-kuma
Group=uptime-kuma
[Install]
WantedBy=multi-user.target