From 715bd48f9f7a2aed3fe8d7477369d031971a4b5c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 21 Jul 2025 09:27:23 +0200 Subject: [PATCH] docspell --- ct/docspell.sh | 2 +- install/docspell-install.sh | 60 +++++++++---------------------------- 2 files changed, 15 insertions(+), 47 deletions(-) diff --git a/ct/docspell.sh b/ct/docspell.sh index 7fcdc014..3ff1cd3b 100644 --- a/ct/docspell.sh +++ b/ct/docspell.sh @@ -3,7 +3,7 @@ source <(curl -s https://git.community-scripts.org/community-scripts/ProxmoxVED/ # Copyright (c) 2021-2025 community-scripts ORG # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: +# Source: https://github.com/community-scripts/ProxmoxVE APP="Docspell" var_tags="${var_tags:-document}" diff --git a/install/docspell-install.sh b/install/docspell-install.sh index b9bb74ad..14d908fc 100644 --- a/install/docspell-install.sh +++ b/install/docspell-install.sh @@ -20,11 +20,8 @@ msg_ok "Setup Functions" msg_info "Installing Dependencies (Patience)" $STD apt-get install -y \ htop \ - gnupg2 \ ca-certificates \ - default-jdk \ apt-transport-https \ - ghostscript \ tesseract-ocr \ tesseract-ocr-deu \ tesseract-ocr-eng \ @@ -34,13 +31,13 @@ $STD apt-get install -y \ ocrmypdf msg_ok "Installed Dependencies" -msg_info "Setting up PostgreSQL Repository" -curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg -echo "deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" >/etc/apt/sources.list.d/pgdg.list -$STD apt-get update -msg_ok "Set up PostgreSQL Repository" -msg_info "Install/Set up PostgreSQL Database" +setup_gs +JAVA_VERSION="21" setup_java +POSTGRES_VERSION="16" setup_postgres +setup_yq + +msg_info "Set up PostgreSQL Database" $STD apt-get install -y postgresql-16 DB_NAME=docspell_db DB_USER=docspell_usr @@ -58,23 +55,15 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" } >>~/docspell.creds msg_ok "Set up PostgreSQL Database" -msg_info "Setup Docspell (Patience)" -mkdir -p /opt/docspell -Docspell=$(curl -fsSL https://github.com/eikek/docspell/releases/latest -o - | grep "title>Release" | cut -d " " -f 5) -DocspellDSC=$(curl -fsSL https://github.com/docspell/dsc/releases/latest -o - | grep "title>Release" | cut -d " " -f 4 | sed 's/^v//') -cd /opt -curl -fsSL https://github.com/eikek/docspell/releases/download/v${Docspell}/docspell-joex_${Docspell}_all.deb -o docspell-joex_${Docspell}_all.deb -curl -fsSL https://github.com/eikek/docspell/releases/download/v${Docspell}/docspell-restserver_${Docspell}_all.deb -o docspell-restserver_${Docspell}_all.deb -$STD dpkg -i docspell-*.deb -curl -fsSL https://github.com/docspell/dsc/releases/download/v${DocspellDSC}/dsc_amd64-musl-${DocspellDSC} -o dsc_amd64-musl-${DocspellDSC} -mv dsc_amd* dsc -chmod +x dsc -mv dsc /usr/bin + +fetch_and_deploy_gh_release "docspell-joex" "eikek/docspell" "binary" "latest" "/opt/docspell-joex" "docspell-joex_*all.deb" +fetch_and_deploy_gh_release "docspell-restserver" "eikek/docspell" "binary" "latest" "/opt/docspell-restserver" "docspell-restserver_*all.deb" +fetch_and_deploy_gh_release "docspell-dsc" "docspell/dsc" "singlefile" "latest" "/usr/bin" "dsc" + + + +msg_info "Setup Docspell" ln -s /etc/docspell-joex /opt/docspell/docspell-joex && ln -s /etc/docspell-restserver /opt/docspell/docspell-restserver && ln -s /usr/bin/dsc /opt/docspell/dsc -curl -fsSL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq -chmod +x /usr/bin/yq -#JOEX_CONF="/usr/share/docspell-joex/conf/docspell-joex.conf" -#SERVER_CONF="/usr/share/docspell-restserver/conf/docspell-server.conf" sed -i \ -e '11s|localhost|'"$LOCAL_IP"'|' \ -e '17s|localhost|'"$LOCAL_IP"'|' \ @@ -94,27 +83,6 @@ sed -i \ -e '358s|password = .*|password = "'"$DB_PASS"'"|' \ -e '401s|url = .*|url = "jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|' \ /usr/share/docspell-restserver/conf/docspell-server.conf - -# sed -i 's|address = "localhost"|address = "0.0.0.0"|' "$JOEX_CONF" "$SERVER_CONF" -# sed -i -E '/backend\s*\{/,/\}/ { -# /jdbc\s*\{/,/\}/ { -# s|(url\s*=\s*).*|\1"jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|; -# s|(user\s*=\s*).*|\1"'"$DB_USER"'"|; -# s|(password\s*=\s*).*|\1"'"$DB_PASS"'"|; -# } -# }' "$SERVER_CONF" -# sed -i -E '/postgresql\s*\{/,/\}/ { -# /jdbc\s*\{/,/\}/ { -# s|(url\s*=\s*).*|\1"jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|; -# s|(user\s*=\s*).*|\1"'"$DB_USER"'"|; -# s|(password\s*=\s*).*|\1"'"$DB_PASS"'"|; -# } -# }' "$SERVER_CONF" -# sed -i -E '/jdbc\s*\{/,/\}/ { -# s|(url\s*=\s*).*|\1"jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|; -# s|(user\s*=\s*).*|\1"'"$DB_USER"'"|; -# s|(password\s*=\s*).*|\1"'"$DB_PASS"'"|; -# }' "$JOEX_CONF" msg_ok "Setup Docspell" msg_info "Setup Apache Solr"