PocketID: Update PocketID for 2.x (#10506)

* Update PocketID for 2.x

* Update env var
This commit is contained in:
Slaviša Arežina
2026-01-04 23:07:44 +01:00
committed by GitHub
parent eeb4c0a860
commit 5f67c385b8
2 changed files with 9 additions and 0 deletions

View File

@@ -29,6 +29,12 @@ function update_script() {
exit
fi
# Mandatory as of v2.x.x
ENCRYPTION_KEY=$(openssl rand -base64 32)
if ! grep -q '^ENCRYPTION_KEY=' /opt/pocket-id/.env; then
echo "ENCRYPTION_KEY=$ENCRYPTION_KEY" >> /opt/pocket-id/.env
fi
if check_for_gh_release "pocket-id" "pocket-id/pocket-id"; then
if [ "$(printf '%s\n%s' "$(cat ~/.pocket-id 2>/dev/null || echo 0.0.0)" "1.0.0" | sort -V | head -n1)" = "$(cat ~/.pocket-id 2>/dev/null || echo 0.0.0)" ] &&
[ "$(cat ~/.pocket-id 2>/dev/null || echo 0.0.0)" != "1.0.0" ]; then

View File

@@ -17,6 +17,8 @@ read -r -p "${TAB3}What public URL do you want to use (e.g. pocketid.mydomain.co
fetch_and_deploy_gh_release "pocket-id" "pocket-id/pocket-id" "singlefile" "latest" "/opt/pocket-id/" "pocket-id-linux-amd64"
msg_info "Configuring Pocket ID"
ENCRYPTION_KEY=$(openssl rand -base64 32)
cat <<EOF >/opt/pocket-id/.env
APP_ENV=production
APP_URL=https://${public_url}
@@ -24,6 +26,7 @@ TRUST_PROXY=false
# MAXMIND_LICENSE_KEY=
PORT=1411
HOST=0.0.0.0
ENCRYPTION_KEY=${ENCRYPTION_KEY}
EOF
msg_ok "Configured Pocket ID"