From 60965428abdc0fadb2401b6ab012c6468572739d Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 27 Mar 2026 14:32:27 +0100 Subject: [PATCH] Refactor multiple scripts: fix garmin-grafana unbound var, remove creds files, fix tor-snowflake user/sudo, fix ente source URL, fix oxicloud env sourcing, fix pixelfed creds footer --- ct/ente.sh | 2 +- ct/oxicloud.sh | 6 +++--- ct/pixelfed.sh | 2 -- ct/tor-snowflake.sh | 14 +++++++------- install/ente-install.sh | 22 ---------------------- install/garmin-grafana-install.sh | 2 +- install/oxicloud-install.sh | 2 +- install/tor-snowflake-install.sh | 14 ++++---------- json/pixelfed.json | 2 +- 9 files changed, 18 insertions(+), 48 deletions(-) diff --git a/ct/ente.sh b/ct/ente.sh index 89f6e7e5..97a46f4a 100644 --- a/ct/ente.sh +++ b/ct/ente.sh @@ -4,7 +4,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV # Copyright (c) 2021-2026 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE -# Source: https://www.debian.org/ +# Source: https://github.com/ente-io/ente APP="Ente" var_tags="${var_tags:-photos}" diff --git a/ct/oxicloud.sh b/ct/oxicloud.sh index d146c4e8..62f5f196 100644 --- a/ct/oxicloud.sh +++ b/ct/oxicloud.sh @@ -32,7 +32,7 @@ function update_script() { if check_for_gh_release "OxiCloud" "DioCrafts/OxiCloud"; then msg_info "Stopping OxiCloud" - $STD systemctl stop oxicloud + systemctl stop oxicloud msg_ok "Stopped OxiCloud" CLEAN_INSTALL=1 fetch_and_deploy_gh_release "OxiCloud" "DioCrafts/OxiCloud" "tarball" "latest" "/opt/oxicloud" @@ -40,9 +40,9 @@ function update_script() { RUST_TOOLCHAIN=$TOOLCHAIN setup_rust msg_info "Updating OxiCloud" - PG_DB_PASS="$(sed -n '/Password:/s/[^:]*:[[:space:]]//p' ~/oxicloud.creds)" + source /etc/oxicloud/.env cd /opt/oxicloud - export DATABASE_URL="postgres://oxicloud:${PG_DB_PASS}@localhost/oxicloud" + export DATABASE_URL export RUSTFLAGS="-C target-cpu=native" $STD cargo build --release mv target/release/oxicloud /usr/bin/oxicloud && chmod +x /usr/bin/oxicloud diff --git a/ct/pixelfed.sh b/ct/pixelfed.sh index 446d5541..85de1079 100644 --- a/ct/pixelfed.sh +++ b/ct/pixelfed.sh @@ -77,5 +77,3 @@ echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" echo -e "${INFO}${YW} Create an admin account with:${CL}" echo -e "${TAB}cd /opt/pixelfed && sudo -u pixelfed php artisan user:create" -echo -e "${INFO}${YW} Credentials saved in:${CL}" -echo -e "${TAB}/root/pixelfed.creds" diff --git a/ct/tor-snowflake.sh b/ct/tor-snowflake.sh index 0e287a88..20397e45 100644 --- a/ct/tor-snowflake.sh +++ b/ct/tor-snowflake.sh @@ -32,7 +32,7 @@ function update_script() { msg_ok "Updated Container OS" RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//') - if [[ ! -f "~/.tor-snowflake" ]] || [[ "${RELEASE}" != "$(cat "~/.tor-snowflake")" ]]; then + if [[ ! -f ~/.tor-snowflake ]] || [[ "${RELEASE}" != "$(cat ~/.tor-snowflake)" ]]; then msg_info "Stopping Service" systemctl stop snowflake-proxy msg_ok "Stopped Service" @@ -41,12 +41,12 @@ function update_script() { msg_info "Updating Snowflake" $STD curl -fsSL "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/archive/v${RELEASE}/snowflake-v${RELEASE}.tar.gz" -o /opt/snowflake.tar.gz - $STD tar -xzf /opt/snowflake.tar.gz -C /opt - $STD rm -rf /opt/snowflake.tar.gz - $STD rm -rf /opt/tor-snowflake - $STD mv /opt/snowflake-v${RELEASE} /opt/tor-snowflake - $STD chown -R snowflake:snowflake /opt/tor-snowflake - $STD sudo -H -u snowflake bash -c "cd /opt/tor-snowflake/proxy && go build -o snowflake-proxy ." + tar -xzf /opt/snowflake.tar.gz -C /opt + rm -rf /opt/snowflake.tar.gz + rm -rf /opt/tor-snowflake + mv /opt/snowflake-v${RELEASE} /opt/tor-snowflake + cd /opt/tor-snowflake/proxy + $STD go build -o snowflake-proxy . echo "${RELEASE}" >~/.tor-snowflake msg_ok "Updated Snowflake to v${RELEASE}" diff --git a/install/ente-install.sh b/install/ente-install.sh index 9e1ad5fe..1123ce27 100644 --- a/install/ente-install.sh +++ b/install/ente-install.sh @@ -51,28 +51,6 @@ endpoint: EOF msg_ok "Configured Ente CLI" -msg_info "Saving Ente Credentials" -{ - echo "Important Configuration Notes:" - echo "- Frontend is built with IP: $LOCAL_IP" - echo "- If IP changes, run: /opt/ente/rebuild-frontend.sh" - echo "- Museum API: http://$LOCAL_IP:8080" - echo "- Photos UI: http://$LOCAL_IP:3000" - echo "- Accounts UI: http://$LOCAL_IP:3001" - echo "- Auth UI: http://$LOCAL_IP:3003" - echo "" - echo "Post-Installation Steps Required:" - echo "1. Create your first user account via the web UI" - echo "2. Check museum logs for email verification code:" - echo " journalctl -u ente-museum -n 100 | grep -i 'verification'" - echo "3. Use verification code to complete account setup" - echo "4. Remove subscription limit (replace with your account):" - echo " ente admin update-subscription -a -u --no-limit" - echo "" - echo "Note: Email verification requires manual intervention since SMTP is not configured" -} >>~/ente.creds -msg_ok "Saved Ente Credentials" - msg_info "Building Museum (server)" cd /opt/ente/server $STD corepack enable diff --git a/install/garmin-grafana-install.sh b/install/garmin-grafana-install.sh index e6afd68b..e9b366d8 100644 --- a/install/garmin-grafana-install.sh +++ b/install/garmin-grafana-install.sh @@ -27,7 +27,7 @@ msg_ok "Installed InfluxDB" msg_info "Installing Chronograf" CHRONOGRAF_VERSION=$(get_latest_github_release "influxdata/chronograf") -fetch_and_deploy_from_url "https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_amd64.deb" +fetch_and_deploy_from_url "https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_amd64.deb" "" msg_ok "Installed Chronograf" msg_info "Configuring InfluxDB" diff --git a/install/oxicloud-install.sh b/install/oxicloud-install.sh index 2d248c75..a53ffc0d 100644 --- a/install/oxicloud-install.sh +++ b/install/oxicloud-install.sh @@ -64,7 +64,7 @@ StandardError=journal [Install] WantedBy=multi-user.target EOF -$STD systemctl enable -q --now oxicloud +systemctl enable -q --now oxicloud msg_ok "Created OxiCloud Service" motd_ssh diff --git a/install/tor-snowflake-install.sh b/install/tor-snowflake-install.sh index 56fa0894..1d49a501 100644 --- a/install/tor-snowflake-install.sh +++ b/install/tor-snowflake-install.sh @@ -15,18 +15,14 @@ update_os setup_go -msg_info "Creating snowflake user" -useradd -m -r -s /usr/sbin/nologin -d /home/snowflake snowflake -msg_ok "Created snowflake user" - msg_info "Building Snowflake" RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//') $STD curl -fsSL "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/archive/v${RELEASE}/snowflake-v${RELEASE}.tar.gz" -o /opt/snowflake.tar.gz $STD tar -xzf /opt/snowflake.tar.gz -C /opt -$STD rm -rf /opt/snowflake.tar.gz -$STD mv /opt/snowflake-v${RELEASE} /opt/tor-snowflake -$STD chown -R snowflake:snowflake /opt/tor-snowflake -$STD sudo -H -u snowflake bash -c "cd /opt/tor-snowflake/proxy && go build -o snowflake-proxy ." +rm -rf /opt/snowflake.tar.gz +mv /opt/snowflake-v${RELEASE} /opt/tor-snowflake +cd /opt/tor-snowflake/proxy +$STD go build -o snowflake-proxy . echo "${RELEASE}" >~/.tor-snowflake msg_ok "Built Snowflake Proxy v${RELEASE}" @@ -40,8 +36,6 @@ Wants=network-online.target [Service] Type=simple -User=snowflake -Group=snowflake WorkingDirectory=/opt/tor-snowflake/proxy ExecStart=/opt/tor-snowflake/proxy/snowflake-proxy -verbose -unsafe-logging Restart=always diff --git a/json/pixelfed.json b/json/pixelfed.json index e607c191..770dba93 100644 --- a/json/pixelfed.json +++ b/json/pixelfed.json @@ -37,7 +37,7 @@ "type": "warning" }, { - "text": "Credentials saved in /root/pixelfed.creds", + "text": "Credentials are stored in /opt/pixelfed/.env", "type": "info" }, {