PascalSmile8358/openapi
0
1#!/bin/sh2set -eu3 4mkdir -p \5 /app \6 /data \7 /run/nginx \8 /tmp/.cli-proxy-api \9 /tmp/logs \10 /tmp/pg_cache/pgstore \11 /tmp/nginx/client_temp \12 /tmp/nginx/proxy_temp \13 /tmp/nginx/fastcgi_temp \14 /tmp/nginx/uwsgi_temp \15 /tmp/nginx/scgi_temp16 17python3 - <<'PY'18import json19import os20from pathlib import Path21 22host = os.getenv("CPA_BIND_HOST", "127.0.0.1")23port = int(os.getenv("CPA_BIND_PORT", "8317"))24auth_dir = os.getenv("CPA_AUTH_DIR", "/tmp/.cli-proxy-api")25secret = os.getenv("CPA_BOOTSTRAP_MANAGEMENT_KEY", "changeme")26 27content = f"""host: {host}28port: {port}29auth-dir: {json.dumps(auth_dir)}30usage-statistics-enabled: true31 32tls:33 enable: false34 35remote-management:36 allow-remote: false37 secret-key: {json.dumps(secret)}38 disable-control-panel: false39"""40 41Path("/app/config.yaml").write_text(content, encoding="utf-8")42Path("/app/config.example.yaml").write_text(content, encoding="utf-8")43PY44 45exec /usr/bin/supervisord -c /etc/supervisord.conf46 