Skip to content

Commit

Permalink
🔨 Move data to addon_config folder and add paperless.conf file (#51)
Browse files Browse the repository at this point in the history
* move data to config foder

* add paperless.conf

* fix new data path
  • Loading branch information
BenoitAnastay committed Jan 7, 2024
1 parent 106fd17 commit 741c00e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions paperless-ngx/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ports:
ports_description:
8000/tcp: Web interface
map:
- addon_config:rw
- share:rw
options:
filename: "{created_year}/{correspondent}/{title}"
Expand Down
10 changes: 8 additions & 2 deletions paperless-ngx/rootfs/etc/s6-overlay/s6-rc.d/init-paperless/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
# ==============================================================================

PAPERLESS_CONSUMPTION_DIR=/share/paperless/consume
PAPERLESS_DATA_DIR=/share/paperless/data
PAPERLESS_DATA_DIR=/config/data
PAPERLESS_MEDIA_ROOT=/share/paperless/media

if bashio::fs.directory_exists '/share/paperless/data'; then
bashio::log.info "Migrating 'data' folder from share storage to /addon_configs/papeless_ngx/data"
mv /share/paperless/data /config
fi

mkdir -p $PAPERLESS_CONSUMPTION_DIR
mkdir -p $PAPERLESS_DATA_DIR
mkdir -p $PAPERLESS_MEDIA_ROOT

chown -R paperless:paperless /usr/src/paperless
chown -R paperless:paperless /usr/src/paperless

cp /usr/src/paperless/paperless.conf /config/paperless.conf.exemple
4 changes: 3 additions & 1 deletion paperless-ngx/rootfs/etc/s6-overlay/s6-rc.d/paperless/run
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ PAPERLESS_CONSUMER_ENABLE_ASN_BARCODE=$(bashio::config 'barcodes_asn')
PAPERLESS_CONSUMER_RECURSIVE=$(bashio::config 'consumer_recursive')
PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS=$(bashio::config 'consumer_subdirs_as_tags')
PAPERLESS_CONSUMPTION_DIR=/share/paperless/consume
PAPERLESS_DATA_DIR=/share/paperless/data
PAPERLESS_DATA_DIR=/config/data
PAPERLESS_MEDIA_ROOT=/share/paperless/media
PAPERLESS_CONFIGURATION_PATH="/config/paperless.conf"

#This set the URL of paperless
if bashio::config.has_value 'url'; then
Expand Down Expand Up @@ -54,5 +55,6 @@ export PAPERLESS_CONSUMER_ENABLE_BARCODES
export PAPERLESS_CONSUMER_ENABLE_ASN_BARCODE
export PAPERLESS_CONSUMER_RECURSIVE
export PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS
export PAPERLESS_CONFIGURATION_PATH

/sbin/docker-entrypoint.sh "/usr/local/bin/paperless_cmd.sh"

0 comments on commit 741c00e

Please sign in to comment.