diff --git a/src/addons.js b/src/addons.js index 75da72fe2..e0ac8d386 100644 --- a/src/addons.js +++ b/src/addons.js @@ -696,7 +696,7 @@ function restoreMySql(app, options, callback) { function postgreSqlNames(appId) { appId = appId.replace(/-/g, ''); - return { database: `db${appId}`, user: `user${appId}` }; + return { database: `db${appId}`, username: `user${appId}` }; } function setupPostgreSql(app, options, callback) { @@ -722,7 +722,7 @@ function setupPostgreSql(app, options, callback) { request.post(`https://${result.ip}:3000/databases?access_token=${result.token}`, { rejectUnauthorized: false, json: data }, function (error, response) { if (error) return callback(new Error('Error setting up postgresql: ' + error)); - if (response.statusCode !== 201) return callback(new Error(`Error setting up postgresql. Status code: ${response.statusCode}`)); + if (response.statusCode !== 201) return callback(new Error(`Error setting up postgresql. Status code: ${response.statusCode} message: ${response.body.message}`)); var env = [ { name: 'POSTGRESQL_URL', value: `postgres://${data.username}:${data.password}@postgresql/${data.database}` }, @@ -754,7 +754,7 @@ function clearPostgreSql(app, options, callback) { request.post(`https://${result.ip}:3000/databases/${database}/clear?access_token=${result.token}&username=${username}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(new Error('Error clearing postgresql: ' + error)); - if (response.statusCode !== 200) return callback(new Error(`Error clearing postgresql. Status code: ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Error clearing postgresql. Status code: ${response.statusCode} message: ${response.body.message}`)); callback(null); }); @@ -773,7 +773,7 @@ function teardownPostgreSql(app, options, callback) { request.delete(`https://${result.ip}:3000/databases/${database}?access_token=${result.token}&username=${username}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(new Error('Error tearing down postgresql: ' + error)); - if (response.statusCode !== 200) return callback(new Error(`Error tearing down postgresql. Status code: ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Error tearing down postgresql. Status code: ${response.statusCode} message: ${response.body.message}`)); appdb.unsetAddonConfig(app.id, 'postgresql', callback); }); @@ -799,7 +799,7 @@ function backupPostgreSql(app, options, callback) { const req = request.post(`https://${result.ip}:3000/databases/${database}/backup?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(error); - if (response.statusCode !== 200) return callback(new Error(`Unexpected response from postgresql addon ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Unexpected response from postgresql addon ${response.statusCode} message: ${response.body.message}`)); callback(null); }); @@ -826,7 +826,7 @@ function restorePostgreSql(app, options, callback) { const restoreReq = request.post(`https://${result.ip}:3000/databases/${database}/restore?access_token=${result.token}&username=${username}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(error); - if (response.statusCode !== 200) return callback(new Error(`Unexpected response from postgresql addon ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Unexpected response from postgresql addon ${response.statusCode} message: ${response.body.message}`)); callback(null); }); @@ -859,7 +859,7 @@ function setupMongoDb(app, options, callback) { if (response.statusCode !== 201) return callback(new Error(`Error setting up mongodb. Status code: ${response.statusCode}`)); var env = [ - { name: 'MONGODB_URL', value : `mongodb://${data.username}:${data.password}@mongodb/${data.database}` }, + { name: 'MONGODB_URL', value : `mongodb://${data.username}:${data.password}@mongodb/${data.database} message: ${response.body.message}` }, { name: 'MONGODB_USERNAME', value : data.username }, { name: 'MONGODB_PASSWORD', value: data.password }, { name: 'MONGODB_HOST', value : 'mongodb' }, @@ -886,7 +886,7 @@ function clearMongodb(app, options, callback) { request.post(`https://${result.ip}:3000/databases/${app.id}/clear?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(new Error('Error clearing mongodb: ' + error)); - if (response.statusCode !== 200) return callback(new Error(`Error clearing mongodb. Status code: ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Error clearing mongodb. Status code: ${response.statusCode} message: ${response.body.message}`)); callback(); }); @@ -905,7 +905,7 @@ function teardownMongoDb(app, options, callback) { request.delete(`https://${result.ip}:3000/databases/${app.id}?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(new Error('Error tearing down mongodb: ' + error)); - if (response.statusCode !== 200) return callback(new Error(`Error tearing down mongodb. Status code: ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Error tearing down mongodb. Status code: ${response.statusCode} message: ${response.body.message}`)); appdb.unsetAddonConfig(app.id, 'mongodb', callback); }); @@ -929,7 +929,7 @@ function backupMongoDb(app, options, callback) { const req = request.post(`https://${result.ip}:3000/databases/${app.id}/backup?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(error); - if (response.statusCode !== 200) return callback(new Error(`Unexpected response from mongodb addon ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Unexpected response from mongodb addon ${response.statusCode} message: ${response.body.message}`)); callback(null); }); @@ -954,7 +954,7 @@ function restoreMongoDb(app, options, callback) { const restoreReq = request.post(`https://${result.ip}:3000/databases/${app.id}/restore?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(error); - if (response.statusCode !== 200) return callback(new Error(`Unexpected response from mongodb addon ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Unexpected response from mongodb addon ${response.statusCode} message: ${response.body.message}`)); callback(null); }); @@ -1045,7 +1045,7 @@ function clearRedis(app, options, callback) { request.post(`https://${result.ip}:3000/clear?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(new Error('Error clearing redis: ' + error)); - if (response.statusCode !== 200) return callback(new Error(`Error clearing redis. Status code: ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Error clearing redis. Status code: ${response.statusCode} message: ${response.body.message}`)); callback(null); }); @@ -1096,7 +1096,7 @@ function backupRedis(app, options, callback) { const req = request.post(`https://${result.ip}:3000/backup?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(new Error('Error backing up redis: ' + error)); - if (response.statusCode !== 200) return callback(new Error(`Error backing up redis. Status code: ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Error backing up redis. Status code: ${response.statusCode} message: ${response.body.message}`)); callback(null); }); @@ -1119,7 +1119,7 @@ function restoreRedis(app, options, callback) { const restoreReq = request.post(`https://${result.ip}:3000/restore?access_token=${result.token}`, { rejectUnauthorized: false }, function (error, response) { if (error) return callback(error); - if (response.statusCode !== 200) return callback(new Error(`Unexpected response from redis addon: ${response.statusCode}`)); + if (response.statusCode !== 200) return callback(new Error(`Unexpected response from redis addon: ${response.statusCode} message: ${response.body.message}`)); callback(null); }); diff --git a/src/infra_version.js b/src/infra_version.js index ce5879a38..4ed5baffa 100644 --- a/src/infra_version.js +++ b/src/infra_version.js @@ -16,8 +16,8 @@ exports = module.exports = { // docker inspect --format='{{index .RepoDigests 0}}' $IMAGE to get the sha256 'images': { 'mysql': { repo: 'cloudron/mysql', tag: 'cloudron/mysql:2.0.1@sha256:42c861338d93beadc11438031ad7f68a10b1582fc27c8432173910d6b4f0e15d' }, - 'postgresql': { repo: 'cloudron/postgresql', tag: 'cloudron/postgresql:2.0.1@sha256:029949062abfc1bed125e7d34882b8ce8465dab2288b04d6f8e5984105a41cee' }, - 'mongodb': { repo: 'cloudron/mongodb', tag: 'cloudron/mongodb:2.0.1@sha256:931267c9243d23c5b41118f29f011f529ca9865db10a5c1c26157eed9efaa676' }, + 'postgresql': { repo: 'cloudron/postgresql', tag: 'cloudron/postgresql:2.0.1@sha256:a40096896960594411864aac1890e2a883639d6df810c2ae7b720ffa52be3681' }, + 'mongodb': { repo: 'cloudron/mongodb', tag: 'cloudron/mongodb:2.0.1@sha256:b320fdea0d256fca73de40370c1029e2624c52620ec178716f59db152aef2d15' }, 'redis': { repo: 'cloudron/redis', tag: 'cloudron/redis:2.0.2@sha256:c062cd77f40da784bd0a3b92b81cfc639e86233a3f04d3f4542749bb0bb422fa' }, 'mail': { repo: 'cloudron/mail', tag: 'cloudron/mail:1.4.0@sha256:28e65b446569a324f4b28e920d43ac9723f9aa9699a629bec7368a2a74669f88' }, 'graphite': { repo: 'cloudron/graphite', tag: 'cloudron/graphite:1.0.0@sha256:196bf1d19782a015b361da48d06ba1017b3d04b4256d93fbb9c0b50599f69f5d' }