Kaynağa Gözat

feat: includ internalip:port as app_domain if app is not exposed

Nicolas Meienberger 2 yıl önce
ebeveyn
işleme
25acb235c8

+ 2 - 0
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;

+ 2 - 2
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);