diff --git a/.gitignore b/.gitignore index 99a44158f..c67a19737 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ node_modules/ coverage/ webadmin/dist/ -setup/splash/website/ installer/src/certs/server.key # vim swap files diff --git a/setup/splashpage.sh b/setup/splashpage.sh deleted file mode 100755 index 88d17d947..000000000 --- a/setup/splashpage.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -readonly SETUP_WEBSITE_DIR="/home/yellowtent/setup/website" - -script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -readonly box_src_dir="$(realpath ${script_dir}/..)" -readonly PLATFORM_DATA_DIR="/home/yellowtent/platformdata" - -echo "Setting up nginx update page" - -if [[ ! -f "${PLATFORM_DATA_DIR}/nginx/applications/admin.conf" ]]; then - echo "No admin.conf found. This Cloudron has no domain yet. Skip splash setup" - exit -fi - -source "${script_dir}/argparser.sh" "$@" # this injects the arg_* variables used below - -# keep this is sync with config.js appFqdn() -admin_origin="https://${arg_admin_fqdn}" - -# copy the website -rm -rf "${SETUP_WEBSITE_DIR}" && mkdir -p "${SETUP_WEBSITE_DIR}" -cp -r "${script_dir}/splash/website/"* "${SETUP_WEBSITE_DIR}" - -# create nginx config -readonly current_infra=$(node -e "console.log(require('${script_dir}/../src/infra_version.js').version);") -existing_infra="none" -[[ -f "${PLATFORM_DATA_DIR}/INFRA_VERSION" ]] && existing_infra=$(node -e "console.log(JSON.parse(require('fs').readFileSync('${PLATFORM_DATA_DIR}/INFRA_VERSION', 'utf8')).version);") -if [[ "${arg_retire_reason}" != "" || "${existing_infra}" != "${current_infra}" ]]; then - echo "Showing progress bar on all subdomains in retired mode or infra update. retire: ${arg_retire_reason} existing: ${existing_infra} current: ${current_infra}" - rm -f ${PLATFORM_DATA_DIR}/nginx/applications/* - ${box_src_dir}/node_modules/.bin/ejs-cli -f "${script_dir}/start/nginx/appconfig.ejs" \ - -O "{ \"vhost\": \"~^(.+)\$\", \"adminOrigin\": \"${admin_origin}\", \"endpoint\": \"splash\", \"sourceDir\": \"${SETUP_WEBSITE_DIR}\", \"certFilePath\": \"cert/host.cert\", \"keyFilePath\": \"cert/host.key\", \"xFrameOptions\": \"SAMEORIGIN\", \"robotsTxtQuoted\": null, \"hasIPv6\": false }" > "${PLATFORM_DATA_DIR}/nginx/applications/admin.conf" -else - echo "Show progress bar only on admin domain for normal update" - ${box_src_dir}/node_modules/.bin/ejs-cli -f "${script_dir}/start/nginx/appconfig.ejs" \ - -O "{ \"vhost\": \"${arg_admin_fqdn}\", \"adminOrigin\": \"${admin_origin}\", \"endpoint\": \"splash\", \"sourceDir\": \"${SETUP_WEBSITE_DIR}\", \"certFilePath\": \"cert/host.cert\", \"keyFilePath\": \"cert/host.key\", \"xFrameOptions\": \"SAMEORIGIN\", \"robotsTxtQuoted\": null, \"hasIPv6\": false }" > "${PLATFORM_DATA_DIR}/nginx/applications/admin.conf" -fi - -if [[ "${arg_retire_reason}" == "migrate" ]]; then - echo "{ \"migrate\": { \"percent\": \"10\", \"message\": \"Migrating cloudron. This could take up to 15 minutes.\", \"info\": ${arg_retire_info} }, \"backup\": null, \"apiServerOrigin\": \"${arg_api_server_origin}\" }" > "${SETUP_WEBSITE_DIR}/progress.json" -else - echo '{ "update": { "percent": "10", "message": "Updating cloudron software" }, "backup": null }' > "${SETUP_WEBSITE_DIR}/progress.json" -fi - -nginx -s reload diff --git a/setup/start/nginx/appconfig.ejs b/setup/start/nginx/appconfig.ejs index a040b5fc0..de72c25ea 100644 --- a/setup/start/nginx/appconfig.ejs +++ b/setup/start/nginx/appconfig.ejs @@ -165,40 +165,6 @@ server { } <% } else if ( endpoint === 'app' ) { %> proxy_pass http://127.0.0.1:<%= port %>; -<% } else if ( endpoint === 'splash' ) { %> - root <%= sourceDir %>; - - error_page 503 /update.html; - - location /update.html { - add_header Cache-Control no-cache; - } - - location /theme.css { - add_header Cache-Control no-cache; - } - - location /3rdparty/ { - add_header Cache-Control no-cache; - } - - location /js/ { - add_header Cache-Control no-cache; - } - - location /progress.json { - add_header Cache-Control no-cache; - } - - location /api/v1/cloudron/progress { - add_header Cache-Control no-cache; - default_type application/json; - alias <%= sourceDir %>/progress.json; - } - - location / { - return 503; - } <% } %> } } diff --git a/src/scripts/retire.sh b/src/scripts/retire.sh index df1c70ffd..9f85bf0a4 100755 --- a/src/scripts/retire.sh +++ b/src/scripts/retire.sh @@ -20,8 +20,6 @@ if [[ "${BOX_ENV}" != "cloudron" ]]; then exit 0 fi -"${BOX_SRC_DIR}/setup/splashpage.sh" --retire-reason "$1" --retire-info "$2" --data "$3" # show splash - echo "Stopping apps" systemctl stop docker # stop the apps