Compare commits

..

2 Commits

Author SHA1 Message Date
Tobias fa2e1b5e8a Fix source command in docspell.sh 2026-07-26 18:49:15 +02:00
push-app-to-main[bot] a4a4b40eaf Add docspell (ct) 2026-07-26 11:14:10 +00:00
4 changed files with 177 additions and 18 deletions
+61
View File
@@ -0,0 +1,61 @@
#!/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://docspell.org/
APP="Docspell"
var_tags="${var_tags:-documents;ocr;paperless;productivity}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-16}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/docspell-restserver/docspell-server.conf ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "docspell-joex" "eikek/docspell"; then
msg_info "Stopping Services"
systemctl stop docspell-joex docspell-restserver
msg_ok "Stopped Services"
create_backup /etc/docspell-joex/docspell-joex.conf \
/etc/docspell-restserver/docspell-server.conf
DPKG_FORCE_CONFOLD=1 fetch_and_deploy_gh_release "docspell-joex" "eikek/docspell" "binary" "latest" "/opt/docspell" "docspell-joex_*_all.deb"
DPKG_FORCE_CONFOLD=1 fetch_and_deploy_gh_release "docspell-restserver" "eikek/docspell" "binary" "latest" "/opt/docspell" "docspell-restserver_*_all.deb"
restore_backup
msg_info "Starting Services"
systemctl start docspell-restserver docspell-joex
msg_ok "Started Services"
msg_ok "Updated successfully!"
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 "${GATEWAY}${BGN}http://${IP}:7880${CL}"
+6
View File
@@ -0,0 +1,6 @@
____ ____
/ __ \____ ______________ ___ / / /
/ / / / __ \/ ___/ ___/ __ \/ _ \/ / /
/ /_/ / /_/ / /__(__ ) /_/ / __/ / /
/_____/\____/\___/____/ .___/\___/_/_/
/_/
+108
View File
@@ -0,0 +1,108 @@
#!/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://docspell.org/
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 \
ocrmypdf \
tesseract-ocr \
tesseract-ocr-deu \
tesseract-ocr-eng \
unpaper \
weasyprint \
libreoffice-core \
ghostscript \
libreoffice-writer \
libreoffice-calc \
python3-pip \
python3-uno \
python3-venv
python3 -m venv \
--system-site-packages \
/opt/unoserver
$STD /opt/unoserver/bin/pip install --upgrade pip
$STD /opt/unoserver/bin/pip install unoserver
msg_ok "Installed Dependencies"
JAVA_VERSION="21" setup_java
PG_VERSION="17" setup_postgresql
PG_DB_NAME="docspell" PG_DB_USER="docspell" setup_postgresql_db
fetch_and_deploy_gh_release "docspell-joex" "eikek/docspell" "binary" "latest" "/opt/docspell" "docspell-joex_*_all.deb"
fetch_and_deploy_gh_release "docspell-restserver" "eikek/docspell" "binary" "latest" "/opt/docspell" "docspell-restserver_*_all.deb"
msg_info "Configuring Docspell"
DOCSPELL_SECRET=$(openssl rand -hex 32)
DOCSPELL_ADMIN_SECRET=$(openssl rand -hex 32)
cat <<EOF >/etc/docspell-restserver/docspell-server.conf
docspell.server {
app-id = "rest1"
base-url = "http://${LOCAL_IP}:7880"
internal-url = "http://127.0.0.1:7880"
bind {
address = "0.0.0.0"
port = 7880
}
auth.server-secret = "hex:${DOCSPELL_SECRET}"
admin-endpoint.secret = "${DOCSPELL_ADMIN_SECRET}"
full-text-search {
enabled = true
backend = "postgresql"
postgresql.use-default-connection = true
}
backend {
jdbc {
url = "jdbc:postgresql://127.0.0.1:5432/${PG_DB_NAME}"
user = "${PG_DB_USER}"
password = "${PG_DB_PASS}"
}
signup.mode = "open"
}
}
EOF
cat <<EOF >/etc/docspell-joex/docspell-joex.conf
docspell.joex {
app-id = "joex1"
base-url = "http://127.0.0.1:7878"
bind {
address = "127.0.0.1"
port = 7878
}
jdbc {
url = "jdbc:postgresql://127.0.0.1:5432/${PG_DB_NAME}"
user = "${PG_DB_USER}"
password = "${PG_DB_PASS}"
}
full-text-search {
enabled = true
backend = "postgresql"
postgresql.use-default-connection = true
}
scheduler.pool-size = 1
text-analysis.nlp.mode = "basic"
}
EOF
chown root:docspell /etc/docspell-joex/docspell-joex.conf /etc/docspell-restserver/docspell-server.conf
chmod 640 /etc/docspell-joex/docspell-joex.conf /etc/docspell-restserver/docspell-server.conf
msg_ok "Configured Docspell"
msg_info "Creating Services"
systemctl enable -q --now docspell-restserver docspell-joex
msg_ok "Created Services"
motd_ssh
customize
cleanup_lxc
+2 -18
View File
@@ -3858,13 +3858,6 @@ check_container_os_guard() {
return 0
fi
local downgraded_target=0
if [[ "$cur_os" == "$rec_os" ]] && [[ "$cur_ver" != "$rec_ver" ]]; then
if [[ "$(printf '%s\n%s\n' "$cur_ver" "$rec_ver" | sort -V | tail -n1)" == "$cur_ver" ]]; then
downgraded_target=1
fi
fi
case "${var_ignore_os_mismatch:-}" in
1 | yes | true | on)
msg_warn "Container OS is ${cur_os} ${cur_ver} but the script recommends ${rec_os} ${rec_ver} — continuing via var_ignore_os_mismatch (may break, no support)."
@@ -3880,19 +3873,10 @@ check_container_os_guard() {
return 0
fi
local mismatch_detail remediation
if [[ "$downgraded_target" -eq 1 ]]; then
mismatch_detail="Your container runs ${cur_os} ${cur_ver}, which is newer than what this script now targets (${rec_os} ${rec_ver}).\n\nThe target was likely lowered on purpose, e.g. because ${APP:-the app} had problems on newer OS versions - check the GitHub issues for ${APP:-this app} for details.\n\nContinuing on ${cur_ver} often still works, but isn't guaranteed. If you are unsure, ask in our Discord (https://discord.gg/3AnUqsXnmK) before continuing."
remediation="This script now targets the older ${rec_os} ${rec_ver}. Check the GitHub issues for ${APP:-this app}, or ask in Discord (https://discord.gg/3AnUqsXnmK) if you are unsure"
else
mismatch_detail="This container runs ${cur_os} ${cur_ver}, but this script now targets ${rec_os} ${rec_ver}.\n\nUpdating on the older base OS may fail or leave ${APP:-the application} broken (e.g. required runtime versions are not available).\n\nRecommended: upgrade the container OS to ${rec_os} ${rec_ver} first, then run this update again."
remediation="Upgrade the container OS to ${rec_os} ${rec_ver} first, then run this update again"
fi
if [[ "${PHS_SILENT:-0}" != "1" ]] && command -v whiptail &>/dev/null && [ -t 0 ] && [[ "$TERM" != "dumb" ]]; then
local choice
choice=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "OS VERSION MISMATCH" --menu \
"${mismatch_detail}\n\nIf you continue anyway, it may break — no support is provided in that case.\n\nContinue anyway?" \
"This container runs ${cur_os} ${cur_ver}, but this script now targets ${rec_os} ${rec_ver}.\n\nUpdating on the older base OS may fail or leave ${APP:-the application} broken (e.g. required runtime versions are not available).\n\nRecommended: upgrade the container OS to ${rec_os} ${rec_ver} first, then run this update again.\n\nIf you continue anyway, it may break — no support is provided in that case.\n\nContinue anyway?" \
20 70 3 \
"1" "No (cancel update)" \
"2" "Yes (continue this time)" \
@@ -3915,7 +3899,7 @@ check_container_os_guard() {
fi
msg_error "Container OS ${cur_os} ${cur_ver} does not match the recommended ${rec_os} ${rec_ver} — skipping update."
msg_error "${remediation} — or bypass this check (may break, no support) with: echo \"${rec_os} ${rec_ver}\" > ${ignore_file}"
msg_error "Upgrade the container OS to ${rec_os} ${rec_ver} first, then run this update again — or bypass this check (may break, no support) with: echo \"${rec_os} ${rec_ver}\" > ${ignore_file}"
return 1
}