Added gitea

This commit is contained in:
Gwenhael Le Moine 2019-02-06 11:25:24 +01:00
parent f24a592987
commit 371742a6ea
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -17,34 +17,34 @@ PREFIX=/usr
if [ "$(id -g gitea 2> /dev/null)" != "817" -o "$(id -u gitea 2> /dev/null)" != "817" ]; then
echo " You must have an 'gitea' user and group to run this script."
echo " # groupadd -g 817 gitea"
echo " # useradd -d /var/lib/gitea -g gitea -s /bin/bash -u 817 gitea"
echo " # useradd -d /var/lib/gitea -g gitea -s /bin/bash -u 817 gitea --disabled-password --system "
exit 1
fi
echo $ARCH | grep -q arm && SRC_ARCH=arm-7
echo $ARCH | grep -q 86 && SRC_ARCH=386
echo $ARCH | grep -q 64 && SRC_ARCH=amd64
ea-${VERSION}-linux-${SRC_ARCH} ] && rm $CWD/gitea-${VERSION}-linux-${SRC_ARCH}
wget -c https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-${SRC_ARCH}.xz -O $CWD/gitea-${VERSION}-linux-${SRC_ARCH}.xz
xz -d $CWD/gitea-${VERSION}-linux-${SRC_ARCH}.xz
[ -e $CWD/app.ini.sample ] && rm $CWD/app.ini.sample
wget -c https://raw.githubusercontent.com/go-gitea/gitea/master/custom/conf/app.ini.sample -O $CWD/app.ini.sample
mkdir -p $PKG$PREFIX/bin/custom/conf/
rm -fr $PKG
mkdir -p $PKG$PREFIX/bin
mv $CWD/gitea-${VERSION}-linux-${SRC_ARCH} $PKG$PREFIX/bin/${PRGNAM}
chmod +x $PKG$PREFIX/bin/${PRGNAM}
mkdir -p $PKG/var/lib/gitea/{custom,data,indexers,public,log}
mkdir -p $PKG/etc/gitea/
mv $CWD/app.ini.sample $PKG/etc/gitea/
sed -i "s|^APP_ID|;APP_ID|g" $PKG/etc/gitea/app.ini
sed -i "s|^TRUSTED_FACETS|;TRUSTED_FACETS|g" $PKG/etc/gitea/app.ini
chown -R gitea:gitea $PKG/etc/gitea
chmod 770 $PKG/etc/gitea
mkdir -p $PKG/var/lib/gitea/{custom,data,indexers,public,log,.ssh}
chown -R gitea:gitea $PKG/var/lib/gitea/{data,indexers,log}
chmod 750 $PKG/var/lib/gitea/{data,indexers,log}
mkdir -p $PKG/etc/
# chown -R root:gitea $PKG/etc/gitea
# chmod 770 $PKG/etc/gitea
(cd $PKG/etc/
ln -s ../$PREFIX/bin/custom/conf/ gitea
)
mv $CWD/app.ini.sample $PKG$PREFIX/bin/custom/conf/
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@ -66,7 +66,7 @@ CMD="/usr/bin/gitea"
PROCESSNAME=\$CMD
# Option to run with deamon
OPTIONS=""
OPTIONS=" --config /etc/gitea/app.ini"
func_stop() {
if [ "\$(ps aux | grep \$PROCESSNAME | grep -v grep)" ]; then