fix(papra): finalize install script

- Add AUTH_SECRET env var (required by app)
- Link client dist to server public dir for frontend
- Keep BETTER_AUTH_SECRET for compatibility
This commit is contained in:
CanbiZ (MickLesk) 2026-01-21 16:59:20 +01:00
parent 7867b62647
commit d24d9769cb

View File

@ -37,11 +37,14 @@ msg_ok "Set up Papra"
msg_info "Configuring Papra" msg_info "Configuring Papra"
CONTAINER_IP=$(hostname -I | awk '{print $1}') CONTAINER_IP=$(hostname -I | awk '{print $1}')
BETTER_AUTH_SECRET=$(openssl rand -hex 32) AUTH_SECRET=$(openssl rand -hex 32)
mkdir -p /opt/papra/app-data/db mkdir -p /opt/papra/app-data/db
mkdir -p /opt/papra/app-data/documents mkdir -p /opt/papra/app-data/documents
# Link client build to server public dir
ln -sf /opt/papra/apps/papra-client/dist /opt/papra/apps/papra-server/public
cat >/opt/papra/.env <<EOF cat >/opt/papra/.env <<EOF
NODE_ENV=production NODE_ENV=production
SERVER_SERVE_PUBLIC_DIR=true SERVER_SERVE_PUBLIC_DIR=true
@ -55,7 +58,8 @@ DOCUMENT_STORAGE_FILESYSTEM_ROOT=./app-data/documents
PAPRA_CONFIG_DIR=./app-data PAPRA_CONFIG_DIR=./app-data
# Authentication # Authentication
BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET} AUTH_SECRET=${AUTH_SECRET}
BETTER_AUTH_SECRET=${AUTH_SECRET}
BETTER_AUTH_TELEMETRY=0 BETTER_AUTH_TELEMETRY=0
# Application Configuration # Application Configuration
@ -93,13 +97,9 @@ RestartSec=10
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q papra systemctl enable -q --now papra
if ! systemctl start papra; then
msg_warn "Service failed to start, checking logs..."
journalctl -u papra --no-pager -n 20 || true
fi
echo "${RELEASE}" >/opt/Papra_version.txt echo "${RELEASE}" >/opt/Papra_version.txt
msg_ok "Created Papra Service" msg_ok "Created and Started Papra Service"
motd_ssh motd_ssh
customize customize