You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

set -eu
mkdir -p /app/data/storage /run/nginx /run/registry/ui
if [[ ! -f /app/data/config.yml ]]; then
cp /app/code/config-example.yml /app/data/config.yml
yq eval -i ".redis.addr=\"${CLOUDRON_REDIS_HOST}:${CLOUDRON_REDIS_PORT}\"" /app/data/config.yml
yq eval -i ".redis.password=\"${CLOUDRON_REDIS_PASSWORD}\"" /app/data/config.yml
echo "=> Fixing UI config"
sed -e "s,\${URL},${CLOUDRON_APP_ORIGIN}/v2ui," \
-e "s,\${REGISTRY_TITLE},Cloudron Registry," \
-e "s,\${SINGLE_REGISTRY},true," \
/app/code/ui/dist/index.html.original > /run/registry/ui/index.html
if [[ -n "${CLOUDRON_PROXY_AUTH:-}" ]]; then
cp nginx.conf.template /run/nginx/nginx.conf
sed -e 's,root .*,root /app/code/frontend-customauth;,g' nginx.conf.template > /run/nginx/nginx.conf
echo "=> Ensure permissions"
chown -R cloudron:cloudron /app/data
echo "=> Starting supervisor"
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i docker-registry