No more static ips
This commit is contained in:
parent
7f16c39129
commit
bb89c0d6ce
|
@ -99,13 +99,10 @@ AppStore.prototype.waitForCloudron = function (boxId) {
|
||||||
|
|
||||||
if (!boxInfo) throw new Error('waitForCloudron: could not get cloudron information');
|
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
|
// check for ready state
|
||||||
if (boxInfo.status !== 'ready') throw new Error('waitForCloudron: could not get cloudron status');
|
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
|
// 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.');
|
process.stdout.write('Waiting for Cloudron to be reachable.');
|
||||||
|
|
|
@ -444,7 +444,7 @@ Cloudron.prototype.setAutoupdatePattern = function (pattern) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Cloudron.prototype.checkA = function (callback) {
|
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) {
|
dns.resolve4(this._box.domain, function (error, records) {
|
||||||
if (error) return callback(error);
|
if (error) return callback(error);
|
||||||
|
|
|
@ -153,13 +153,13 @@ describe('Cloudron backup testing', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('wait for local dns', 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++) {
|
for (var i = 0; i < 50; i++) {
|
||||||
var ip = dnsSync.resolve(box.domain);
|
var ip = dnsSync.resolve(box.domain);
|
||||||
if (ip === expectedIp) return;
|
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);
|
sleep(30);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue