Send setup state to get the actually correct ip

This commit is contained in:
Johannes Zellner
2019-12-10 17:30:38 +01:00
parent e4dd5d6434
commit ccca3aca04
2 changed files with 35 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ exports = module.exports = {
};
var assert = require('assert'),
appstore = require('../appstore.js'),
auditSource = require('../auditsource.js'),
BoxError = require('../boxerror.js'),
debug = require('debug')('box:routes/setup'),
@@ -62,6 +63,8 @@ function setup(req, res, next) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, {}));
appstore.trackFinishedSetup(dnsConfig.domain);
});
}
@@ -116,5 +119,10 @@ function getStatus(req, res, next) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, status));
// check if Cloudron is not in setup state nor activated and let appstore know of the attempt
if (!status.activated && !status.setup.active && !status.restore.active) {
appstore.trackBeginSetup(status.provider);
}
});
}