From 30f6cf88c021001d51e1ee8fad92dbdaf11e2f24 Mon Sep 17 00:00:00 2001 From: sev Date: Mon, 13 Jun 2022 14:49:47 -0500 Subject: [PATCH] testing/uptime-kuma: new aport --- testing/uptime-kuma/APKBUILD | 47 ++++++++++++++++++++ testing/uptime-kuma/uptime-kuma.confd | 36 +++++++++++++++ testing/uptime-kuma/uptime-kuma.initd | 30 +++++++++++++ testing/uptime-kuma/uptime-kuma.post-install | 8 ++++ 4 files changed, 121 insertions(+) create mode 100644 testing/uptime-kuma/APKBUILD create mode 100644 testing/uptime-kuma/uptime-kuma.confd create mode 100644 testing/uptime-kuma/uptime-kuma.initd create mode 100644 testing/uptime-kuma/uptime-kuma.post-install diff --git a/testing/uptime-kuma/APKBUILD b/testing/uptime-kuma/APKBUILD new file mode 100644 index 0000000..3b7acc6 --- /dev/null +++ b/testing/uptime-kuma/APKBUILD @@ -0,0 +1,47 @@ +# Contributor: sev +# Maintainer: sev +pkgname=uptime-kuma +pkgver=1.16.1 +pkgrel=2 +pkgdesc="A fancy self-hosted monitoring tool" +url="https://uptime.kuma.pet" +arch="x86_64" +license="MIT" +depends="nodejs>=14 py3-apprise" +makedepends="npm git" +install="$pkgname.post-install" +subpackages="$pkgname-openrc" +source="https://github.com/louislam/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz + $pkgname.initd + $pkgname.confd" +builddir="$srcdir/$pkgname-$pkgver" + +prepare() { + default_prepare + npm ci +} + +build() { + npm run build +} + +check() { + npm test +} + +package() { + npm prune --omit=dev + sharedir="$pkgdir/usr/share/$pkgname" + mkdir -pm755 "$sharedir"/src + cp -dR server db node_modules dist "$sharedir" + install -Dm755 src/util.js "$sharedir"/src + install -Dm755 extra/remove-2fa.js extra/reset-password.js \ + extra/healthcheck.js "$sharedir"/extra + install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname" + install -Dm755 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname" +} +sha512sums=" +1250cd3bb239ea1ef7fa04742a7372190d8155d28ccb0f2d0a0117e8fa47bcdfb4c365819926d3ff70b26696463eac9806e9d413f516194397131367de88ec80 uptime-kuma-1.16.1.tar.gz +be29addd1a357dbff3e43cf37b873a41c1452a870292c54f52dd7ca236f1208a7130df8330dff7eb64b6e974d7903ea3609733dc154ccc4ea506176691271e1c uptime-kuma.initd +fa3e42204410cd5033e8291d0f88281cf0ad591026675b193f679f47bcd89216eb0cb53bf890c2a3e1e87cd55fb1e06b93bd1f4cdbd13700c6fcb2d65adb17b8 uptime-kuma.confd +" diff --git a/testing/uptime-kuma/uptime-kuma.confd b/testing/uptime-kuma/uptime-kuma.confd new file mode 100644 index 0000000..a0ef631 --- /dev/null +++ b/testing/uptime-kuma/uptime-kuma.confd @@ -0,0 +1,36 @@ +# https://github.com/louislam/uptime-kuma/wiki/Environment-Variables +# Commented variables are set to defaults + +# Set the directory where the data should be stored (could be relative) +#DATA_DIR=./data/ +DATA_DIR=/var/lib/update-kuma/ + +# Host to bind to, could be an ip. +#UPTIME_KUMA_HOST=:: + +# Port to listen to +#UPTIME_KUMA_PORT=3001 + +# Path to SSL key +#UPTIME_KUMA_SSL_KEY= + +# Path to SSL certificate +#UPTIME_KUMA_SSL_CERT= + +# Cloudflare Tunnel Token (Available in 1.14.0) +#UPTIME_KUMA_CLOUDFLARED_TOKEN= + +# By default, Uptime Kuma is not allowed in iframe if the domain name is not +# the same as the parent. It protects your Uptime Kuma to be a phishing +# website. If you don't need this protection, you can set it to true +#UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN=false + +# Add your self-signed ca certs. (e.g. /cert/path/CAcert.pem) +#NODE_EXTRA_CA_CERTS= + +# Ignore all TLS errors +#NODE_TLS_REJECT_UNAUTHORIZED=0 + +# Set it to --insecure-http-parser, if you encountered error "Invalid header +# value char" when your website using WAF +#NODE_OPTIONS= diff --git a/testing/uptime-kuma/uptime-kuma.initd b/testing/uptime-kuma/uptime-kuma.initd new file mode 100644 index 0000000..ad63c7d --- /dev/null +++ b/testing/uptime-kuma/uptime-kuma.initd @@ -0,0 +1,30 @@ +#!/sbin/openrc-run + +name="uptime-kuma" +description="A free and open source uptime monitoring solution" + +: ${DATA_DIR:=/var/lib/$name/} +export DATA_DIR UPTIME_KUMA_HOST UPTIME_KUMA_PORT UPTIME_KUMA_SSL_KEY \ + UPTIME_KUMA_SSL_CERT \ UPTIME_KUMA_CLOUDFLARED_TOKEN \ + UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN NODE_EXTRA_CA_CERTS \ + NODE_TLS_REJECT_UNAUTHORIZED NODE_OPTIONS + +directory="/usr/share/$RC_SVCNAME" +: ${pidfile:="/run/$RC_SVCNAME.pid"} +command="/usr/bin/node" +command_args="server/server.js $command_args" +: ${command_user:="$RC_SVCNAME:$RC_SVCNAME"} +command_background="yes" +output_log="/var/log/$RC_SVCNAME.log" +error_log="$output_log" + +start_pre() { + checkpath --file --owner "$name:$name" -m 755 "$output_log" + checkpath --directory --owner "$name:$name" -m 750 "$DATA_DIR" +} + +depends() { + need net +} + +# vim:sts=4:sw=4:et diff --git a/testing/uptime-kuma/uptime-kuma.post-install b/testing/uptime-kuma/uptime-kuma.post-install new file mode 100644 index 0000000..41388c1 --- /dev/null +++ b/testing/uptime-kuma/uptime-kuma.post-install @@ -0,0 +1,8 @@ +#!/bin/sh + +name="uptime-kuma" + +addgroup -S "$name" 2>/dev/null +adduser -SDHh "/var/lib/$name" -s /sbin/nologin -G $name -g 'Uptime Kuma' $name 2>/dev/null + +exit 0 -- 2.47.0