mirror of
https://github.com/YunoHost-Apps/paperless-ngx_ynh.git
synced 2024-09-03 19:56:33 +02:00
Merge pull request #70 from YunoHost-Apps/local-gs
This commit is contained in:
commit
83daa839f0
12 changed files with 94 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
|
@ -62,4 +62,4 @@ or
|
|||
sudo yunohost app upgrade paperless-ngx -u https://github.com/YunoHost-Apps/paperless-ngx_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
|
@ -1,5 +1,5 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ PAPERLESS_CONSUMER_IGNORE_PATTERNS=[".DS_STORE/*", "._*", ".stfolder/*", ".*"]
|
|||
# Binaries
|
||||
|
||||
#PAPERLESS_CONVERT_BINARY=/usr/bin/convert
|
||||
#PAPERLESS_GS_BINARY=/usr/bin/gs
|
||||
PAPERLESS_GS_BINARY=__INSTALL_DIR__/bin/gs
|
||||
#PAPERLESS_OPTIPNG_BINARY=/usr/bin/optipng
|
||||
|
||||
# YunoHost tweaks
|
||||
|
|
23
conf/policy.xml
Normal file
23
conf/policy.xml
Normal file
|
@ -0,0 +1,23 @@
|
|||
<policymap>
|
||||
<!-- temporary path must be a preexisting writable directory -->
|
||||
<policy domain="resource" name="temporary-path" value="__DATA_DIR__/imagemagick"/>
|
||||
<policy domain="resource" name="memory" value="256MiB"/>
|
||||
<policy domain="resource" name="list-length" value="32"/>
|
||||
<policy domain="resource" name="width" value="8KP"/>
|
||||
<policy domain="resource" name="height" value="8KP"/>
|
||||
<policy domain="resource" name="map" value="512MiB"/>
|
||||
<policy domain="resource" name="area" value="16KP"/>
|
||||
<policy domain="resource" name="disk" value="1GiB"/>
|
||||
<policy domain="resource" name="file" value="768"/>
|
||||
<policy domain="resource" name="thread" value="2"/>
|
||||
<policy domain="resource" name="time" value="120"/>
|
||||
<policy domain="module" rights="none" pattern="URL" />
|
||||
<policy domain="coder" rights="read | write" pattern="{MSVG,MVG,PS,PDF,RSVG,SVG,XPS}" />
|
||||
<policy domain="filter" rights="none" pattern="*" />
|
||||
<policy domain="path" rights="none" pattern="-"/> <!-- don't read/write from/to stdin/stdout -->
|
||||
<policy domain="path" rights="none" pattern="/etc/*"/> <!-- don't read sensitive paths -->
|
||||
<policy domain="path" rights="none" pattern="@*"/> <!-- indirect reads not permitted -->
|
||||
<policy domain="cache" name="memory-map" value="anonymous"/>
|
||||
<policy domain="cache" name="synchronize" value="true"/>
|
||||
<policy domain="system" name="shred" value="1"/>
|
||||
</policymap>
|
|
@ -6,6 +6,7 @@ Requires=redis.service
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
Environment=PATH=__LOCAL_PATH__
|
||||
WorkingDirectory=__INSTALL_DIR__/src/
|
||||
ExecStart=__INSTALL_DIR__/venv/bin/python3 manage.py document_consumer
|
||||
StandardOutput=append:/var/log/__APP__/__APP__-consumer.log
|
||||
|
|
|
@ -6,6 +6,7 @@ Requires=redis.service
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
Environment=PATH=__LOCAL_PATH__
|
||||
WorkingDirectory=__INSTALL_DIR__/src/
|
||||
ExecStart=__INSTALL_DIR__/venv/bin/celery --app paperless beat --loglevel INFO
|
||||
StandardOutput=append:/var/log/__APP__/__APP__-scheduler.log
|
||||
|
|
|
@ -6,6 +6,7 @@ Requires=redis.service
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
Environment=PATH=__LOCAL_PATH__
|
||||
WorkingDirectory=__INSTALL_DIR__/src/
|
||||
ExecStart=__INSTALL_DIR__/venv/bin/celery --app paperless worker --loglevel INFO
|
||||
StandardOutput=append:/var/log/__APP__/__APP__-task-queue.log
|
||||
|
|
|
@ -8,6 +8,7 @@ Requires=redis.service
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
Environment=PATH=__LOCAL_PATH__
|
||||
WorkingDirectory=__INSTALL_DIR__/src/
|
||||
ExecStart=__INSTALL_DIR__/venv/bin/uvicorn --port=__PORT__ --log-level=warning paperless.asgi:application
|
||||
StandardOutput=append:/var/log/__APP__/__APP__.log
|
||||
|
|
3
doc/PRE_UPGRADE.d/2.4.3~ynh2.md
Normal file
3
doc/PRE_UPGRADE.d/2.4.3~ynh2.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
Starting 2.4.3~ynh2, and while YunoHost 12 is yet to be released, Paperless-NGX will require to build its Ghostscript dependency to be able to process documents.
|
||||
|
||||
Expect a longer upgrade !
|
|
@ -61,12 +61,16 @@ ram.runtime = "350M"
|
|||
autoupdate.strategy = "latest_github_release"
|
||||
autoupdate.asset = "paperless-ngx-.*.tar.xz"
|
||||
|
||||
[resources.sources.gs]
|
||||
url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10021/ghostpdl-10.02.1.tar.gz"
|
||||
sha256 = "25399af0ef5bb94f2a13c91dc785c128d14f16744c4c92fa7c86e011c23151d8"
|
||||
|
||||
[resources.system_user]
|
||||
|
||||
[resources.install_dir]
|
||||
|
||||
[resources.data_dir]
|
||||
subdirs = ["consume", "data", "media"]
|
||||
subdirs = ["consume", "data", "media", "imagemagick"]
|
||||
|
||||
[resources.permissions]
|
||||
main.url = "/"
|
||||
|
|
|
@ -17,6 +17,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1
|
|||
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
||||
ynh_setup_source --dest_dir="$install_dir/ghostscript" --source_id="gs"
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:$app "$install_dir"
|
||||
|
@ -55,6 +57,24 @@ pushd $install_dir
|
|||
)
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# BUILD GHOSTCRIPT SPECIFIC VERSION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Building Ghostscript dependency... (this will take a long time!)"
|
||||
|
||||
pushd $install_dir/ghostscript
|
||||
ynh_exec_warn_less ./configure
|
||||
ynh_exec_warn_less make
|
||||
mv bin/ $install_dir/
|
||||
popd
|
||||
|
||||
ynh_secure_remove --file="$install_dir/ghostscript"
|
||||
chmod -R o-rwx "$install_dir/bin"
|
||||
chown -R $app:$app "$install_dir/bin"
|
||||
chmod 550 $install_dir/bin/gs
|
||||
|
||||
local_path=$install_dir/bin/:$PATH
|
||||
|
||||
#=================================================
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
|
@ -83,6 +103,12 @@ ynh_add_config --template="paperless.conf.example" --destination="$install_dir/p
|
|||
chmod 400 "$install_dir/paperless.conf"
|
||||
chown $app:$app "$install_dir/paperless.conf"
|
||||
|
||||
# ImageMagick configuration
|
||||
mkdir -p "$install_dir/.config/ImageMagick"
|
||||
ynh_add_config --template="policy.xml" --destination="$install_dir/.config/ImageMagick/policy.xml"
|
||||
chmod 400 "$install_dir/.config/ImageMagick/policy.xml"
|
||||
chown -R $app:$app "$install_dir/.config"
|
||||
|
||||
#=================================================
|
||||
# SETUP THE DATABASE
|
||||
#=================================================
|
||||
|
|
|
@ -95,6 +95,29 @@ pushd $install_dir
|
|||
)
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# BUILD GHOSTCRIPT SPECIFIC VERSION
|
||||
#=================================================
|
||||
if ! dpkg --compare-versions "$($install_dir/bin/gs --version 2>/dev/null)" ge "10.02.1"
|
||||
then
|
||||
ynh_script_progression --message="Building Ghostscript dependency... (this will take a long time!)"
|
||||
|
||||
ynh_setup_source --dest_dir="$install_dir/ghostscript" --source_id="gs" --full_replace
|
||||
|
||||
pushd $install_dir/ghostscript
|
||||
ynh_exec_warn_less ./configure
|
||||
ynh_exec_warn_less make
|
||||
mv bin/ $install_dir/
|
||||
popd
|
||||
|
||||
ynh_secure_remove --file="$install_dir/ghostscript"
|
||||
chmod -R o-rwx "$install_dir/bin"
|
||||
chown -R $app:$app "$install_dir/bin"
|
||||
chmod 550 $install_dir/bin/gs
|
||||
fi
|
||||
|
||||
local_path=$install_dir/bin/:$PATH
|
||||
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
|
@ -105,6 +128,12 @@ ynh_add_config --template="paperless.conf.example" --destination="$install_dir/p
|
|||
chmod 400 "$install_dir/paperless.conf"
|
||||
chown $app:$app "$install_dir/paperless.conf"
|
||||
|
||||
# ImageMagick configuration
|
||||
mkdir -p "$install_dir/.config/ImageMagick"
|
||||
ynh_add_config --template="policy.xml" --destination="$install_dir/.config/ImageMagick/policy.xml"
|
||||
chmod 400 "$install_dir/.config/ImageMagick/policy.xml"
|
||||
chown -R $app:$app "$install_dir/.config"
|
||||
|
||||
#=================================================
|
||||
# SETUP THE DATABASE
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue