diff --git a/ct/wealthfolio.sh b/ct/wealthfolio.sh index fe8e89395..09652ff23 100644 --- a/ct/wealthfolio.sh +++ b/ct/wealthfolio.sh @@ -29,8 +29,11 @@ function update_script() { exit fi - RELEASE="3.0.3" - if check_for_gh_release "wealthfolio" "afadil/wealthfolio" "${RELEASE}"; then + if grep -q '^WF_CORS_ALLOW_ORIGINS=\*$' /opt/wealthfolio/.env; then + sed -i "s|^WF_CORS_ALLOW_ORIGINS=\*$|WF_CORS_ALLOW_ORIGINS=http://${LOCAL_IP}:8080|" /opt/wealthfolio/.env + fi + + if check_for_gh_release "wealthfolio" "afadil/wealthfolio"; then msg_info "Stopping Service" systemctl stop wealthfolio msg_ok "Stopped Service" @@ -40,7 +43,7 @@ function update_script() { cp /opt/wealthfolio/.env /opt/wealthfolio_env_backup msg_ok "Backed up Data" - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wealthfolio" "afadil/wealthfolio" "tarball" "v${RELEASE}" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wealthfolio" "afadil/wealthfolio" "tarball" msg_info "Building Frontend (patience)" cd /opt/wealthfolio diff --git a/install/wealthfolio-install.sh b/install/wealthfolio-install.sh index 8c82d5471..84a633466 100644 --- a/install/wealthfolio-install.sh +++ b/install/wealthfolio-install.sh @@ -51,8 +51,8 @@ WF_DB_PATH=/opt/wealthfolio_data/wealthfolio.db WF_SECRET_KEY=${SECRET_KEY} WF_AUTH_PASSWORD_HASH=${WF_PASSWORD_HASH} WF_STATIC_DIR=/opt/wealthfolio/dist -WF_CORS_ALLOW_ORIGINS=* WF_REQUEST_TIMEOUT_MS=30000 +WF_CORS_ALLOW_ORIGINS=http://${LOCAL_IP}:8080 EOF echo "WF_PASSWORD=${WF_PASSWORD}" >~/wealthfolio.creds msg_ok "Configured Wealthfolio"