mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-06 05:47:13 +02:00
community/gitea: various fixes/changes
modernize abuild change permission var/lib/gitea set APP_DATA_PATH and make this default for data files set GITEA_WORK_DIR as environment variable switch to openrc supervise-daemon
This commit is contained in:
parent
599e8381df
commit
058c66db9c
@ -2,7 +2,7 @@
|
|||||||
# Maintainer: 7heo <7heo@mail.com>
|
# Maintainer: 7heo <7heo@mail.com>
|
||||||
pkgname=gitea
|
pkgname=gitea
|
||||||
pkgver=1.1.2
|
pkgver=1.1.2
|
||||||
pkgrel=0
|
pkgrel=1
|
||||||
pkgdesc="A self-hosted Git service written in Go"
|
pkgdesc="A self-hosted Git service written in Go"
|
||||||
url="http://gitea.io/"
|
url="http://gitea.io/"
|
||||||
arch="all !s390x"
|
arch="all !s390x"
|
||||||
@ -21,7 +21,7 @@ builddir="$srcdir/src/code.gitea.io/$pkgname"
|
|||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
mkdir -p ${builddir%/*}
|
mkdir -p ${builddir%/*}
|
||||||
mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1
|
mv "$srcdir"/$pkgname-$pkgver "$builddir"/
|
||||||
cd "$builddir"
|
cd "$builddir"
|
||||||
default_prepare
|
default_prepare
|
||||||
}
|
}
|
||||||
@ -38,45 +38,36 @@ build() {
|
|||||||
package() {
|
package() {
|
||||||
cd "$builddir"
|
cd "$builddir"
|
||||||
|
|
||||||
install -d -m 0755 \
|
for dir in $pkgname $pkgname/git $pkgname/data $pkgname/db $pkgname/custom; do
|
||||||
"$pkgdir"/usr/share/webapps/$pkgname || return 1
|
install -d -m 750 -o gitea -g www-data \
|
||||||
|
"$pkgdir"/var/lib/$dir
|
||||||
|
done
|
||||||
|
|
||||||
# TODO: Is it really necessary to be world-readable?!
|
install -d -m 755 -o gitea -g www-data "$pkgdir"/var/log/$pkgname
|
||||||
install -d -m 0755 -o gitea -g www-data \
|
|
||||||
"$pkgdir"/var/lib/$pkgname \
|
|
||||||
"$pkgdir"/var/lib/$pkgname/conf \
|
|
||||||
"$pkgdir"/var/lib/$pkgname/git \
|
|
||||||
"$pkgdir"/var/lib/$pkgname/db \
|
|
||||||
"$pkgdir"/var/lib/$pkgname/avatars \
|
|
||||||
"$pkgdir"/var/lib/$pkgname/attachements \
|
|
||||||
"$pkgdir"/var/cache/$pkgname/sessions \
|
|
||||||
"$pkgdir"/var/log/$pkgname \
|
|
||||||
"$pkgdir"/etc/$pkgname/conf || return 1
|
|
||||||
|
|
||||||
install -D -m 0755 $pkgname \
|
install -D -m 755 $pkgname "$pkgdir"/usr/bin/$pkgname
|
||||||
"$pkgdir"/usr/bin/$pkgname || return 1
|
|
||||||
# Allow to bind to port 80.
|
# Allow non root to bind to port 80.
|
||||||
setcap cap_net_bind_service=+ep \
|
setcap cap_net_bind_service=+ep \
|
||||||
"$pkgdir"/usr/bin/$pkgname || return 1
|
"$pkgdir"/usr/bin/$pkgname
|
||||||
|
|
||||||
install -D -m 0664 -o gitea -g www-data "$srcdir"/${pkgname}.ini \
|
install -D -m 644 -o gitea -g www-data "$srcdir"/${pkgname}.ini \
|
||||||
"$pkgdir"/etc/$pkgname/conf/app.ini || return 1
|
"$pkgdir"/etc/$pkgname/app.ini
|
||||||
|
chown gitea:www-data "$pkgdir"/etc/$pkgname
|
||||||
|
|
||||||
mv options/* "$pkgdir"/var/lib/$pkgname/conf || return 1
|
install -d -m 755 "$pkgdir"/usr/share/webapps/$pkgname
|
||||||
chown gitea:www-data -R "$pkgdir"/var/lib/$pkgname/conf || return 1
|
mv options public templates "$pkgdir"/usr/share/webapps/$pkgname/
|
||||||
|
|
||||||
mv public templates "$pkgdir"/usr/share/webapps/$pkgname/ || return 1
|
install -D -m 755 "$srcdir"/$pkgname.initd \
|
||||||
|
"$pkgdir"/etc/init.d/$pkgname
|
||||||
install -D -m755 "$srcdir"/$pkgname.initd \
|
|
||||||
"$pkgdir"/etc/init.d/$pkgname || return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
# basic check to see if the app works
|
# basic check to see if the app works
|
||||||
"$builddir"/$pkgname help > /dev/null || return 1
|
"$builddir"/$pkgname help > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
sha512sums="ecad2e11cc01fd9c2b05b672e334c013d65824a111be25cbd3956196688c0d52e31875263e16fdae497e651d771539de7c9244cb01fbc522ef77a763315ecaca gitea-1.1.2.tar.gz
|
sha512sums="ecad2e11cc01fd9c2b05b672e334c013d65824a111be25cbd3956196688c0d52e31875263e16fdae497e651d771539de7c9244cb01fbc522ef77a763315ecaca gitea-1.1.2.tar.gz
|
||||||
42d9cc1739ec9b8596b44c8f020685c1e7f5d1099dfabe8d39dce56535fad3c6addb5843e955a581e3f1934421b79fa3c1b81796d7a8275c89db7fbf2b39a1df gitea.initd
|
a7c70a144dc0582d6230e59ff717023fddcac001a6a9c895b46a0df1fbd9639453b2f5027d47dad21f442869c145dbc801eda61b6c50a2dd8103f562b8569009 gitea.initd
|
||||||
07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini
|
27a202006d6e8d4146659f6356eaa99437f9f596dd369e9430d64b859bc6a1ad16091eef09232aa385fe1bf8ca94bbdf31b94975068220ad10338cded384f726 gitea.ini
|
||||||
e38a701faed6749cbb897536d9ec7e723dc258c01b43daea7e19f3bd56dda4d69cd3be2b0813c24bef902f0b82c734120e36276b4e72899d2d2b3be54dc4574e allow-to-set-version.patch"
|
e38a701faed6749cbb897536d9ec7e723dc258c01b43daea7e19f3bd56dda4d69cd3be2b0813c24bef902f0b82c734120e36276b4e72899d2d2b3be54dc4574e allow-to-set-version.patch"
|
||||||
|
@ -7,6 +7,7 @@ SCRIPT_TYPE = sh
|
|||||||
|
|
||||||
[server]
|
[server]
|
||||||
STATIC_ROOT_PATH = /usr/share/webapps/gitea
|
STATIC_ROOT_PATH = /usr/share/webapps/gitea
|
||||||
|
APP_DATA_PATH = /var/lib/gitea/data
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
DB_TYPE = sqlite3
|
DB_TYPE = sqlite3
|
||||||
@ -14,15 +15,8 @@ PATH = /var/lib/gitea/db/gitea.db
|
|||||||
SSL_MODE = disable
|
SSL_MODE = disable
|
||||||
|
|
||||||
[session]
|
[session]
|
||||||
PROVIDER_CONFIG = /var/cache/gitea/sessions
|
|
||||||
PROVIDER = file
|
PROVIDER = file
|
||||||
|
|
||||||
[picture]
|
|
||||||
AVATAR_UPLOAD_PATH = /var/lib/gitea/avatars
|
|
||||||
|
|
||||||
[attachment]
|
|
||||||
PATH = /var/lib/gitea/attachements
|
|
||||||
|
|
||||||
[log]
|
[log]
|
||||||
ROOT_PATH = /var/log/gitea
|
ROOT_PATH = /var/log/gitea
|
||||||
MODE = file
|
MODE = file
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
supervisor=supervise-daemon
|
||||||
name=gitea
|
name=gitea
|
||||||
command="/usr/bin/gitea"
|
command="/usr/bin/gitea"
|
||||||
command_args="web"
|
command_user="${GITEA_USER:-gitea}"
|
||||||
start_stop_daemon_args="--user ${GITEA_USER:-gitea} --env GITEA_CUSTOM=${GITEA_CUSTOM:-/var/lib/gitea} --chdir ${GITEA_CUSTOM:-/var/lib/gitea}"
|
command_args="web --config '${GITEA_CONF:-/etc/gitea/app.ini}'"
|
||||||
command_background=yes
|
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"
|
pidfile="/run/gitea.pid"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
@ -12,3 +13,4 @@ depend() {
|
|||||||
need net
|
need net
|
||||||
after firewall
|
after firewall
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user