No more static ips

This commit is contained in:
Johannes Zellner 2016-09-20 11:09:14 +02:00
parent 7f16c39129
commit bb89c0d6ce
3 changed files with 4 additions and 7 deletions

View File

@ -99,13 +99,10 @@ AppStore.prototype.waitForCloudron = function (boxId) {
if (!boxInfo) throw new Error('waitForCloudron: could not get cloudron information');
// check for static ip
if (boxInfo.isCustomDomain && !boxInfo.staticIp) throw new Error('waitForCloudron: could not get cloudron static ip');
// check for ready state
if (boxInfo.status !== 'ready') throw new Error('waitForCloudron: could not get cloudron status');
debug('Box created in %s minutes with IP:%s (static: %s)'.green, (new Date() - creationTime) / 60000, res.body.box.ip, res.body.box.staticIp);
debug('Box created in %s minutes with IP:%s'.green, (new Date() - creationTime) / 60000, res.body.box.ip);
// even if the cloudron sent heartbeat to appstore, doesn't mean we can contact the cloudron thanks to DO networking insanity
process.stdout.write('Waiting for Cloudron to be reachable.');

View File

@ -444,7 +444,7 @@ Cloudron.prototype.setAutoupdatePattern = function (pattern) {
};
Cloudron.prototype.checkA = function (callback) {
var expectedIp = this._isCustomDomain ? this._box.staticIp : this._box.ip;
var expectedIp = this._box.ip;
dns.resolve4(this._box.domain, function (error, records) {
if (error) return callback(error);

View File

@ -153,13 +153,13 @@ describe('Cloudron backup testing', function () {
});
it('wait for local dns', function () {
var expectedIp = box.isCustomDomain ? box.staticIp : box.ip;
var expectedIp = box.ip;
for (var i = 0; i < 50; i++) {
var ip = dnsSync.resolve(box.domain);
if (ip === expectedIp) return;
console.log('waiting for local dns to change from %s to %s', ip, box.staticIp);
console.log('waiting for local dns to change from %s to %s', ip, expectedIp);
sleep(30);
}
});