remove httpPort

we can just use container IP instead of all this httpPort exporting magic.
this is also required for exposing httpPaths feature (we have to otherwise
have multiple httpPorts).
This commit is contained in:
Girish Ramakrishnan
2020-11-18 23:24:34 -08:00
parent bd9c664b1a
commit d703d1cd13
13 changed files with 115 additions and 172 deletions

View File

@@ -85,8 +85,11 @@ function checkAppHealth(app, callback) {
// non-appstore apps may not have healthCheckPath
if (!manifest.healthCheckPath) return setHealth(app, apps.HEALTH_HEALTHY, callback);
const ip = safe.query(data, 'NetworkSettings.Networks.cloudron.IPAddress', null);
if (!ip) return setHealth(app, apps.HEALTH_ERROR, callback);
// poll through docker network instead of nginx to bypass any potential oauth proxy
var healthCheckUrl = 'http://127.0.0.1:' + app.httpPort + manifest.healthCheckPath;
var healthCheckUrl = `http://${ip}:${manifest.httpPort}${manifest.healthCheckPath}`;
superagent
.get(healthCheckUrl)
.set('Host', app.fqdn) // required for some apache configs with rewrite rules