diff --git a/scripts/cloudron-setup b/scripts/cloudron-setup index 711f5f13d..5c6e91434 100755 --- a/scripts/cloudron-setup +++ b/scripts/cloudron-setup @@ -64,7 +64,7 @@ baseDataDir="" # TODO this is still there for the restore case, see other occasions below versionsUrl="https://s3.amazonaws.com/prod-cloudron-releases/versions.json" -args=$(getopt -o "" -l "domain:,help,skip-baseimage-init,data:,data-dir:,provider:,encryption-key:,restore-url:,tls-provider:,version:,dns-provider:,env:,admin-location:,prerelease,skip-reboot,source-url:" -n "$0" -- "$@") +args=$(getopt -o "" -l "domain:,help,skip-baseimage-init,data:,data-dir:,provider:,encryption-key:,tls-provider:,version:,dns-provider:,env:,admin-location:,prerelease,skip-reboot,source-url:" -n "$0" -- "$@") eval set -- "${args}" while true; do @@ -74,7 +74,6 @@ while true; do --help) echo "See https://cloudron.io/documentation/installation/ on how to install Cloudron"; exit 0;; --provider) provider="$2"; shift 2;; --encryption-key) encryptionKey="$2"; shift 2;; - --restore-url) restoreUrl="$2"; shift 2;; --tls-provider) tlsProvider="$2"; shift 2;; --dns-provider) dnsProvider="$2"; shift 2;; --version) requestedVersion="$2"; shift 2;; diff --git a/setup/argparser.sh b/setup/argparser.sh index 0ee670e6b..fd1d89a0d 100644 --- a/setup/argparser.sh +++ b/setup/argparser.sh @@ -9,8 +9,6 @@ arg_fqdn="" arg_admin_location="" arg_zone_name="" arg_is_custom_domain="false" -arg_restore_key="" -arg_restore_url="" arg_retire_reason="" arg_retire_info="" arg_tls_config="" @@ -74,12 +72,6 @@ while true; do arg_tls_config=$(echo "$2" | $json tlsConfig) [[ "${arg_tls_config}" == "null" ]] && arg_tls_config="" - arg_restore_url=$(echo "$2" | $json restore.url) - [[ "${arg_restore_url}" == "null" ]] && arg_restore_url="" - - arg_restore_key=$(echo "$2" | $json restore.key) - [[ "${arg_restore_key}" == "null" ]] && arg_restore_key="" - arg_backup_config=$(echo "$2" | $json backupConfig) [[ "${arg_backup_config}" == "null" ]] && arg_backup_config="" @@ -97,10 +89,8 @@ echo "Parsed arguments:" echo "api server: ${arg_api_server_origin}" echo "fqdn: ${arg_fqdn}" echo "custom domain: ${arg_is_custom_domain}" -echo "restore url: ${arg_restore_url}" echo "tls cert: ${arg_tls_cert}" # do not dump these as they might become available via logs API -#echo "restore key: ${arg_restore_key}" #echo "tls key: ${arg_tls_key}" #echo "token: ${arg_token}" echo "tlsConfig: ${arg_tls_config}" diff --git a/setup/start.sh b/setup/start.sh index 0f295c296..75bdfeab4 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -199,42 +199,6 @@ readonly mysql_root_password="password" mysqladmin -u root -ppassword password password # reset default root password mysql -u root -p${mysql_root_password} -e 'CREATE DATABASE IF NOT EXISTS box' -if [[ -n "${arg_restore_url}" ]]; then - set_progress "30" "Downloading restore data" - - readonly restore_dir="${arg_restore_url#file://}" - - if [[ -d "${restore_dir}" ]]; then # rsync backup - echo "==> Copying backup: ${restore_dir}" - if [[ $(stat -c "%d" "${BOX_DATA_DIR}") == $(stat -c "%d" "${restore_dir}") ]]; then - cp -rfl "${restore_dir}/." "${BOX_DATA_DIR}" - else - cp -rf "${restore_dir}/." "${BOX_DATA_DIR}" - fi - else # tgz backup - decrypt="" - if [[ "${arg_restore_url}" == *.tar.gz.enc || -n "${arg_restore_key}" ]]; then - echo "==> Downloading encrypted backup: ${arg_restore_url} and key: ${arg_restore_key}" - decrypt=(openssl aes-256-cbc -d -nosalt -pass "pass:${arg_restore_key}") - elif [[ "${arg_restore_url}" == *.tar.gz ]]; then - echo "==> Downloading backup: ${arg_restore_url}" - decrypt=(cat -) - fi - - while true; do - if $curl -L "${arg_restore_url}" | "${decrypt[@]}" \ - | tar -zxf - --overwrite -C "${BOX_DATA_DIR}"; then break; fi - echo "Failed to download data, trying again" - done - fi - - set_progress "35" "Setting up MySQL" - if [[ -f "${BOX_DATA_DIR}/box.mysqldump" ]]; then - echo "==> Importing existing database into MySQL" - mysql -u root -p${mysql_root_password} box < "${BOX_DATA_DIR}/box.mysqldump" - fi -fi - set_progress "40" "Migrating data" sudo -u "${USER}" -H bash <