mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 21:04:05 +02:00
Update paperless https://github.com/alexbelgium/hassio-addons/issues/1078 https://github.com/alexbelgium/hassio-addons/issues/889
This commit is contained in:
@@ -1,11 +1,7 @@
|
|||||||
WORK IN PROGRESS DON'T UPDATE (no data loss)
|
### 2.0.0b1-5 (20-11-2023)
|
||||||
|
|
||||||
### 2.0.0b1-4 (20-11-2023)
|
|
||||||
- Correct passing of addon options to addon
|
- Correct passing of addon options to addon
|
||||||
- Automatically changes config.yaml addon option to new location
|
- Automatically changes config.yaml addon option to new location
|
||||||
- Restore local and smb disks scripts
|
- Restore local and smb disks scripts
|
||||||
|
|
||||||
## 2.0.0b1 (19-11-2023)
|
|
||||||
- Update to latest version from paperless-ngx/paperless-ngx
|
- 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/
|
- 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
|
- Update to new official image
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
ARG BUILD_FROM
|
ARG BUILD_FROM
|
||||||
ARG BUILD_VERSION
|
ARG BUILD_VERSION
|
||||||
ARG BUILD_UPSTREAM="2.0.0b1"
|
|
||||||
FROM ${BUILD_FROM}
|
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
|
RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh
|
||||||
|
|
||||||
# Add custom scripts
|
# Add custom scripts
|
||||||
# RUN sed -i "2a source /ha_entrypoint.sh" /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=/./=source /=g" /ha_entrypoint.sh && \
|
||||||
# sed -i "s=env bash=env bashio=g" /sbin/docker-entrypoint.sh
|
sed -i "s=env bash=env bashio=g" /sbin/docker-entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/bin/env" ]
|
#ENTRYPOINT [ "/usr/bin/env" ]
|
||||||
CMD [ "/ha_entrypoint.sh" ]
|
#CMD [ "/ha_entrypoint.sh" ]
|
||||||
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
############
|
############
|
||||||
|
|||||||
@@ -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
|
# Home assistant add-on: Paperless NGX
|
||||||
|
|
||||||
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"amd64"
|
"amd64"
|
||||||
],
|
],
|
||||||
"codenotary": "alexandrep.github@gmail.com",
|
"codenotary": "alexandrep.github@gmail.com",
|
||||||
"description": "Scan, index and archive all your physical documents",
|
"description": "scan, index and archive all your physical documents",
|
||||||
"devices": [
|
"devices": [
|
||||||
"/dev/dri",
|
"/dev/dri",
|
||||||
"/dev/dri/card0",
|
"/dev/dri/card0",
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
"media:rw",
|
"media:rw",
|
||||||
"ssl"
|
"ssl"
|
||||||
],
|
],
|
||||||
"name": "Paperless ngx",
|
"name": "Paperless NGX",
|
||||||
"options": {
|
"options": {
|
||||||
"CONFIG_LOCATION": "/config/config.yaml",
|
"CONFIG_LOCATION": "/config/config.yaml",
|
||||||
"OCRLANG": "ENG FRA GER",
|
"OCRLANG": "ENG FRA GER",
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
],
|
],
|
||||||
"slug": "paperless_ng",
|
"slug": "paperless_ng",
|
||||||
"udev": true,
|
"udev": true,
|
||||||
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/paperless_ngx",
|
"url": "https://github.com/alexbelgium/hassio-addons",
|
||||||
"version": "2.0.0b1-4",
|
"version": "2.0.0b1-5",
|
||||||
"webui": "http://[HOST]:[PORT:8000]"
|
"webui": "http://[HOST]:[PORT:8000]"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ if [ -d "/homeassistant/addons_config/$slug" ]; then
|
|||||||
echo "Migrating /homeassistant/addons_config/$slug"
|
echo "Migrating /homeassistant/addons_config/$slug"
|
||||||
mv /homeassistant/addons_config/"$slug"/media /config/ || true
|
mv /homeassistant/addons_config/"$slug"/media /config/ || true
|
||||||
mv /homeassistant/addons_config/"$slug"/consume /config/ || true
|
mv /homeassistant/addons_config/"$slug"/consume /config/ || true
|
||||||
mv /homeassistant/addons_config/"$slug"/config.yaml /config/ || true
|
|
||||||
mkdir -p /config/data
|
mkdir -p /config/data
|
||||||
mv /homeassistant/addons_config/"$slug"/* /config/data/ || true
|
mv /homeassistant/addons_config/"$slug"/* /config/data/ || true
|
||||||
rm -r /homeassistant/addons_config/"$slug"
|
rm -r /homeassistant/addons_config/"$slug"
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
bashio::log.info "Defining variables"
|
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 "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 "PGID"; then export USERMAP_GID="$(bashio::config "PGID")"; fi
|
||||||
if bashio::config.has_value "TZ"; then export PAPERLESS_TIME_ZONE="$(bashio::config "TZ")"; 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,,}"
|
export PAPERLESS_OCR_LANGUAGES="${PAPERLESS_OCR_LANGUAGES,,}"
|
||||||
fi
|
fi
|
||||||
if bashio::config.has_value "PAPERLESS_OCR_MODE"; then export PAPERLESS_OCR_MODE="$(bashio::config "PAPERLESS_OCR_MODE")"; 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_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_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_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
|
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
|
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"
|
mkdir -p "$variable"
|
||||||
chmod -R 755 "$variable"
|
chmod -R 755 "$variable"
|
||||||
chown -R paperless:paperless "$variable"
|
chown -R paperless:paperless "$variable"
|
||||||
@@ -81,16 +78,14 @@ esac
|
|||||||
set +u
|
set +u
|
||||||
|
|
||||||
# For all relevant variables
|
# 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
|
# Variable content
|
||||||
variablecontent="$(eval echo "\$$variable")"
|
variablecontent="$(eval echo "\$$variable")"
|
||||||
# Skip if variable content empty
|
bashio::log.blue "$variable=\"$variablecontent\""
|
||||||
if [ ${#variablecontent} -le 2 ]; then
|
|
||||||
continue
|
|
||||||
else
|
|
||||||
bashio::log.blue "$variable=\"$variablecontent\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Export
|
# Export
|
||||||
export "$variable=$variablecontent"
|
export "$variable=$variablecontent"
|
||||||
@@ -119,5 +114,3 @@ exec nginx & bashio::log.info "Starting nginx"
|
|||||||
# Starting app #
|
# Starting app #
|
||||||
###############
|
###############
|
||||||
bashio::log.info "Initial username and password are admin. Please change in the administration panel of the webUI after login."
|
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user