set appstore config to get updates
This commit is contained in:
parent
1f7a6fc322
commit
d545ae7134
@ -799,3 +799,11 @@ Cloudron.prototype.checkNginxRateLimit = function (owner, times, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
Cloudron.prototype.setAppstoreConfig = function (email, password, callback) {
|
||||
superagent.post(process.env.APPSTORE_API_ORIGIN + '/api/v1/login').send({ email: email, password: password, persistent: true }).end(function (error, result) {
|
||||
if (error || result.statusCode !== 200) return callback('Error logging into appstore:' + error.message);
|
||||
|
||||
superagent.post('https://' + that._adminFqdn + '/api/v1/settings/appstore_config').send({ userId: result.userId, token: result.accessToken }).end(callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -238,6 +238,10 @@ describe('Selfhost DigitalOcean with filesystem backend', function () {
|
||||
cloudron.checkAddons(cloudron.appFqdn(location), owner);
|
||||
});
|
||||
|
||||
it('can set appstore config', function (done) {
|
||||
cloudron.setAppstoreConfig(process.env.APPSTORE_USERNAME, process.env.APPSTORE_PASSWORD, done);
|
||||
});
|
||||
|
||||
it('can update the box', function () {
|
||||
cloudron.checkForUpdates();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user