Commit 208cbc1e authored by Elouan Martinet's avatar Elouan Martinet

[entrypoint.sh] Always regenerate pyramid.ini using environment variables

parent d7d674e32574
......@@ -6,16 +6,14 @@ if test -z "$CW_DB_NAME"; then
export CW_DB_NAME=$CUBE
fi
PINI=$CW_INSTANCES_DIR/$CW_INSTANCE/pyramid.ini
if ! test -e $PINI; then
test -z "$PYRAMID_SESSION_SECRET" && export PYRAMID_SESSION_SECRET=$(pwgen -s 20)
test -z "$PYRAMID_AUTHTKT_SESSION_SECRET" && export PYRAMID_AUTHTKT_SESSION_SECRET=$(pwgen -s 20)
test -z "$PYRAMID_AUTHTKT_PERSISTENT_SECRET" && export PYRAMID_AUTHTKT_PERSISTENT_SECRET=$(pwgen -s 20)
python > $PINI << EOF
test -z "$PYRAMID_SESSION_SECRET" && export PYRAMID_SESSION_SECRET=$(pwgen -s 20)
test -z "$PYRAMID_AUTHTKT_SESSION_SECRET" && export PYRAMID_AUTHTKT_SESSION_SECRET=$(pwgen -s 20)
test -z "$PYRAMID_AUTHTKT_PERSISTENT_SECRET" && export PYRAMID_AUTHTKT_PERSISTENT_SECRET=$(pwgen -s 20)
python > $PINI << EOF
import os
import jinja2
print(jinja2.Template(open('/pyramid.ini.j2').read()).render(os.environ))
EOF
fi
bootstrap() {
echo "bootstrapping instance"
cubicweb-ctl gen-static-datadir $CW_INSTANCE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment