diff --git a/ct/headers/papra b/ct/headers/papra new file mode 100644 index 000000000..c05106056 --- /dev/null +++ b/ct/headers/papra @@ -0,0 +1,6 @@ + ____ + / __ \____ _____ _________ _ + / /_/ / __ `/ __ \/ ___/ __ `/ + / ____/ /_/ / /_/ / / / /_/ / +/_/ \__,_/ .___/_/ \__,_/ + /_/ diff --git a/ct/papra.sh b/ct/papra.sh new file mode 100644 index 000000000..8c8a0c384 --- /dev/null +++ b/ct/papra.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/papra-hq/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 + RELEASE=$(curl -fsSL https://api.github.com/repos/papra-hq/papra/releases | grep -oP '"tag_name":\s*"\K@papra/app@[^"]+' | head -n1) + if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + msg_info "Stopping Service" + systemctl stop papra + msg_ok "Stopped Service" + + msg_info "Updating ${APP} to ${RELEASE}" + cd /opt/papra + fetch_and_deploy_gh_release "papra" "papra-hq/papra" "tarball" "${RELEASE}" "/opt/papra" + $STD pnpm install --frozen-lockfile + $STD pnpm --filter "@papra/app-client..." run build + $STD pnpm --filter "@papra/app-server..." run build + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Updated ${APP} to ${RELEASE}" + + msg_info "Starting Service" + systemctl start papra + msg_ok "Started Service" + msg_ok "Updated successfully!" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + exit +} + +start +build_container +description + +msg_ok "Completed successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:1221${CL}" diff --git a/frontend/public/json/papra.json b/frontend/public/json/papra.json new file mode 100644 index 000000000..f3f613b2a --- /dev/null +++ b/frontend/public/json/papra.json @@ -0,0 +1,56 @@ +{ + "name": "Papra", + "slug": "papra", + "categories": [ + 12 + ], + "date_created": "2025-12-30", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 1221, + "documentation": "https://github.com/CorentinTh/papra", + "website": "https://github.com/CorentinTh/papra", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/papra.webp", + "config_path": "/opt/papra/.env", + "description": "Papra is a modern, self-hosted document management system with full-text search, OCR support, and automatic document processing. Built with Node.js and featuring a clean web interface for organizing and managing your documents.", + "install_methods": [ + { + "type": "default", + "script": "ct/papra.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 10, + "os": "debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "First visit will prompt you to create an account", + "type": "info" + }, + { + "text": "Tesseract OCR is pre-installed for all languages", + "type": "info" + }, + { + "text": "Documents are stored in /opt/papra/app-data/documents", + "type": "info" + }, + { + "text": "Ingestion folder available at /opt/papra/ingestion for automatic document import", + "type": "info" + }, + { + "text": "Email functionality runs in dry-run mode by default", + "type": "warning" + } + ] +} diff --git a/install/papra-install.sh b/install/papra-install.sh new file mode 100644 index 000000000..56e5007b6 --- /dev/null +++ b/install/papra-install.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/papra-hq/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-get install -y \ + build-essential \ + tesseract-ocr \ + tesseract-ocr-all +msg_ok "Installed Dependencies" + +RELEASE=$(curl -fsSL https://api.github.com/repos/papra-hq/papra/releases | grep -oP '"tag_name":\s*"\K@papra/app@[^"]+' | head -n1) +fetch_and_deploy_gh_release "papra" "papra-hq/papra" "tarball" "${RELEASE}" "/opt/papra" + +pnpm_version=$(grep -oP '"packageManager":\s*"pnpm@\K[^"]+' /opt/papra/package.json) +NODE_VERSION="24" NODE_MODULE="pnpm@$pnpm_version" setup_nodejs + +msg_info "Installing Papra (Patience)" +cd /opt/papra +$STD pnpm install --frozen-lockfile +$STD pnpm --filter "@papra/app-client..." run build +$STD pnpm --filter "@papra/app-server..." run build +ln -sf /opt/papra/apps/papra-client/dist /opt/papra/apps/papra-server/public +msg_ok "Installed Papra" + +msg_info "Configuring Papra" +mkdir -p /opt/papra_data/{db,documents,ingestion} +[[ ! -f /opt/papra_data/.secret ]] && openssl rand -hex 32 >/opt/papra_data/.secret +cat </opt/papra/apps/papra-server/.env +NODE_ENV=production +SERVER_SERVE_PUBLIC_DIR=true +PORT=1221 +DATABASE_URL=file:/opt/papra_data/db/db.sqlite +DOCUMENT_STORAGE_FILESYSTEM_ROOT=/opt/papra_data/documents +PAPRA_CONFIG_DIR=/opt/papra_data +AUTH_SECRET=$(cat /opt/papra_data/.secret) +BETTER_AUTH_SECRET=$(cat /opt/papra_data/.secret) +BETTER_AUTH_TELEMETRY=0 +CLIENT_BASE_URL=http://${LOCAL_IP}:1221 +SERVER_BASE_URL=http://${LOCAL_IP}:1221 +EMAILS_DRY_RUN=true +INGESTION_FOLDER_IS_ENABLED=true +INGESTION_FOLDER_ROOT_PATH=/opt/papra_data/ingestion +EOF +msg_ok "Configured Papra" + +msg_info "Creating Service" +cat </etc/systemd/system/papra.service +[Unit] +Description=Papra Document Management +After=network.target + +[Service] +Type=simple +WorkingDirectory=/opt/papra/apps/papra-server +EnvironmentFile=/opt/papra/apps/papra-server/.env +ExecStartPre=/usr/bin/pnpm run migrate:up +ExecStart=/usr/bin/node dist/index.js + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now papra +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc