Update docspell-install.sh

This commit is contained in:
CanbiZ 2025-04-14 15:33:36 +02:00
parent deb8b15697
commit 6c38762e59

View File

@ -15,25 +15,19 @@ update_os
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y \ $STD apt-get install -y \
unzip \ htop \
htop \ gnupg2 \
gnupg2 \ ca-certificates \
ca-certificates \ default-jdk \
default-jdk \ apt-transport-https \
apt-transport-https \ ghostscript \
ghostscript \ tesseract-ocr \
tesseract-ocr \ tesseract-ocr-deu \
tesseract-ocr-deu \ tesseract-ocr-eng \
tesseract-ocr-eng \ unpaper \
unpaper \ unoconv \
unoconv \ wkhtmltopdf \
wkhtmltopdf \ ocrmypdf
ocrmypdf \
zip \
curl \
sudo \
make \
mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setting up PostgreSQL Repository" msg_info "Setting up PostgreSQL Repository"
@ -53,10 +47,10 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8'
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
{ {
echo "Docspell-Credentials" echo "Docspell-Credentials"
echo "Docspell Database Name: $DB_NAME" echo "Docspell Database Name: $DB_NAME"
echo "Docspell Database User: $DB_USER" echo "Docspell Database User: $DB_USER"
echo "Docspell Database Password: $DB_PASS" echo "Docspell Database Password: $DB_PASS"
} >>~/docspell.creds } >>~/docspell.creds
msg_ok "Set up PostgreSQL Database" msg_ok "Set up PostgreSQL Database"
@ -65,10 +59,10 @@ mkdir -p /opt/docspell
Docspell=$(curl -fsSL https://github.com/eikek/docspell/releases/latest -o - | grep "title>Release" | cut -d " " -f 5) 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//') DocspellDSC=$(curl -fsSL https://github.com/docspell/dsc/releases/latest -o - | grep "title>Release" | cut -d " " -f 4 | sed 's/^v//')
cd /opt cd /opt
curl -fsSL https://github.com/eikek/docspell/releases/download/v${Docspell}/docspell-joex_${Docspell}_all.deb 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 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 $STD dpkg -i docspell-*.deb
curl -fsSL https://github.com/docspell/dsc/releases/download/v${DocspellDSC}/dsc_amd64-musl-${DocspellDSC} curl -fsSL https://github.com/docspell/dsc/releases/download/v${DocspellDSC}/dsc_amd64-musl-${DocspellDSC} -o dsc_amd64-musl-${DocspellDSC}
mv dsc_amd* dsc mv dsc_amd* dsc
chmod +x dsc chmod +x dsc
mv dsc /usr/bin mv dsc /usr/bin
@ -102,9 +96,9 @@ msg_ok "Setup Docspell"
msg_info "Setup Apache Solr" msg_info "Setup Apache Solr"
cd /opt/docspell cd /opt/docspell
SOLR_DOWNLOAD_URL="https://downloads.apache.org/lucene/solr/" SOLR_DOWNLOAD_URL="https://downloads.apache.org/lucene/solr/"
latest_version=$(curl -s "$SOLR_DOWNLOAD_URL" | grep -oP '(?<=<a href=")[^"]+(?=/">[0-9])' | head -n 1) latest_version=$(curl -fsSL "$SOLR_DOWNLOAD_URL" | grep -oP '(?<=<a href=")[^"]+(?=/">[0-9])' | head -n 1)
download_url="${SOLR_DOWNLOAD_URL}${latest_version}/solr-${latest_version}.tgz" download_url="${SOLR_DOWNLOAD_URL}${latest_version}/solr-${latest_version}.tgz"
curl -fsSL "$download_url" curl -fsSL "$download_url" -o "solr-$latest_version.tgz"
tar xzf "solr-$latest_version.tgz" tar xzf "solr-$latest_version.tgz"
$STD bash "/opt/docspell/solr-$latest_version/bin/install_solr_service.sh" "solr-$latest_version.tgz" $STD bash "/opt/docspell/solr-$latest_version/bin/install_solr_service.sh" "solr-$latest_version.tgz"
mv /opt/solr /opt/docspell/solr mv /opt/solr /opt/docspell/solr