mirror of
git://f0xx.org/ac/ac-deploy
synced 2026-07-29 07:37:47 +03:00
cluster0: lab verify-email short links via prod s.f0xx.org API
Lab MariaDB slugs are not on public s.f0xx.org; outbound mail calls prod shorten API (internal artc0 + Host header) with API bearer token in secrets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -138,6 +138,13 @@ unset _MSMTP_PASS _mail_from_secret
|
||||
MAIL_FROM_PHP="$(printf '%s' "$MAIL_FROM" | sed "s/'/\\\\'/g")"
|
||||
AUTH_BEARER_ID="$(read_secret URL_SHORTENER_AUTH_BEARER_ID 2>/dev/null || true)"
|
||||
[ -n "$AUTH_BEARER_ID" ] || AUTH_BEARER_ID="${URL_SHORTENER_AUTH_BEARER_ID:-0}"
|
||||
API_BEARER_TOKEN="$(read_secret URL_SHORTENER_API_BEARER_TOKEN 2>/dev/null || true)"
|
||||
API_BEARER_PHP=""
|
||||
if [ -n "$API_BEARER_TOKEN" ]; then
|
||||
API_BEARER_PHP="$(printf '%s' "$API_BEARER_TOKEN" | sed "s/'/\\\\'/g")"
|
||||
fi
|
||||
URL_SHORTENER_API_BASE_CFG="${URL_SHORTENER_API_BASE:-${SHORT_LINKS_PUBLIC_BASE}}"
|
||||
URL_SHORTENER_API_HOST_CFG="${URL_SHORTENER_API_HOST:-}"
|
||||
mkdir -p "${COMPOSED}/config"
|
||||
log "write composed config.php base_path=${ISSUES_BASE}"
|
||||
cat > "${COMPOSED}/config/config.php" <<PHP
|
||||
@@ -190,6 +197,9 @@ return [
|
||||
'url_shortener' => [
|
||||
'enabled' => true,
|
||||
'public_base' => '${SHORT_LINKS_PUBLIC_BASE}',
|
||||
'api_base' => '${URL_SHORTENER_API_BASE_CFG}',
|
||||
'api_host' => '${URL_SHORTENER_API_HOST_CFG}',
|
||||
'api_bearer_token' => '${API_BEARER_PHP}',
|
||||
'auth_bearer_id' => ${AUTH_BEARER_ID:-0},
|
||||
'db' => [
|
||||
'mysql' => [
|
||||
|
||||
Reference in New Issue
Block a user