mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-03 16:15:54 +00:00
Tracearr: prepare for imminent v1.4.19 release (#12413)
* Tracearr: prepare for upcoming v1.4.19 * remove read prompts, per review
This commit is contained in:
@@ -75,10 +75,31 @@ if [ -f \$pg_config_file ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
systemctl restart postgresql
|
systemctl restart postgresql
|
||||||
|
sudo -u postgres psql -c "ALTER USER tracearr WITH SUPERUSER;"
|
||||||
EOF
|
EOF
|
||||||
chmod +x /data/tracearr/prestart.sh
|
chmod +x /data/tracearr/prestart.sh
|
||||||
msg_ok "Updated prestart script"
|
msg_ok "Updated prestart script"
|
||||||
|
|
||||||
|
# check if tailscale is installed
|
||||||
|
if command -v tailscale >/dev/null 2>&1; then
|
||||||
|
# Tracearr runs tailscaled in user mode, disable the service.
|
||||||
|
$STD systemctl disable --now tailscaled
|
||||||
|
$STD systemctl stop tailscaled
|
||||||
|
msg_ok "Tailscale already installed"
|
||||||
|
else
|
||||||
|
msg_info "Installing tailscale"
|
||||||
|
setup_deb822_repo \
|
||||||
|
"tailscale" \
|
||||||
|
"https://pkgs.tailscale.com/stable/$(get_os_info id)/$(get_os_info codename).noarmor.gpg" \
|
||||||
|
"https://pkgs.tailscale.com/stable/$(get_os_info id)/" \
|
||||||
|
"$(get_os_info codename)"
|
||||||
|
$STD apt install -y tailscale
|
||||||
|
# Tracearr runs tailscaled in user mode, disable the service.
|
||||||
|
$STD systemctl disable --now tailscaled
|
||||||
|
$STD systemctl stop tailscaled
|
||||||
|
msg_ok "Installed tailscale"
|
||||||
|
fi
|
||||||
|
|
||||||
if check_for_gh_release "tracearr" "connorgallopo/Tracearr"; then
|
if check_for_gh_release "tracearr" "connorgallopo/Tracearr"; then
|
||||||
msg_info "Stopping Services"
|
msg_info "Stopping Services"
|
||||||
systemctl stop tracearr postgresql redis
|
systemctl stop tracearr postgresql redis
|
||||||
@@ -122,6 +143,8 @@ EOF
|
|||||||
sed -i "s/^APP_VERSION=.*/APP_VERSION=$(cat /root/.tracearr)/" /data/tracearr/.env
|
sed -i "s/^APP_VERSION=.*/APP_VERSION=$(cat /root/.tracearr)/" /data/tracearr/.env
|
||||||
chmod 600 /data/tracearr/.env
|
chmod 600 /data/tracearr/.env
|
||||||
chown -R tracearr:tracearr /data/tracearr
|
chown -R tracearr:tracearr /data/tracearr
|
||||||
|
mkdir -p /data/backup
|
||||||
|
chown -R tracearr:tracearr /data/backup
|
||||||
msg_ok "Configured Tracearr"
|
msg_ok "Configured Tracearr"
|
||||||
|
|
||||||
msg_info "Starting services"
|
msg_info "Starting services"
|
||||||
|
|||||||
@@ -44,7 +44,20 @@ $STD timescaledb-tune -yes -memory "$ram_for_tsdb"MB
|
|||||||
$STD systemctl restart postgresql
|
$STD systemctl restart postgresql
|
||||||
msg_ok "Installed TimescaleDB"
|
msg_ok "Installed TimescaleDB"
|
||||||
|
|
||||||
PG_DB_NAME="tracearr_db" PG_DB_USER="tracearr" PG_DB_EXTENSIONS="timescaledb,timescaledb_toolkit" setup_postgresql_db
|
PG_DB_NAME="tracearr_db" PG_DB_USER="tracearr" PG_DB_EXTENSIONS="timescaledb,timescaledb_toolkit" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db
|
||||||
|
|
||||||
|
msg_info "Installing tailscale"
|
||||||
|
setup_deb822_repo \
|
||||||
|
"tailscale" \
|
||||||
|
"https://pkgs.tailscale.com/stable/$(get_os_info id)/$(get_os_info codename).noarmor.gpg" \
|
||||||
|
"https://pkgs.tailscale.com/stable/$(get_os_info id)/" \
|
||||||
|
"$(get_os_info codename)"
|
||||||
|
$STD apt install -y tailscale
|
||||||
|
# Tracearr runs tailscaled in user mode, disable the service.
|
||||||
|
$STD systemctl disable --now tailscaled
|
||||||
|
$STD systemctl stop tailscaled
|
||||||
|
msg_ok "Installed tailscale"
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "tracearr" "connorgallopo/Tracearr" "tarball" "latest" "/opt/tracearr.build"
|
fetch_and_deploy_gh_release "tracearr" "connorgallopo/Tracearr" "tarball" "latest" "/opt/tracearr.build"
|
||||||
|
|
||||||
msg_info "Building Tracearr"
|
msg_info "Building Tracearr"
|
||||||
@@ -75,6 +88,7 @@ msg_info "Configuring Tracearr"
|
|||||||
$STD useradd -r -s /bin/false -U tracearr
|
$STD useradd -r -s /bin/false -U tracearr
|
||||||
$STD chown -R tracearr:tracearr /opt/tracearr
|
$STD chown -R tracearr:tracearr /opt/tracearr
|
||||||
install -d -m 750 -o tracearr -g tracearr /data/tracearr
|
install -d -m 750 -o tracearr -g tracearr /data/tracearr
|
||||||
|
install -d -m 750 -o tracearr -g tracearr /data/backup
|
||||||
export JWT_SECRET=$(openssl rand -hex 32)
|
export JWT_SECRET=$(openssl rand -hex 32)
|
||||||
export COOKIE_SECRET=$(openssl rand -hex 32)
|
export COOKIE_SECRET=$(openssl rand -hex 32)
|
||||||
cat <<EOF >/data/tracearr/.env
|
cat <<EOF >/data/tracearr/.env
|
||||||
@@ -89,7 +103,6 @@ JWT_SECRET=$JWT_SECRET
|
|||||||
COOKIE_SECRET=$COOKIE_SECRET
|
COOKIE_SECRET=$COOKIE_SECRET
|
||||||
APP_VERSION=$(cat /root/.tracearr)
|
APP_VERSION=$(cat /root/.tracearr)
|
||||||
#CORS_ORIGIN=http://localhost:5173
|
#CORS_ORIGIN=http://localhost:5173
|
||||||
#MOBILE_BETA_MODE=true
|
|
||||||
EOF
|
EOF
|
||||||
chmod 600 /data/tracearr/.env
|
chmod 600 /data/tracearr/.env
|
||||||
chown -R tracearr:tracearr /data/tracearr
|
chown -R tracearr:tracearr /data/tracearr
|
||||||
@@ -140,6 +153,7 @@ if [ -f \$pg_config_file ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
systemctl restart postgresql
|
systemctl restart postgresql
|
||||||
|
sudo -u postgres psql -c "ALTER USER tracearr WITH SUPERUSER;"
|
||||||
EOF
|
EOF
|
||||||
chmod +x /data/tracearr/prestart.sh
|
chmod +x /data/tracearr/prestart.sh
|
||||||
cat <<EOF >/lib/systemd/system/tracearr.service
|
cat <<EOF >/lib/systemd/system/tracearr.service
|
||||||
|
|||||||
Reference in New Issue
Block a user