forked from mirrors/nixpkgs
nixos/gitea: fix pre start script
The hooks directory contains now one level deep subdirectories which need to be updated as well. If you use gitea via ssh, ~/.ssh/authorized_keys also needs to be updated because of the hardcoded path to gitea in the "command" option.
This commit is contained in:
parent
51af2c330b
commit
28c20a4731
|
@ -282,7 +282,7 @@ in
|
||||||
|
|
||||||
mkdir -p ${cfg.repositoryRoot}
|
mkdir -p ${cfg.repositoryRoot}
|
||||||
# update all hooks' binary paths
|
# update all hooks' binary paths
|
||||||
HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 4 -type f -wholename "*git/hooks/*")
|
HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 5 -type f -wholename "*git/hooks/*")
|
||||||
if [ "$HOOKS" ]
|
if [ "$HOOKS" ]
|
||||||
then
|
then
|
||||||
sed -ri 's,/nix/store/[a-z0-9.-]+/bin/gitea,${gitea.bin}/bin/gitea,g' $HOOKS
|
sed -ri 's,/nix/store/[a-z0-9.-]+/bin/gitea,${gitea.bin}/bin/gitea,g' $HOOKS
|
||||||
|
@ -295,6 +295,11 @@ in
|
||||||
mkdir -p ${cfg.stateDir}/conf
|
mkdir -p ${cfg.stateDir}/conf
|
||||||
cp -r ${gitea.out}/locale ${cfg.stateDir}/conf/locale
|
cp -r ${gitea.out}/locale ${cfg.stateDir}/conf/locale
|
||||||
fi
|
fi
|
||||||
|
# update command option in authorized_keys
|
||||||
|
if [ -r ${cfg.stateDir}/.ssh/authorized_keys ]
|
||||||
|
then
|
||||||
|
sed -ri 's,/nix/store/[a-z0-9.-]+/bin/gitea,${gitea.bin}/bin/gitea,g' ${cfg.stateDir}/.ssh/authorized_keys
|
||||||
|
fi
|
||||||
'' + optionalString (usePostgresql && cfg.database.createDatabase) ''
|
'' + optionalString (usePostgresql && cfg.database.createDatabase) ''
|
||||||
if ! test -e "${cfg.stateDir}/db-created"; then
|
if ! test -e "${cfg.stateDir}/db-created"; then
|
||||||
echo "CREATE ROLE ${cfg.database.user}
|
echo "CREATE ROLE ${cfg.database.user}
|
||||||
|
|
Loading…
Reference in a new issue