refactoring changes from sequpgrade (endReturn, ...) and some modernizations
This commit is contained in:
@@ -76,11 +76,11 @@ step_3() {
|
||||
status)
|
||||
serviceCommand="is-active"
|
||||
info -n "paperless-webserver: "
|
||||
exe systemctl "${serviceCommand:?}" paperless-webserver
|
||||
exe systemctl "${serviceCommand:?}" paperless-webserver
|
||||
info -na "paperless-scheduler: "
|
||||
exe systemctl "${serviceCommand:?}" paperless-scheduler
|
||||
exe systemctl "${serviceCommand:?}" paperless-scheduler
|
||||
info -na "paperless-consumer : "
|
||||
exe systemctl "${serviceCommand:?}" paperless-consumer
|
||||
exe systemctl "${serviceCommand:?}" paperless-consumer
|
||||
info -na "paperless-task-queue: "
|
||||
exe systemctl "${serviceCommand:?}" paperless-task-queue.service
|
||||
return 0 ;;
|
||||
@@ -90,9 +90,9 @@ step_3() {
|
||||
error "Unknown command ${1:-"-"}"
|
||||
return 1 ;;
|
||||
esac
|
||||
exe systemctl "${serviceCommand:?}" paperless-webserver
|
||||
exe systemctl "${serviceCommand:?}" paperless-scheduler
|
||||
exe systemctl "${serviceCommand:?}" paperless-consumer
|
||||
exe systemctl "${serviceCommand:?}" paperless-webserver
|
||||
exe systemctl "${serviceCommand:?}" paperless-scheduler
|
||||
exe systemctl "${serviceCommand:?}" paperless-consumer
|
||||
exe systemctl "${serviceCommand:?}" paperless-task-queue
|
||||
}
|
||||
|
||||
@@ -100,8 +100,8 @@ step_10_info() { echo "Install python3"; }
|
||||
step_10_alias() { echo "install"; }
|
||||
step_10() {
|
||||
exe apt update
|
||||
exe apt install ${toolDeps} ${aptOpt:-}
|
||||
exe apt install ${toolDepsOcr} ${aptOpt:-}
|
||||
exe apt install ${toolDeps} ${aptOpt:-}
|
||||
exe apt install ${toolDepsOcr} ${aptOpt:-}
|
||||
}
|
||||
|
||||
step_11_info() { echo "Add system user"; }
|
||||
@@ -111,7 +111,7 @@ step_11() {
|
||||
fi
|
||||
exe adduser --disabled-password --disabled-login --gecos "" --home "${sc_paperlessHome}" "${sc_paperlessUser:?}"
|
||||
}
|
||||
|
||||
|
||||
step_12_info() { echo "Install/upgrade ${toolName}"; }
|
||||
step_12_alias() { echo "upgrade"; }
|
||||
step_12() {
|
||||
@@ -127,7 +127,7 @@ step_12() {
|
||||
fi
|
||||
fi
|
||||
exe wget ${downUrl} -q -O "${sq_paperlessDownLoc}"
|
||||
endReturn -o $? "Download failed"
|
||||
endReturn "Download failed"
|
||||
|
||||
if [ -e "${sc_paperlessDir}" ] ; then
|
||||
if step backup --nostart; then
|
||||
@@ -139,7 +139,7 @@ step_12() {
|
||||
exe mv "${sc_paperlessDir}" "${sc_paperlessDir}_bu"
|
||||
fi
|
||||
|
||||
exe mkdir -p "${sc_paperlessHome}"
|
||||
exe mkdir -p "${sc_paperlessHome}"
|
||||
exe tar -xf "${sq_paperlessDownLoc}" -C "${sc_paperlessHome}"
|
||||
exe chown -R "${sc_paperlessUser}": "${sc_paperlessHome}"
|
||||
|
||||
@@ -154,7 +154,7 @@ step_12() {
|
||||
info "Starting post upgrade procedure"
|
||||
step postupgrade
|
||||
step service start
|
||||
die "Upgrade finished"
|
||||
die "Upgrade finished"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -194,17 +194,17 @@ step_19_alias() { echo 'nltk'; }
|
||||
step_19() {
|
||||
info 'Installing nltk'
|
||||
exe "${sc_paperlessVenv}/bin/pip3" install -U nltk
|
||||
endReturn -o $? "Failed to install nlkt"
|
||||
endReturn "Failed to install nlkt"
|
||||
|
||||
exe cd "${sc_paperlessHome}/data"
|
||||
exe mkdir -p "nltk"
|
||||
exe "${sc_paperlessVenv}/bin/python3" -m nltk.downloader -d ./nltk/ snowball_data stopwords punkt
|
||||
endReturn -o $? "Failed to install nlkt modules snowball stopwords punkt"
|
||||
endReturn "Failed to install nlkt modules snowball stopwords punkt"
|
||||
|
||||
step service restart
|
||||
}
|
||||
|
||||
step_30_info() {
|
||||
step_30_info() {
|
||||
echo "Retag existing documents"
|
||||
echoinfo "OPTIONS"
|
||||
echoinfo " -c, --correspondent"
|
||||
@@ -222,7 +222,7 @@ step_30() {
|
||||
exe sudo -u "${sc_paperlessUser}" "${sc_paperlessVenv}/bin/python3" manage.py document_retagger "$@"
|
||||
}
|
||||
|
||||
step_32_info() {
|
||||
step_32_info() {
|
||||
echo "Manage document search index"
|
||||
echoinfo " reindex - (default) create index from scratch"
|
||||
echoinfo " optimize - updates index to increase search speed and"
|
||||
@@ -292,7 +292,7 @@ step_100() {
|
||||
../../{consume,data,media}
|
||||
* To allow access directly via ip address
|
||||
PAPERLESS_ALLOWED_HOSTS=$(hostname -I | awk '{print $1;}')
|
||||
* recommended settings
|
||||
* recommended settings
|
||||
PAPERLESS_FILENAME_FORMAT={created_year}/{title}
|
||||
PAPERLESS_SECRET_KEY=change-me
|
||||
PAPERLESS_OCR_LANGUAGE=deu+eng
|
||||
@@ -309,7 +309,7 @@ $(cd "${sc_paperlessDir}"/scripts 2>/dev/null && for f in *.service; do echo "
|
||||
To chose a custom listen address and port for gunicorn
|
||||
(default address: [..], default port: 8000)
|
||||
* /etc/ImageMagick-x/policy.xml
|
||||
* enable access to pdfs
|
||||
* enable access to pdfs
|
||||
<policy domain="coder" rights="read|write" pattern="PDF" />
|
||||
|
||||
# Nginx proxy
|
||||
|
Reference in New Issue
Block a user