WIP: ilot/codeberg-pages-server: new aport #4
4 changed files with 107 additions and 10 deletions
|
@ -17,18 +17,15 @@ for apk in $apkgs; do
|
||||||
if [ "$(curl -s $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/pulls/$GITHUB_EVENT_NUMBER | jq .draft)" == "true" ]; then
|
if [ "$(curl -s $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/pulls/$GITHUB_EVENT_NUMBER | jq .draft)" == "true" ]; then
|
||||||
# if draft, send to -testing branch
|
# if draft, send to -testing branch
|
||||||
branch="$branch-testing"
|
branch="$branch-testing"
|
||||||
else
|
|
||||||
# if not draft, assume that this was sent to $branch-testing and nuke it
|
|
||||||
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch-testing/$arch/$name
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# always clear out package before deploying
|
||||||
|
for delarch in x86_64 aarch64 armv7 armhf s390x ppc64le riscv64 loongarch64 x86; do
|
||||||
|
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch/$delarch/$name 2>&1 > /dev/null
|
||||||
|
done
|
||||||
|
|
||||||
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch"
|
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch"
|
||||||
return=$(curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch 2>&1)
|
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch
|
||||||
echo $return
|
|
||||||
if [ "$return" == "package file already exists" ]; then
|
|
||||||
echo "Package already exists, refreshing..."
|
|
||||||
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch/$arch/$name
|
|
||||||
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
44
ilot/codeberg-pages-server/APKBUILD
Normal file
44
ilot/codeberg-pages-server/APKBUILD
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||||
|
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||||
|
pkgname=codeberg-pages-server
|
||||||
|
pkgver=5.1
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="The Codeberg Pages Server – with custom domain support, per-repo pages using the "pages" branch, caching and more."
|
||||||
|
url="https://codeberg.org/Codeberg/pages-server"
|
||||||
|
arch="all"
|
||||||
|
license="EUPL-1.2"
|
||||||
|
depends="nginx"
|
||||||
|
makedepends="go just"
|
||||||
|
# tests disabled for now
|
||||||
|
options="!check"
|
||||||
|
source="
|
||||||
|
$pkgname-$pkgver.tar.gz::https://codeberg.org/Codeberg/pages-server/archive/v$pkgver.tar.gz
|
||||||
|
codeberg-pages-server.openrc
|
||||||
|
upgrade-go-sqlite3-to-1.14.19.patch
|
||||||
|
"
|
||||||
|
builddir="$srcdir/"pages-server
|
||||||
|
subpackages="$pkgname-openrc"
|
||||||
|
pkgusers="git"
|
||||||
|
pkggroups="www-data"
|
||||||
|
|
||||||
|
export GOPATH=$srcdir/go
|
||||||
|
export GOCACHE=$srcdir/go-build
|
||||||
|
export GOTMPDIR=$srcdir
|
||||||
|
|
||||||
|
build() {
|
||||||
|
just build
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
msg "Packaging $pkgname"
|
||||||
|
install -Dm755 "$builddir"/build/codeberg-pages-server "$pkgdir"/usr/bin/codeberg-pages-server
|
||||||
|
|
||||||
|
install -Dm755 "$srcdir"/$pkgname.openrc \
|
||||||
|
"$pkgdir"/etc/init.d/$pkgname
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
55a1dd5ed0f1cb2aaad1066eca8bfbd1d537169ed3712c748163ebff64edc45d05ac1f6f062433e232e2638a790232438282f96dd7410eb4cbaff7208f5f2427 codeberg-pages-server-5.1.tar.gz
|
||||||
|
4defb4fe3a4230f4aa517fbecd5e5b8bcef2a64e1b40615660ae9eec33597310a09df5e126f4d39ce7764bd1716c0a7040637699135c103cbc1879593c6c06f1 codeberg-pages-server.openrc
|
||||||
|
895f1c8d22fcf1d5491a6fe0ce5d93201f83b6dd5fc81b24016b609988fb6c66fdde75bb3830f385a5c83d96366ca3a5f4f9524f52058b6c5dfd8b80d14bac5b upgrade-go-sqlite3-to-1.14.19.patch
|
||||||
|
"
|
30
ilot/codeberg-pages-server/codeberg-pages-server.openrc
Normal file
30
ilot/codeberg-pages-server/codeberg-pages-server.openrc
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
name="$RC_SVCNAME"
|
||||||
|
cfgfile="/etc/conf.d/$RC_SVCNAME.conf"
|
||||||
|
pidfile="/run/$RC_SVCNAME.pid"
|
||||||
|
working_directory="/usr/share/webapps/authentik"
|
||||||
|
command="/usr/share/webapps/authentik/server"
|
||||||
|
command_user="authentik"
|
||||||
|
command_group="authentik"
|
||||||
|
start_stop_daemon_args=""
|
||||||
|
command_background="yes"
|
||||||
|
output_log="/var/log/authentik/$RC_SVCNAME.log"
|
||||||
|
error_log="/var/log/authentik/$RC_SVCNAME.err"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need redis
|
||||||
|
need postgresql
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
cd "$working_directory"
|
||||||
|
checkpath --directory --owner $command_user:$command_group --mode 0775 \
|
||||||
|
/var/log/authentik \
|
||||||
|
/var/lib/authentik/certs
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_pre() {
|
||||||
|
ebegin "Killing child processes"
|
||||||
|
kill $(ps -o pid= --ppid $(cat $pidfile)) || true
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
diff --git a/go.mod.orig b/go.mod
|
||||||
|
index eba292e..00310e5 100644
|
||||||
|
--- a/go.mod.orig
|
||||||
|
+++ b/go.mod
|
||||||
|
@@ -11,7 +11,7 @@ require (
|
||||||
|
github.com/go-sql-driver/mysql v1.6.0
|
||||||
|
github.com/joho/godotenv v1.4.0
|
||||||
|
github.com/lib/pq v1.10.7
|
||||||
|
- github.com/mattn/go-sqlite3 v1.14.16
|
||||||
|
+ github.com/mattn/go-sqlite3 v1.14.19
|
||||||
|
github.com/microcosm-cc/bluemonday v1.0.26
|
||||||
|
github.com/reugn/equalizer v0.0.0-20210216135016-a959c509d7ad
|
||||||
|
github.com/rs/zerolog v1.27.0
|
||||||
|
diff --git a/go.sum.orig b/go.sum
|
||||||
|
index 7ea8b78..19145ea 100644
|
||||||
|
--- a/go.sum.orig
|
||||||
|
+++ b/go.sum
|
||||||
|
@@ -479,6 +479,8 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||||
|
+github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI=
|
||||||
|
+github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||||
|
github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
|
||||||
|
github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0=
|
||||||
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
Loading…
Add table
Reference in a new issue