diff --git a/scripts/cloudron-setup b/scripts/cloudron-setup index e32a36573..f6b188e26 100755 --- a/scripts/cloudron-setup +++ b/scripts/cloudron-setup @@ -48,9 +48,8 @@ apiServerOrigin="https://api.cloudron.io" webServerOrigin="https://cloudron.io" sourceTarballUrl="" rebootServer="true" -license="" -args=$(getopt -o "" -l "help,skip-baseimage-init,provider:,version:,env:,skip-reboot,license:" -n "$0" -- "$@") +args=$(getopt -o "" -l "help,skip-baseimage-init,provider:,version:,env:,skip-reboot" -n "$0" -- "$@") eval set -- "${args}" while true; do @@ -67,7 +66,6 @@ while true; do webServerOrigin="https://staging.cloudron.io" fi shift 2;; - --license) license="$2"; shift 2;; --skip-baseimage-init) initBaseImage="false"; shift;; --skip-reboot) rebootServer="false"; shift;; --) break;; @@ -208,8 +206,6 @@ echo "=> Installing version ${version} (this takes some time) ..." mkdir -p /etc/cloudron echo "${provider}" > /etc/cloudron/PROVIDER -[[ -n "${license}" ]] && echo -n "$license" > /etc/cloudron/LICENSE - if ! /bin/bash "${box_src_tmp_dir}/scripts/installer.sh" &>> "${LOG_FILE}"; then echo "Failed to install cloudron. See ${LOG_FILE} for details" exit 1 diff --git a/src/paths.js b/src/paths.js index b8984cf9b..6761f98ad 100644 --- a/src/paths.js +++ b/src/paths.js @@ -17,7 +17,6 @@ exports = module.exports = { CLOUDRON_DEFAULT_AVATAR_FILE: path.join(__dirname + '/../assets/avatar.png'), INFRA_VERSION_FILE: path.join(baseDir(), 'platformdata/INFRA_VERSION'), - LICENSE_FILE: '/etc/cloudron/LICENSE', PROVIDER_FILE: '/etc/cloudron/PROVIDER', PLATFORM_DATA_DIR: path.join(baseDir(), 'platformdata'), diff --git a/src/provision.js b/src/provision.js index db3872abb..5029c3769 100644 --- a/src/provision.js +++ b/src/provision.js @@ -4,9 +4,7 @@ exports = module.exports = { setup: setup, restore: restore, activate: activate, - getStatus: getStatus, - - autoRegister: autoRegister + getStatus: getStatus }; var appstore = require('./appstore.js'), @@ -53,27 +51,6 @@ function setProgress(task, message, callback) { callback(); } -function autoRegister(domain, callback) { - assert.strictEqual(typeof domain, 'string'); - assert.strictEqual(typeof callback, 'function'); - - if (!fs.existsSync(paths.LICENSE_FILE)) return callback(); - - const license = safe.fs.readFileSync(paths.LICENSE_FILE, 'utf8'); - if (!license) return callback(new BoxError(BoxError.LICENSE_ERROR, 'Cannot read license')); - - debug('Auto-registering cloudron'); - - appstore.registerWithLicense(license.trim(), domain, function (error) { - if (error && error.reason !== BoxError.CONFLICT) { // not already registered - debug('Failed to auto-register cloudron', error); - return callback(new BoxError(BoxError.LICENSE_ERROR, 'Failed to auto-register Cloudron with license. Please contact support@cloudron.io')); - } - - callback(); - }); -} - function unprovision(callback) { assert.strictEqual(typeof callback, 'function'); @@ -134,7 +111,6 @@ function setup(dnsConfig, sysinfoConfig, auditSource, callback) { callback(); // now that args are validated run the task in the background async.series([ - autoRegister.bind(null, domain), settings.setSysinfoConfig.bind(null, sysinfoConfig), domains.prepareDashboardDomain.bind(null, domain, auditSource, (progress) => setProgress('setup', progress.message, NOOP_CALLBACK)), cloudron.setDashboardDomain.bind(null, domain, auditSource),