Set admin password in custom.cfg

This commit is contained in:
winniehell 2022-08-07 09:27:16 +02:00
parent 558546b79b
commit 4f4df3f223
2 changed files with 5 additions and 6 deletions

View file

@ -25,11 +25,6 @@ if [[ "$1" == "zeo"* ]]; then
exec gosu senaite bin/$1 fg
fi
# Change the password
if [[ -n "${PASSWORD}" ]]; then
gosu senaite bin/zope-passwd -p "${PASSWORD}"
fi
# Instance start
if [[ $START == *"$1"* ]]; then
exec gosu senaite bin/instance console

View file

@ -150,16 +150,19 @@ class Environment(object):
sources = self.env.get("SOURCES", "").strip().split(",")
password = self.env.get("PASSWORD", "").strip()
# If profiles not provided. Install ADDONS :default profiles
if not profiles:
for egg in eggs:
base = egg.split("=")[0]
profiles.append("%s:default" % base)
if not (eggs or zcml or develop or site):
if not (eggs or zcml or develop or site or password):
return
buildout = BUILDOUT_TEMPLATE.format(
password=password or "admin",
findlinks="\n\t".join(findlinks),
eggs="\n\t".join(eggs),
zcml="\n\t".join(zcml),
@ -229,6 +232,7 @@ CORS_TEMPLACE = """<configure
BUILDOUT_TEMPLATE = """
[buildout]
extends = buildout.cfg
user=admin:{password}
find-links += {findlinks}
develop += {develop}
eggs += {eggs}