From 25acb235c8af11e59fd0cda46498b81f653a19e1 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sat, 10 Sep 2022 02:42:54 +0200 Subject: [PATCH] feat: includ internalip:port as app_domain if app is not exposed --- packages/system-api/src/config/config.ts | 2 ++ packages/system-api/src/modules/apps/apps.helpers.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/system-api/src/config/config.ts b/packages/system-api/src/config/config.ts index c8f1d321..142bc22b 100644 --- a/packages/system-api/src/config/config.ts +++ b/packages/system-api/src/config/config.ts @@ -14,6 +14,7 @@ interface IConfig { ROOT_FOLDER_HOST: string; APPS_REPO_ID: string; APPS_REPO_URL: string; + INTERNAL_IP: string; } if (process.env.NODE_ENV !== 'production') { @@ -51,6 +52,7 @@ const config: IConfig = { ROOT_FOLDER_HOST, APPS_REPO_ID, APPS_REPO_URL, + INTERNAL_IP, }; export default config; diff --git a/packages/system-api/src/modules/apps/apps.helpers.ts b/packages/system-api/src/modules/apps/apps.helpers.ts index 4a41c796..7def87ec 100644 --- a/packages/system-api/src/modules/apps/apps.helpers.ts +++ b/packages/system-api/src/modules/apps/apps.helpers.ts @@ -108,9 +108,9 @@ export const generateEnvFile = (app: App) => { if (app.exposed && app.domain) { envFile += 'APP_EXPOSED=true\n'; envFile += `APP_DOMAIN=${app.domain}\n`; - envFile += `APP_PROTOCOL=https\n`; + envFile += 'APP_PROTOCOL=https\n'; } else { - envFile += `APP_DOMAIN=${InternalIp.v4()}:${configFile.port}\n`; + envFile += `APP_DOMAIN=${config.INTERNAL_IP}:${configFile.port}\n`; } writeFile(`/app-data/${app.id}/app.env`, envFile);