diff --git a/src/infra_version.js b/src/infra_version.js index 3c6613a23..9bc72a4cb 100644 --- a/src/infra_version.js +++ b/src/infra_version.js @@ -5,14 +5,12 @@ // Do not require anything here! exports = module.exports = { - // a major version makes all apps restore from backup. #451 must be fixed before we do this. - // a minor version makes all apps re-configure themselves + // a version change recreates all containers with latest docker config 'version': '48.12.0', 'baseImages': [ 'cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617' ], - // Note that if any of the databases include an upgrade, bump the infra version above - // This is because we upgrade using dumps instead of mysql_upgrade, pg_upgrade etc + // a major version bump in the db containers will trigger the restore logic that uses the db dumps // docker inspect --format='{{index .RepoDigests 0}}' $IMAGE to get the sha256 'images': { 'mysql': { repo: 'cloudron/mysql', tag: 'cloudron/mysql:2.0.0@sha256:1c177c3fa079695aea13cec6daf52b772f400022131f31e8da237f55d683d9f4' }, diff --git a/src/platform.js b/src/platform.js index 2a9c5c53d..bb1c7dc0f 100644 --- a/src/platform.js +++ b/src/platform.js @@ -360,21 +360,16 @@ function startAddons(existingInfra, callback) { } function startApps(existingInfra, callback) { - // Infra version change strategy: - // * no existing version - restore apps - // * major versions - restore apps - // * minor versions - reconfigure apps - - if (existingInfra.version === infra.version) { - debug('startApp: apps are already uptodate'); - callback(); - } else if (existingInfra.version === 'none' || !semver.valid(existingInfra.version) || semver.major(existingInfra.version) !== semver.major(infra.version)) { + if (existingInfra.version === 'none') { debug('startApps: restoring installed apps'); apps.restoreInstalledApps(callback); - } else { + } else if (existingInfra.version !== infra.version) { debug('startApps: reconfiguring installed apps'); reverseProxy.removeAppConfigs(); // should we change the cert location, nginx will not start apps.configureInstalledApps(callback); + } else { + debug('startApps: apps are already uptodate'); + callback(); } }