diff --git a/scripts/cloudron-setup b/scripts/cloudron-setup index 70cf9988c..e14c6c37a 100755 --- a/scripts/cloudron-setup +++ b/scripts/cloudron-setup @@ -207,7 +207,7 @@ cat > "/etc/cloudron/cloudron.conf" < /etc/cloudron/LICENSE +[[ -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" diff --git a/src/provision.js b/src/provision.js index b773d3b5f..c99797c04 100644 --- a/src/provision.js +++ b/src/provision.js @@ -338,7 +338,7 @@ function autoRegister(callback) { const license = safe.fs.readFileSync(paths.LICENSE_FILE, 'utf8'); if (!license) return callback(new ProvisionError(ProvisionError.EXTERNAL_ERROR, 'Cannot read license')); - appstore.registerWithLicense(license, function (error) { + appstore.registerWithLicense(license.trim(), function (error) { if (error && error.reason !== AppstoreError.ALREADY_REGISTERED) { debug(error); debug('Failed to auto-register Cloudron with license. Please contact support@cloudron.io');