expose python environment throug sub-attribute, for accessing python interpreter to run admin scripts

This commit is contained in:
Trolli Schmittlauch 2021-01-24 23:13:23 +01:00
parent 9dde0d319f
commit 8b73ec0585
3 changed files with 19 additions and 13 deletions

View file

@ -237,17 +237,8 @@ in
''}")
("${pkgs.writeShellScript "seafile-server-preStart-unprivileged" ''
# stuff run as seafile user
set -x
# ccnet-init must only be run once per installation, as it also generates stateful key and ID
# solution: invoke it once, use result as template
if [ ! -e ./ccnet/mykey.peer ]; then
#$ {pkgs.seafile-server.ccnet-server}/bin/ccnet-init -c ./ccnet -H 'TEMPLATEHOST'
mv ./ccnet/ccnet.conf{,.template}
fi
# generate actual ccnet config file
echo "[General]" > ./conf/ccnet.conf
grep "^ID =" ./ccnet/ccnet.conf.template >> ./conf/ccnet.conf
# outside URL
SERVICE_URL="http${if cfg.enableTLS then "s" else ""}://${cfg.domainName}:${toString cfg.externalPort}"
@ -264,8 +255,9 @@ in
}
pwd
ln -sf ${pkgs.seafile-server} seafile-server
./seafile-server/setup-seafile-mysql.sh \
${pkgs.seafile-server.pythonEnv}/bin/python seafile-server/setup-seafile-mysql.py auto \
-n "${cfg.name}" \
-i "${cfg.domainName}" \
-p "${toString cfg.fileserverPort}" \