mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-21 16:29:27 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cf265ea86 |
No files matched your search
+22
-5
@@ -4,7 +4,7 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: nnsense
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/kieraneglin/pinchflat
|
||||
# Source: https://github.com/TheBadFella/Pinchflat-NGX
|
||||
|
||||
APP="Pinchflat"
|
||||
var_tags="${var_tags:-media;youtube;downloader}"
|
||||
@@ -32,17 +32,27 @@ function update_script() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if check_for_gh_release "pinchflat" "kieraneglin/pinchflat"; then
|
||||
if check_for_gh_release "pinchflat" "TheBadFella/Pinchflat-NGX"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop pinchflat
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "pinchflat" "kieraneglin/pinchflat" "tarball" "latest" "/opt/pinchflat-src"
|
||||
if [[ ! -f /opt/pinchflat-src/lib/pinchflat/legacy_migration.ex && ! -f /opt/pinchflat-pre-ngx.tar.gz ]]; then
|
||||
NGX_SWITCH=1
|
||||
msg_info "Backing up Pinchflat before the switch to Pinchflat-NGX"
|
||||
tar -czf /opt/pinchflat-pre-ngx.tar.gz.part -C /opt/pinchflat --exclude=config/metadata --exclude=config/logs .env app config
|
||||
mv /opt/pinchflat-pre-ngx.tar.gz.part /opt/pinchflat-pre-ngx.tar.gz
|
||||
msg_ok "Backed up to /opt/pinchflat-pre-ngx.tar.gz"
|
||||
fi
|
||||
|
||||
msg_info "Building Pinchflat"
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "pinchflat" "TheBadFella/Pinchflat-NGX" "tarball" "latest" "/opt/pinchflat-src"
|
||||
|
||||
msg_info "Building Pinchflat-NGX"
|
||||
cd /opt/pinchflat-src
|
||||
export MIX_ENV=prod
|
||||
export ERL_FLAGS="+JPperf true"
|
||||
$STD mix local.hex --force
|
||||
$STD mix local.rebar --force
|
||||
$STD mix deps.get --only prod
|
||||
$STD mix deps.compile
|
||||
$STD yarn --cwd assets install
|
||||
@@ -51,11 +61,18 @@ function update_script() {
|
||||
$STD mix release --overwrite
|
||||
rm -rf /opt/pinchflat/app
|
||||
cp -r _build/prod/rel/pinchflat /opt/pinchflat/app
|
||||
msg_ok "Built Pinchflat"
|
||||
msg_ok "Built Pinchflat-NGX"
|
||||
|
||||
msg_info "Migrating Database"
|
||||
$STD systemd-run --wait --pipe --quiet --collect -p EnvironmentFile=/opt/pinchflat/.env -p WorkingDirectory=/opt/pinchflat/app /opt/pinchflat/app/bin/migrate
|
||||
msg_ok "Migrated Database"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start pinchflat
|
||||
msg_ok "Started Service"
|
||||
if [[ -n "${NGX_SWITCH:-}" ]]; then
|
||||
msg_warn "Open the web UI and confirm the migration review, downloads stay on hold until then"
|
||||
fi
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: nnsense
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/kieraneglin/pinchflat
|
||||
# Source: https://github.com/TheBadFella/Pinchflat-NGX
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
|
||||
@@ -48,7 +48,7 @@ export PIPX_BIN_DIR=/usr/local/bin
|
||||
$STD pipx install apprise
|
||||
msg_ok "Installed Apprise"
|
||||
|
||||
fetch_and_deploy_gh_release "pinchflat" "kieraneglin/pinchflat" "tarball" "latest" "/opt/pinchflat-src"
|
||||
fetch_and_deploy_gh_release "pinchflat" "TheBadFella/Pinchflat-NGX" "tarball" "latest" "/opt/pinchflat-src"
|
||||
|
||||
msg_info "Configuring Pinchflat"
|
||||
CONFIG_PATH="/opt/pinchflat/config"
|
||||
@@ -81,7 +81,7 @@ SECRET_KEY_BASE=$(openssl rand -base64 48)
|
||||
EOF
|
||||
msg_ok "Configured Pinchflat"
|
||||
|
||||
msg_info "Building Pinchflat"
|
||||
msg_info "Building Pinchflat-NGX"
|
||||
cd /opt/pinchflat-src
|
||||
export MIX_ENV=prod
|
||||
export ERL_FLAGS="+JPperf true"
|
||||
@@ -95,7 +95,7 @@ $STD mix compile
|
||||
$STD mix release --overwrite
|
||||
rm -rf /opt/pinchflat/app
|
||||
cp -r _build/prod/rel/pinchflat /opt/pinchflat/app
|
||||
msg_ok "Built Pinchflat"
|
||||
msg_ok "Built Pinchflat-NGX"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/pinchflat.service
|
||||
|
||||
Reference in new issue
Block a user