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

This commit is contained in:
Nicolas Meienberger 2022-09-10 02:42:54 +02:00
parent 8eae068220
commit 25acb235c8
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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);