This commit is contained in:
Alexandre
2023-11-21 09:53:56 +01:00
parent 2e6e4693a7
commit 8e035dde96
350 changed files with 1908 additions and 1328 deletions

View File

@@ -1,21 +1,15 @@
WORK IN PROGRESS DON'T UPDATE (no data loss)
## 1.17.1 (19-08-2023)
- Update to latest version from paperless-ngx/paperless-ngx
### 2.0.0b1-4 (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
## 1.17.0 (05-08-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.16.5 (01-07-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.16.3 (24-06-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.16.1 (17-06-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.15.1 (10-06-2023)
## 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
- Enable beta channel
## 1.14.5 (19-05-2023)
- Update to latest version from paperless-ngx/paperless-ngx

View File

@@ -16,8 +16,8 @@
ARG BUILD_FROM
ARG BUILD_VERSION
ARG BUILD_UPSTREAM="1.17.1"
FROM ${BUILD_FROM}:${BUILD_UPSTREAM}
ARG BUILD_UPSTREAM="2.0.0b1"
FROM ${BUILD_FROM}
##################
# 2 Modify Image #
@@ -28,10 +28,9 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
# Add custom scripts
#RUN \
# sed -i '/Paperless-ngx docker container starting/a /./ha_entrypoint.sh' /sbin/docker-entrypoint.sh
#&& \
# Correct pre-encoded paths
# for file in $(grep -sril "/usr/src/paperless/" /sbin /usr); do sed -i "s=/usr/src/paperless/=/config/=g" "$file"; done
##################
# 3 Install apps #
@@ -41,18 +40,18 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \
COPY rootfs/ /
# Modules
ARG MODULES="00-banner.sh 01-custom_script.sh 00-local_mounts.sh 00-smb_mounts.sh 01-config_yaml.sh"
ARG MODULES="00-banner.sh 00-local_mounts.sh 00-smb_mounts.sh 01-custom_script.sh"
# Automatic modules download
ADD --chmod=744 "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automodules.sh" "/ha_automodules.sh"
RUN /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automodules.sh" "/ha_automodules.sh"
RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh
# Manual apps
ENV PACKAGES="redis-server yamllint pip libxml2-dev libxslt-dev python-dev libjpeg-dev zlib1g-dev python3-dev build-essential nginx"
ENV PACKAGES="redis-server"
# Automatic apps & bashio
ADD --chmod=744 "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"
RUN /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"
RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh
################
# 4 Entrypoint #
@@ -60,14 +59,17 @@ RUN /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh
# Add entrypoint
ENV S6_STAGE2_HOOK=/ha_entrypoint.sh
ADD --chmod=777 "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh"
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh"
# Entrypoint modifications
ADD --chmod=777 "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint_modif.sh" "/ha_entrypoint_modif.sh"
RUN /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint_modif.sh" "/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
# 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
#WORKDIR /
ENTRYPOINT [ "/usr/bin/env" ]
CMD [ "/ha_entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]

View File

@@ -7,8 +7,8 @@
![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fpaperless_ngx%2Fconfig.json)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c6cf10bdbba45ecb202d7f579b5be0e)](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
[![GitHub Super-Linter](https://img.shields.io/github/actions/workflow/status/alexbelgium/hassio-addons/weekly-supelinter.yaml?label=Lint%20code%20base)](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly-supelinter.yaml)
[![Builder](https://img.shields.io/github/actions/workflow/status/alexbelgium/hassio-addons/onpush_builder.yaml?label=Builder)](https://github.com/alexbelgium/hassio-addons/actions/workflows/onpush_builder.yaml)
[![GitHub Super-Linter](https://github.com/alexbelgium/hassio-addons/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)
[![Builder](https://github.com/alexbelgium/hassio-addons/workflows/Builder/badge.svg)](https://github.com/alexbelgium/hassio-addons/actions/workflows/builder.yaml)
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white

View File

@@ -1,8 +1,7 @@
{
"build_from": {
"aarch64": "ghcr.io/paperless-ngx/paperless-ngx",
"amd64": "ghcr.io/paperless-ngx/paperless-ngx",
"armv7": "ghcr.io/paperless-ngx/paperless-ngx"
"aarch64": "ghcr.io/paperless-ngx/paperless-ngx:latest",
"amd64": "ghcr.io/paperless-ngx/paperless-ngx:latest"
},
"codenotary": {
"signer": "alexandrep.github@gmail.com"

View File

@@ -1,11 +1,10 @@
{
"arch": [
"aarch64",
"amd64",
"armv7"
"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",
@@ -61,21 +60,25 @@
"environment": {
"PAPERLESS_ADMIN_PASSWORD": "admin",
"PAPERLESS_ADMIN_USER": "admin",
"PAPERLESS_DATA_DIR": "/config/data",
"PAPERLESS_MEDIA_ROOT": "/config/media",
"PAPERLESS_CONSUMPTION_DIR": "/config/consume",
"PAPERLESS_EXPORT_DIR": "/config/export",
"PGID": "0",
"PUID": "0"
},
"homeassistant": "0.92.0b2",
"image": "ghcr.io/alexbelgium/paperless_ng-{arch}",
"init": false,
"map": [
"config:rw",
"addon_config:rw",
"homeassistant_config:rw",
"share:rw",
"media:rw",
"ssl"
],
"name": "Paperless NGX",
"name": "Paperless ngx",
"options": {
"CONFIG_LOCATION": "/config/addons_config/paperless_ng/config.yaml",
"CONFIG_LOCATION": "/config/config.yaml",
"OCRLANG": "ENG FRA GER",
"PAPERLESS_OCR_MODE": "skip",
"PGID": 0,
@@ -122,7 +125,7 @@
],
"slug": "paperless_ng",
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "1.15.1",
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/paperless_ngx",
"version": "2.0.0b1-4",
"webui": "http://[HOST]:[PORT:8000]"
}

View File

@@ -0,0 +1,16 @@
#!/bin/bash
echo "Starting..."
####################
# Starting scripts #
####################
for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done

View File

@@ -1,13 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
slug=paperless_ng
if [ ! -d /config/addons_config/$slug ]; then
echo "Creating /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug
fi
chmod -R 755 /config/addons_config/$slug
chown -R paperless:paperless /config/addons_config/$slug

View File

@@ -0,0 +1,14 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
slug=paperless_ng
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"
fi

View File

@@ -1,6 +1,5 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
if bashio::config.true 'ssl'; then
# Validate ssl

View File

@@ -1,7 +1,6 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# shellcheck disable=SC2155
set -e
####################
# Define variables #
@@ -9,32 +8,32 @@ set -e
bashio::log.info "Defining variables"
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
if bashio::config.has_value "PAPERLESS_URL"; then export PAPERLESS_URL=$(bashio::config "PAPERLESS_URL"); 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 "TZ"; then export PAPERLESS_TIME_ZONE="$(bashio::config "TZ")"; fi
if bashio::config.has_value "PAPERLESS_URL"; then export PAPERLESS_URL="$(bashio::config "PAPERLESS_URL")"; fi
if bashio::config.has_value "OCRLANG"; then
PAPERLESS_OCR_LANGUAGES="$(bashio::config "OCRLANG")"
export PAPERLESS_OCR_LANGUAGES=${PAPERLESS_OCR_LANGUAGES,,}
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
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="*"
export PAPERLESS_ALLOWED_HOSTS="\"*\""
export PAPERLESS_DATA_DIR="/config/addons_config/paperless_ng"
export PAPERLESS_MEDIA_ROOT="/config/addons_config/paperless_ng/media"
export PAPERLESS_CONSUMPTION_DIR="/config/addons_config/paperless_ng/consume"
chown -R paperless:paperless /config
if bashio::config.has_value "PAPERLESS_DATA_DIR"; then export PAPERLESS_DATA_DIR=$(bashio::config "PAPERLESS_DATA_DIR"); fi
if bashio::config.has_value "PAPERLESS_MEDIA_ROOT"; then export PAPERLESS_MEDIA_ROOT=$(bashio::config "PAPERLESS_MEDIA_ROOT"); fi
if bashio::config.has_value "PAPERLESS_CONSUMPTION_DIR"; then export PAPERLESS_CONSUMPTION_DIR=$(bashio::config "PAPERLESS_CONSUMPTION_DIR"); 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_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
for folder in "$PAPERLESS_DATA_DIR" "$PAPERLESS_MEDIA_ROOT" "$PAPERLESS_CONSUMPTION_DIR"; do
mkdir -p "$folder"
chmod -R 755 "$folder"
chown -R paperless:paperless "$folder"
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"
done
###################
@@ -43,7 +42,7 @@ done
bashio::log.info "Defining database"
case $(bashio::config 'database') in
case "$(bashio::config 'database')" in
# Use mariadb
mariadb_addon)
@@ -80,19 +79,30 @@ case $(bashio::config 'database') in
esac
set +u
# For all relevant variables
for variable in 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_ALLOWED_HOSTS PAPERLESS_DATA_DIR PAPERLESS_MEDIA_ROOT PAPERLESS_CONSUMPTION_DIR PAPERLESS_DBENGINE PAPERLESS_DBHOST PAPERLESS_DBPORT PAPERLESS_DBNAME PAPERLESS_DBUSER PAPERLESS_DBPASS; do
# Variable content
variablecontent="$(eval echo "\$$variable")"
# Skip if variable content empty
if [ ${#variablecontent} -le 2 ]; then
continue
else
bashio::log.blue "$variable=\"$variablecontent\""
fi
# Export
export "$variable=$variablecontent"
# Add to bashrc
eval echo "$variable=\"$variablecontent\"" >> ~/.bashrc
# set .env
echo "$variable=\"$variablecontent\"" >> /.env || true
# set /etc/environment
mkdir -p /etc
echo "$variable=\"$variablecontent\"" >> /etc/environment
# For s6
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${variablecontent}" > /var/run/s6/container_environment/"${variable}"; fi
done
#################
@@ -106,8 +116,8 @@ exec redis-server & bashio::log.info "Starting redis"
exec nginx & bashio::log.info "Starting nginx"
###############
# Staring app #
# 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
/./usr/local/bin/paperless_cmd.sh /sbin/docker-entrypoint.sh

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,10 +1,10 @@
{
"github_beta": "true",
"github_fulltag": "false",
"last_update": "19-08-2023",
"paused": true,
"last_update": "19-11-2023",
"repository": "alexbelgium/hassio-addons",
"slug": "paperless_ngx",
"slug": "paperless_ng",
"source": "github",
"upstream_repo": "paperless-ngx/paperless-ngx",
"upstream_version": "1.17.1"
"upstream_version": "2.0.0b1"
}