diff --git a/paperless_ngx/CHANGELOG.md b/paperless_ngx/CHANGELOG.md index 6fd86e6a50a..bd930510ed7 100644 --- a/paperless_ngx/CHANGELOG.md +++ b/paperless_ngx/CHANGELOG.md @@ -1,11 +1,7 @@ -WORK IN PROGRESS DON'T UPDATE (no data loss) - -### 2.0.0b1-4 (20-11-2023) +### 2.0.0b1-5 (20-11-2023) - Correct passing of addon options to addon - Automatically changes config.yaml addon option to new location - Restore local and smb disks scripts - -## 2.0.0b1 (19-11-2023) - Update to latest version from paperless-ngx/paperless-ngx - MAJOR CHANGE : new HA config logic implemented. Files are now located in the addon config file, that can be accessed from the addon_configs folder from my filebrowser or cloudcommander addons. Migration of data, custom configs, and custom scripts should be automatic. Please be sure to update all your links however ! For more information, see here : https://developers.home-assistant.io/blog/2023/11/06/public-addon-config/ - Update to new official image diff --git a/paperless_ngx/Dockerfile b/paperless_ngx/Dockerfile index b78d96c1c04..c38b61cff8b 100644 --- a/paperless_ngx/Dockerfile +++ b/paperless_ngx/Dockerfile @@ -16,7 +16,6 @@ ARG BUILD_FROM ARG BUILD_VERSION -ARG BUILD_UPSTREAM="2.0.0b1" FROM ${BUILD_FROM} ################## @@ -66,12 +65,12 @@ ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templat RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh # Add custom scripts -# RUN sed -i "2a source /ha_entrypoint.sh" /sbin/docker-entrypoint.sh && \ -# sed -i 's=/./=source /=g' /ha_entrypoint.sh && \ -# sed -i "s=env bash=env bashio=g" /sbin/docker-entrypoint.sh +RUN sed -i "2a source /ha_entrypoint.sh" /sbin/docker-entrypoint.sh && \ + sed -i "s=/./=source /=g" /ha_entrypoint.sh && \ + sed -i "s=env bash=env bashio=g" /sbin/docker-entrypoint.sh -ENTRYPOINT [ "/usr/bin/env" ] -CMD [ "/ha_entrypoint.sh" ] +#ENTRYPOINT [ "/usr/bin/env" ] +#CMD [ "/ha_entrypoint.sh" ] #SHELL ["/bin/bash", "-o", "pipefail", "-c"] ############ diff --git a/paperless_ngx/README.md b/paperless_ngx/README.md index be91900b28e..a284ddaa622 100644 --- a/paperless_ngx/README.md +++ b/paperless_ngx/README.md @@ -1,3 +1,4 @@ +## ⚠ Open Issue : [🐛 [paperless_ngx] Updates are not recognised (opened 2023-07-03)](https://github.com/alexbelgium/hassio-addons/issues/889) by [@rafael298](https://github.com/rafael298) # Home assistant add-on: Paperless NGX [![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium) diff --git a/paperless_ngx/config.json b/paperless_ngx/config.json index 9bdf20ef12e..ab92b42018e 100644 --- a/paperless_ngx/config.json +++ b/paperless_ngx/config.json @@ -4,7 +4,7 @@ "amd64" ], "codenotary": "alexandrep.github@gmail.com", - "description": "Scan, index and archive all your physical documents", + "description": "scan, index and archive all your physical documents", "devices": [ "/dev/dri", "/dev/dri/card0", @@ -76,7 +76,7 @@ "media:rw", "ssl" ], - "name": "Paperless ngx", + "name": "Paperless NGX", "options": { "CONFIG_LOCATION": "/config/config.yaml", "OCRLANG": "ENG FRA GER", @@ -125,7 +125,7 @@ ], "slug": "paperless_ng", "udev": true, - "url": "https://github.com/alexbelgium/hassio-addons/tree/master/paperless_ngx", - "version": "2.0.0b1-4", + "url": "https://github.com/alexbelgium/hassio-addons", + "version": "2.0.0b1-5", "webui": "http://[HOST]:[PORT:8000]" } diff --git a/paperless_ngx/rootfs/etc/cont-init.d/20-migration_config.sh b/paperless_ngx/rootfs/etc/cont-init.d/20-migration_config.sh index e1652afbe55..739e4f0ef82 100755 --- a/paperless_ngx/rootfs/etc/cont-init.d/20-migration_config.sh +++ b/paperless_ngx/rootfs/etc/cont-init.d/20-migration_config.sh @@ -7,7 +7,6 @@ if [ -d "/homeassistant/addons_config/$slug" ]; then echo "Migrating /homeassistant/addons_config/$slug" mv /homeassistant/addons_config/"$slug"/media /config/ || true mv /homeassistant/addons_config/"$slug"/consume /config/ || true - mv /homeassistant/addons_config/"$slug"/config.yaml /config/ || true mkdir -p /config/data mv /homeassistant/addons_config/"$slug"/* /config/data/ || true rm -r /homeassistant/addons_config/"$slug" diff --git a/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh b/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh index 01ddb981605..7def9e4c642 100755 --- a/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh +++ b/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh @@ -8,6 +8,9 @@ bashio::log.info "Defining variables" +# Define variables +export PAPERLESS_ADMIN_PASSWORD="admin" +export PAPERLESS_ADMIN_USER="admin" if bashio::config.has_value "PUID"; then export USERMAP_UID="$(bashio::config "PUID")"; fi if bashio::config.has_value "PGID"; then export USERMAP_GID="$(bashio::config "PGID")"; fi if bashio::config.has_value "TZ"; then export PAPERLESS_TIME_ZONE="$(bashio::config "TZ")"; fi @@ -17,20 +20,14 @@ if bashio::config.has_value "OCRLANG"; then export PAPERLESS_OCR_LANGUAGES="${PAPERLESS_OCR_LANGUAGES,,}" fi if bashio::config.has_value "PAPERLESS_OCR_MODE"; then export PAPERLESS_OCR_MODE="$(bashio::config "PAPERLESS_OCR_MODE")"; fi - -export PAPERLESS_ADMIN_PASSWORD="admin" -export PAPERLESS_ADMIN_USER="admin" -export PAPERLESS_ALLOWED_HOSTS="\"*\"" - -chown -R paperless:paperless /config - if bashio::config.has_value "PAPERLESS_DATA_DIR"; then export PAPERLESS_DATA_DIR="$(bashio::config "PAPERLESS_DATA_DIR")"; else export PAPERLESS_DATA_DIR="/config/data"; fi if bashio::config.has_value "PAPERLESS_MEDIA_ROOT"; then export PAPERLESS_MEDIA_ROOT="$(bashio::config "PAPERLESS_MEDIA_ROOT")"; else export PAPERLESS_MEDIA_ROOT="/config/media"; fi if bashio::config.has_value "PAPERLESS_CONSUMPTION_DIR"; then export PAPERLESS_CONSUMPTION_DIR="$(bashio::config "PAPERLESS_CONSUMPTION_DIR")"; else export PAPERLESS_CONSUMPTION_DIR="/config/consume"; fi if bashio::config.has_value "PAPERLESS_EXPORT_DIR"; then export PAPERLESS_EXPORT_DIR="$(bashio::config "PAPERLESS_EXPORT_DIR")"; else export PAPERLESS_EXPORT_DIR="/config/export"; fi +# Create folder and permissions if needed +chown -R paperless:paperless /config for variable in "$PAPERLESS_DATA_DIR" "$PAPERLESS_MEDIA_ROOT" "$PAPERLESS_CONSUMPTION_DIR" "$PAPERLESS_EXPORT_DIR"; do - # Create folder and permissions if needed mkdir -p "$variable" chmod -R 755 "$variable" chown -R paperless:paperless "$variable" @@ -81,16 +78,14 @@ esac set +u # For all relevant variables -for variable in PAPERLESS_DATA_DIR PAPERLESS_MEDIA_ROOT PAPERLESS_CONSUMPTION_DIR PAPERLESS_EXPORT_DIR USERMAP_UID USERMAP_GID PAPERLESS_TIME_ZONE PAPERLESS_URL PAPERLESS_OCR_LANGUAGES PAPERLESS_OCR_MODE PAPERLESS_ADMIN_PASSWORD PAPERLESS_ADMIN_USER PAPERLESS_ALLOWED_HOSTS PAPERLESS_DATA_DIR PAPERLESS_MEDIA_ROOT PAPERLESS_CONSUMPTION_DIR PAPERLESS_DBENGINE PAPERLESS_DBHOST PAPERLESS_DBPORT PAPERLESS_DBNAME PAPERLESS_DBUSER PAPERLESS_DBPASS; do +for variable in PAPERLESS_DATA_DIR PAPERLESS_MEDIA_ROOT PAPERLESS_CONSUMPTION_DIR PAPERLESS_EXPORT_DIR USERMAP_UID USERMAP_GID PAPERLESS_TIME_ZONE PAPERLESS_URL PAPERLESS_OCR_LANGUAGES PAPERLESS_OCR_MODE PAPERLESS_ADMIN_PASSWORD PAPERLESS_ADMIN_USER PAPERLESS_DBENGINE PAPERLESS_DBHOST PAPERLESS_DBPORT PAPERLESS_DBNAME PAPERLESS_DBUSER PAPERLESS_DBPASS; do + + # Skip if not defined + if [ -n \$$variable ]; then continue; fi # Variable content variablecontent="$(eval echo "\$$variable")" - # Skip if variable content empty - if [ ${#variablecontent} -le 2 ]; then - continue - else - bashio::log.blue "$variable=\"$variablecontent\"" - fi + bashio::log.blue "$variable=\"$variablecontent\"" # Export export "$variable=$variablecontent" @@ -119,5 +114,3 @@ exec nginx & bashio::log.info "Starting nginx" # Starting app # ############### bashio::log.info "Initial username and password are admin. Please change in the administration panel of the webUI after login." - -/./usr/local/bin/paperless_cmd.sh /sbin/docker-entrypoint.sh