diff --git a/apps/pusher_app_prem/appserver/static/git_pusher_config.js b/apps/pusher_app_prem/appserver/static/git_pusher_config.js index 2b68714d..3e763d33 100644 --- a/apps/pusher_app_prem/appserver/static/git_pusher_config.js +++ b/apps/pusher_app_prem/appserver/static/git_pusher_config.js @@ -234,7 +234,17 @@ require([ } var protocol = useSSL ? 'https' : 'http'; - var url = protocol + '://' + host + ':' + port + '/health'; + var url; + + // Si c'est un nom de domaine (contient des lettres et des points, pas une IP) + // Ne pas ajouter le port (le proxy gère) + if (/^[a-zA-Z]/.test(host) && host.indexOf('.') > -1 && !/^(\d{1,3}\.){3}\d{1,3}$/.test(host)) { + // C'est un domaine, pas de port + url = protocol + '://' + host + '/health'; + } else { + // C'est une IP ou localhost, ajouter le port + url = protocol + '://' + host + ':' + port + '/health'; + } console.log('Testing Deployer URL:', url); diff --git a/apps/pusher_app_prem/bin/git_pusher.pid b/apps/pusher_app_prem/bin/git_pusher.pid index f460701d..cc6fad70 100644 --- a/apps/pusher_app_prem/bin/git_pusher.pid +++ b/apps/pusher_app_prem/bin/git_pusher.pid @@ -1 +1 @@ -1762012 +1988048 diff --git a/apps/pusher_app_prem/bin/git_pusher.py b/apps/pusher_app_prem/bin/git_pusher.py index d4634388..593743a1 100755 --- a/apps/pusher_app_prem/bin/git_pusher.py +++ b/apps/pusher_app_prem/bin/git_pusher.py @@ -753,7 +753,16 @@ def call_deployer_agent(endpoint, method="GET", data=None, config=None): timeout = config.get("timeout", 30) protocol = "https" if use_ssl else "http" - url = f"{protocol}://{host}:{port}{endpoint}" + + # Si c'est un nom de domaine (commence par une lettre et contient un point) + # Ne pas ajouter le port (le proxy gère) + import re + is_domain = bool(re.match(r'^[a-zA-Z]', host)) and '.' in host and not re.match(r'^(\d{1,3}\.){3}\d{1,3}$', host) + + if is_domain: + url = f"{protocol}://{host}{endpoint}" + else: + url = f"{protocol}://{host}:{port}{endpoint}" logger.info(f"Calling SH Deployer: {method} {url}") diff --git a/apps/pusher_app_prem/local/config.json b/apps/pusher_app_prem/local/config.json index 90eccb76..41802687 100644 --- a/apps/pusher_app_prem/local/config.json +++ b/apps/pusher_app_prem/local/config.json @@ -5,8 +5,8 @@ "useProxy": true }, "deployer": { - "enabled": false, - "host": "10.10.40.14", + "enabled": true, + "host": "myprivspldev-shdp-api.jp-engineering.fr", "port": 9998, "token": "bc2564e5a885d49ac3811dc946ca5620da24da19b8a8f5c5fdfcd7c07a241688", "useSSL": true