Update docspell-install.sh

This commit is contained in:
CanbiZ 2025-04-14 16:08:13 +02:00
parent f2a3e35978
commit 46d2eaacc6

View File

@ -12,6 +12,11 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Setup Functions"
setup_local_ip_helper
import_local_ip
msg_ok "Setup Functions"
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y \ $STD apt-get install -y \
htop \ htop \
@ -68,28 +73,48 @@ mv dsc /usr/bin
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 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 curl -fsSL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq
chmod +x /usr/bin/yq chmod +x /usr/bin/yq
JOEX_CONF="/usr/share/docspell-joex/conf/docspell-joex.conf" #JOEX_CONF="/usr/share/docspell-joex/conf/docspell-joex.conf"
SERVER_CONF="/usr/share/docspell-restserver/conf/docspell-server.conf" #SERVER_CONF="/usr/share/docspell-restserver/conf/docspell-server.conf"
sed -i 's|address = "localhost"|address = "0.0.0.0"|' "$JOEX_CONF" "$SERVER_CONF" sed -i \
sed -i -E '/backend\s*\{/,/\}/ { -e '11s|localhost|'"$LOCAL_IP"'|' \
/jdbc\s*\{/,/\}/ { -e '17s|localhost|'"$LOCAL_IP"'|' \
s|(url\s*=\s*).*|\1"jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|; -e '49s|url = .*|url = "jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|' \
s|(user\s*=\s*).*|\1"'"$DB_USER"'"|; -e '52s|user = .*|user = "'"$DB_USER"'"|' \
s|(password\s*=\s*).*|\1"'"$DB_PASS"'"|; -e '55s|password = .*|password = "'"$DB_PASS"'"|' \
} -e '827s|url = .*|url = "jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|' \
}' "$SERVER_CONF" -e '828s|user = .*|user = "'"$DB_USER"'"|' \
sed -i -E '/postgresql\s*\{/,/\}/ { -e '829s|password = .*|password = "'"$DB_PASS"'"|' \
/jdbc\s*\{/,/\}/ { /usr/share/docspell-joex/conf/docspell-joex.conf
s|(url\s*=\s*).*|\1"jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|;
s|(user\s*=\s*).*|\1"'"$DB_USER"'"|; sed -i \
s|(password\s*=\s*).*|\1"'"$DB_PASS"'"|; -e '16s|http://localhost:7880|http://'"$LOCAL_IP"':7880|' \
} -e '22s|http://localhost:7880|http://'"$LOCAL_IP"':7880|' \
}' "$SERVER_CONF" -e '356s|url = .*|url = "jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|' \
sed -i -E '/jdbc\s*\{/,/\}/ { -e '357s|user = .*|user = "'"$DB_USER"'"|' \
s|(url\s*=\s*).*|\1"jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|; -e '358s|password = .*|password = "'"$DB_PASS"'"|' \
s|(user\s*=\s*).*|\1"'"$DB_USER"'"|; -e '401s|url = .*|url = "jdbc:postgresql://localhost:5432/'"$DB_NAME"'"|' \
s|(password\s*=\s*).*|\1"'"$DB_PASS"'"|; /opt/docspell/docspell-server.conf
}' "$JOEX_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_ok "Setup Docspell"
msg_info "Setup Apache Solr" msg_info "Setup Apache Solr"