fix: DDNS URL env var takes priority; switch default to HTTPS
- ddns_manager: DDNS_URL env var overrides stored api_base_url so existing cells pick up the new HTTPS endpoint without re-registering - docker-compose.yml: default DDNS_URL now points to https://ddns.pic.ngo - setup_manager.py: add rstrip('/') before replacing /api/v1 to handle URLs with or without trailing slash Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -344,7 +344,9 @@ class DDNSManager(BaseServiceManager):
|
||||
return None
|
||||
|
||||
if provider_name == 'pic_ngo':
|
||||
api_base = ddns_cfg.get('api_base_url')
|
||||
# Env var takes priority so deployments can switch URLs without re-registering
|
||||
_env_url = os.environ.get('DDNS_URL', '').replace('/api/v1', '').rstrip('/')
|
||||
api_base = _env_url or ddns_cfg.get('api_base_url')
|
||||
totp_secret = ddns_cfg.get('totp_secret') or os.environ.get('DDNS_TOTP_SECRET', '')
|
||||
return PicNgoDDNS(api_base_url=api_base, totp_secret=totp_secret)
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ VALID_DOMAIN_MODES = {'pic_ngo', 'cloudflare', 'duckdns', 'http01', 'lan'}
|
||||
CELL_NAME_RE = re.compile(r'^[a-z][a-z0-9-]{1,30}$')
|
||||
|
||||
|
||||
DDNS_API_BASE = os.environ.get('DDNS_URL', 'https://ddns.pic.ngo/api/v1').replace('/api/v1', '')
|
||||
DDNS_API_BASE = os.environ.get('DDNS_URL', 'https://ddns.pic.ngo/api/v1').rstrip('/').replace('/api/v1', '')
|
||||
DDNS_TOTP_SECRET = os.environ.get('DDNS_TOTP_SECRET', '')
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -205,7 +205,7 @@ services:
|
||||
ports:
|
||||
- "127.0.0.1:${API_PORT:-3000}:3000"
|
||||
environment:
|
||||
- DDNS_URL=${DDNS_URL:-http://ddns.pic.ngo:8080/api/v1}
|
||||
- DDNS_URL=${DDNS_URL:-https://ddns.pic.ngo/api/v1}
|
||||
- DDNS_TOTP_SECRET=${DDNS_TOTP_SECRET:-S6UMA464YIKM74QHXWL5WELDIO3HFZ6K}
|
||||
volumes:
|
||||
- ./data/api:/app/data
|
||||
|
||||
Reference in New Issue
Block a user