From ce7ae6fb4e766bbb36fcffd2e8caa4e2af3018fb Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 30 Dec 2025 14:20:12 +0100 Subject: [PATCH] papra --- ct/papra.sh | 48 ++++++++++++++++++ install/papra-install.sh | 104 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 ct/papra.sh create mode 100644 install/papra-install.sh diff --git a/ct/papra.sh b/ct/papra.sh new file mode 100644 index 000000000..c872bb0cb --- /dev/null +++ b/ct/papra.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/CorentinTh/papra + +APP="Papra" +var_tags="${var_tags:-document-management}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-10}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/papra ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating $APP LXC" + systemctl stop papra + cd /opt/papra + git fetch + git pull + $STD pnpm install --frozen-lockfile + $STD pnpm --filter "@papra/app-client..." run build + $STD pnpm --filter "@papra/app-server..." run build + systemctl start papra + msg_ok "Updated $APP LXC" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!" +msg_custom "🚀" "${GN}" "${APP} setup has been successfully initialized!" diff --git a/install/papra-install.sh b/install/papra-install.sh new file mode 100644 index 000000000..335563145 --- /dev/null +++ b/install/papra-install.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/CorentinTh/papra + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + git \ + build-essential \ + tesseract-ocr \ + tesseract-ocr-all +msg_ok "Installed Dependencies" + +NODE_VERSION="24" setup_nodejs + +msg_info "Cloning Papra Repository" +cd /opt +RELEASE=$(curl -s https://api.github.com/repos/CorentinTh/papra/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') +$STD git clone --depth=1 --branch ${RELEASE} https://github.com/CorentinTh/papra.git +cd papra +msg_ok "Cloned Papra Repository" + +msg_info "Setup Papra" +export COREPACK_ENABLE_NETWORK=1 +$STD corepack enable +$STD corepack prepare pnpm@10.19.0 --activate +$STD pnpm install --frozen-lockfile --ignore-scripts +$STD pnpm --filter "@papra/app-client..." run build +$STD pnpm --filter "@papra/app-server..." run build +msg_ok "Set up Papra" + +msg_info "Configuring Papra" +CONTAINER_IP=$(hostname -I | awk '{print $1}') +BETTER_AUTH_SECRET=$(openssl rand -hex 32) + +mkdir -p /opt/papra/app-data/db +mkdir -p /opt/papra/app-data/documents + +cat >/opt/papra/.env </etc/systemd/system/papra.service <