nginx: add separate endpoint for ip/setup screens

'setup' endpoint for setup/restore. we show the setup wizard.
'ip' endpoint is post activation. we show a splash screen here.

Also, the https://ip will not respond to any api calls anymore
(since this will leak the admin fqdn otherwise).

We should probably make this customizable at some point.

Fixes #739
This commit is contained in:
Girish Ramakrishnan
2020-09-23 22:13:02 -07:00
parent eb47476c83
commit 0f9168052a
5 changed files with 55 additions and 61 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ function onActivated(callback) {
// 1. mail bounces can now be sent to the cloudron owner
// 2. the restore code path can run without sudo (since mail/ is non-root)
async.series([
reverseProxy.removeDefaultConfig, // remove IP based nginx config once user is created
(done) => reverseProxy.writeDefaultConfig({ activated :true }, done), // update IP based nginx config once user is created
platform.start,
cron.startJobs,
function checkBackupConfiguration(callback) {
@@ -141,7 +141,7 @@ function runStartupTasks() {
// we remove the config as a simple security measure to not expose IP <-> domain
if (!activated) {
debug('runStartupTasks: not activated. generating IP based redirection config');
return reverseProxy.writeDefaultConfig(callback);
return reverseProxy.writeDefaultConfig({ activated: false }, callback);
}
onActivated(callback);