diff options
Diffstat (limited to 'community/gitea')
-rw-r--r-- | community/gitea/APKBUILD | 75 | ||||
-rw-r--r-- | community/gitea/fix-tests-ssh-hostkeys.patch | 32 | ||||
-rw-r--r-- | community/gitea/gitea.initd | 9 | ||||
-rw-r--r-- | community/gitea/gitea.pre-install | 4 |
4 files changed, 43 insertions, 77 deletions
diff --git a/community/gitea/APKBUILD b/community/gitea/APKBUILD index bf53a27d693..39069f4901f 100644 --- a/community/gitea/APKBUILD +++ b/community/gitea/APKBUILD @@ -1,30 +1,34 @@ # Contributor: Carlo Landmeter <clandmeter@alpinelinux.org> # Contributor: 6543 <6543@obermui.de> -# Contributor: techknowlogick <techknowlogick@gitea.io> +# Contributor: techknowlogick <techknowlogick@gitea.com> # Maintainer: 6543 <6543@obermui.de> pkgname=gitea -pkgver=1.16.8 -pkgrel=0 -pkgdesc="A self-hosted Git service written in Go" -url="https://gitea.io" -# armhf: failing tests +pkgver=1.21.9 +pkgrel=1 +pkgdesc="Self-hosted Git service written in Go" +url="https://about.gitea.com/" arch="all" license="MIT" -options="net" depends="git git-lfs gnupg" -makedepends="go libcap" +makedepends="go" checkdepends="bash openssh openssh-keygen sqlite tzdata" install="$pkgname.pre-install" pkgusers="gitea" pkggroups="www-data" subpackages="$pkgname-openrc" -source="$pkgname-$pkgver.tar.gz::https://dl.gitea.io/gitea/$pkgver/gitea-src-$pkgver.tar.gz +source="$pkgname-$pkgver.tar.gz::https://dl.gitea.com/gitea/$pkgver/gitea-src-$pkgver.tar.gz $pkgname.initd $pkgname.ini - fix-tests-ssh-hostkeys.patch " +builddir="$srcdir/gitea-src-$pkgver" +options="!check net" # broken with GIT_CEILING # secfixes: +# 1.21.3-r0: +# - CVE-2023-48795 +# 1.17.3-r0: +# - CVE-2022-42968 +# - CVE-2022-32149 # 1.16.7-r0: # - CVE-2022-30781 # 1.16.3-r0: @@ -47,17 +51,22 @@ source="$pkgname-$pkgver.tar.gz::https://dl.gitea.io/gitea/$pkgver/gitea-src-$pk # - CVE-2021-45331 # - CVE-2021-45329 +export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" +export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" +export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" + # Skip tests for archs that fail unrelated in CI case "$CARCH" in s390x|x86|armhf|armv7) options="$options !check" ;; esac -export GOFLAGS="$GOFLAGS -modcacherw -trimpath" - build() { - export GOPATH="$srcdir" + # XXX: LARGEFILE64 + export CGO_CFLAGS="$CFLAGS -O2 -D_LARGEFILE64_SOURCE" export TAGS="tidb sqlite sqlite_unlock_notify" export GITEA_VERSION="$pkgver" + export EXTRA_GOFLAGS="$GOFLAGS" + export CGO_LDFLAGS="$LDFLAGS" unset LDFLAGS ## make FHS compliant LDFLAGS="$LDFLAGS -X code.gitea.io/gitea/modules/setting.CustomConf=/etc/gitea/app.ini" @@ -65,39 +74,26 @@ build() { LDFLAGS="$LDFLAGS -X code.gitea.io/gitea/modules/setting.StaticRootPath=/usr/share/webapps/gitea/" export LDFLAGS - ## make should run without any parallelism - make EXTRA_GOFLAGS="$GOFLAGS" backend -j1 + make -j1 backend } check() { - local _home="$srcdir"/home - mkdir -p $_home - install -d -m700 $_home/.ssh - touch $_home/.gitconfig + local home="$srcdir"/home + mkdir -p "$home" + install -d -m700 "$home"/.ssh + touch "$home"/.gitconfig + env GITEA_ROOT="$home" HOME="$home" GITEA_WORK_DIR="$(pwd)" timeout -s ABRT 20m make -j1 test-sqlite ## "make test" - modified (exclude broken tests) ## 'code.gitea.io/gitea/modules/migrations': github hase rate limits! 403 API - PACKAGES=$(go list ./... | grep -v /vendor/ | \ + local tests=$(go list ./... | grep -v /vendor/ | \ grep -v 'code.gitea.io/gitea/modules/migrations' | \ grep -v 'code.gitea.io/gitea/modules/charset' | \ grep -v 'code.gitea.io/gitea/models/migrations' | \ grep -v 'code.gitea.io/gitea/services/migrations' | \ grep -v 'code.gitea.io/gitea/integrations') - env HOME=$_home GO111MODULE=on go test -mod=vendor -tags='sqlite sqlite_unlock_notify' $PACKAGES - - env HOME=$_home GITEA_WORK_DIR="$(pwd)" timeout -s ABRT 20m make test-sqlite -} + env GITEA_CONF="$PWD/tests/sqlite.ini" GITEA_ROOT="$home" HOME="$home" GO111MODULE=on go test -mod=vendor -tags='sqlite sqlite_unlock_notify' $tests -unpack() { - verify - initdcheck - - local archdest="$srcdir/$pkgname-$pkgver" - - mkdir -p "$archdest" - - msg "Unpacking $pkgname-$pkgver.tar.gz..." - tar -C "$archdest" -zxf "$pkgname-$pkgver.tar.gz" } package() { @@ -110,24 +106,19 @@ package() { install -D -m 755 $pkgname "$pkgdir"/usr/bin/$pkgname - # Allow non root to bind to port 80. - setcap cap_net_bind_service=+ep \ - "$pkgdir"/usr/bin/$pkgname - install -D -m 644 -o gitea -g www-data "$srcdir"/gitea.ini \ "$pkgdir"/etc/$pkgname/app.ini chown gitea:www-data "$pkgdir"/etc/$pkgname install -d -m 755 "$pkgdir"/usr/share/webapps/$pkgname - mv options public templates "$pkgdir"/usr/share/webapps/$pkgname/ + cp -r options public templates "$pkgdir"/usr/share/webapps/$pkgname/ install -D -m 755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname } sha512sums=" -f502a07c886cc2f15615693a90eda128478d0de833cbe18993ed1f5a1a81f45591b2c00791f8024eda97d948991838b2dc95fab189695179631df47e4d587419 gitea-1.16.8.tar.gz -f859f46204fef596344fda53af7e945baca8639fd2839e90f2b4a8e361a2c77490be18473469cb40cb362671f5b2604e6ea18955dc0e56f44346ffaf2a838a91 gitea.initd +1c62bf899e45e355a5653c95f34005495df31354c53e1e3197443526d92e0c5fcbbcb808277503c2efb358f9c5390ce6f6d4859b3ccc3e9c7d4eecd7caecb6b0 gitea-1.21.9.tar.gz +71c767f9e851d99e6d87032faa833617ded28a292507c492bce63d0b87208819aa9ccbf8301d885da14901a4bdb93b21859883eaea78f980e8c8deb63ae8e57a gitea.initd 431184faffa8996873d92d7b0d16bc4b1a0178d264cd2928d1f49b13ad3e6470d9ede7a18c12112deeeb38f0647ccc0b012e98bcbd96e7b8496a3dc18f5b1fb7 gitea.ini -b16eb5d89a301c796046ebcb726015872f122756a324802f042d4cb8ec17d41ce0fa684e17c26ade265273984e2b621d579e929cb63ed7dbc12774257bd13e9f fix-tests-ssh-hostkeys.patch " diff --git a/community/gitea/fix-tests-ssh-hostkeys.patch b/community/gitea/fix-tests-ssh-hostkeys.patch deleted file mode 100644 index 69f28d1c5d1..00000000000 --- a/community/gitea/fix-tests-ssh-hostkeys.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0ee335c74b16afa30c50f0f0a7cea4946f512334 Mon Sep 17 00:00:00 2001 -From: 6543 <6543@obermui.de> -Date: Sun, 6 Feb 2022 19:57:13 +0100 -Subject: [PATCH] fix tests ssh hostkeys - ---- - integrations/git_helper_for_declarative_test.go | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/integrations/git_helper_for_declarative_test.go b/integrations/git_helper_for_declarative_test.go -index 05a3e8777..6d3c52ec8 100644 ---- a/integrations/git_helper_for_declarative_test.go -+++ b/integrations/git_helper_for_declarative_test.go -@@ -40,13 +40,13 @@ func withKeyFile(t *testing.T, keyname string, callback func(string)) { - assert.NoError(t, err) - - err = os.WriteFile(path.Join(tmpDir, "ssh"), []byte("#!/bin/bash\n"+ -- "ssh -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0700) -+ "ssh -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"HostkeyAlgorithms=+ssh-rsa\" -o \"PubkeyAcceptedAlgorithms=+ssh-rsa\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0o700) - assert.NoError(t, err) - - //Setup ssh wrapper - os.Setenv("GIT_SSH", path.Join(tmpDir, "ssh")) - os.Setenv("GIT_SSH_COMMAND", -- "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i \""+keyFile+"\"") -+ "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -i \""+keyFile+"\"") - os.Setenv("GIT_SSH_VARIANT", "ssh") - - callback(keyFile) --- -2.35.1 - diff --git a/community/gitea/gitea.initd b/community/gitea/gitea.initd index b71b00b3b37..dd5af66be0e 100644 --- a/community/gitea/gitea.initd +++ b/community/gitea/gitea.initd @@ -7,7 +7,8 @@ command_user="${GITEA_USER:-gitea}" command_args="web --config '${GITEA_CONF:-/etc/gitea/app.ini}'" supervise_daemon_args="--env GITEA_WORK_DIR='${GITEA_WORK_DIR:-/var/lib/gitea}' --chdir '${GITEA_WORK_DIR:-/var/lib/gitea}' --stdout '${GITEA_LOG_FILE:-/var/log/gitea/http.log}' --stderr '${GITEA_LOG_FILE:-/var/log/gitea/http.log}'" pidfile="/run/gitea.pid" -#extra_started_commands="reload" +extra_started_commands="reopen_log" +capabilities="^cap_net_bind_service" depend() { use logger dns @@ -21,3 +22,9 @@ depend() { # ${supervisor} ${RC_SVCNAME} --signal HUP --pidfile "${pidfile}" # eend $? #} + +reopen_log() { + ebegin "Reopening logfile for ${RC_SVCNAME}" + ${supervisor} ${RC_SVCNAME} --signal USR1 --pidfile "${pidfile}" + eend $? +} diff --git a/community/gitea/gitea.pre-install b/community/gitea/gitea.pre-install index b239cccc0d3..01958a61737 100644 --- a/community/gitea/gitea.pre-install +++ b/community/gitea/gitea.pre-install @@ -1,7 +1,7 @@ #!/bin/sh addgroup -S -g 82 www-data 2>/dev/null -adduser -S -D -h /var/lib/gitea -s /bin/ash -G www-data -g gitea gitea 2>/dev/null -passwd -u gitea 2>/dev/null +adduser -S -D -h /var/lib/gitea -s /bin/sh -G www-data -g gitea gitea 2>/dev/null \ + && passwd -u gitea 2>/dev/null exit 0 |