deprecated

This commit is contained in:
Alexandre
2024-03-06 14:38:35 +01:00
committed by GitHub
parent a0979c96e3
commit 3e04c9ca07
23 changed files with 4 additions and 1 deletions

View File

@@ -0,0 +1,258 @@
- Deprecated, please move to https://github.com/BenoitAnastay/home-assistant-addons-repository (better quality addon)
## 2.5.4 (02-03-2024)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.5.3 (17-02-2024)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.4.3 (03-02-2024)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.4.2 (27-01-2024)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.4.0 (20-01-2024)
- Update to latest version from paperless-ngx/paperless-ngx
### 2.3.3-4 (13-01-2024)
- Tentative fix : paperless not starting https://github.com/alexbelgium/hassio-addons/issues/1178
## 2.3.3 (13-01-2024)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.2.1 (30-12-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.1.3 (23-12-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.1.2 (16-12-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 2.1.1 (09-12-2023)
- Update to latest version from paperless-ngx/paperless-ngx
- Enable imagemagick for pdf https://github.com/alexbelgium/hassio-addons/issues/1118
### 2.0.1-2 (02-12-2023)
- Minor bugs fixed
- Update to latest version from paperless-ngx/paperless-ngx
### 2.0.0.1-12 (24-11-2023)
- Minor bugs fixed
- Switch tag latest to beta except for armv7
### 2.0.0.1-11 (24-11-2023)
- Minor bugs fixed
- Readd armv7 support
### 2.0.0.1-9 (23-11-2023)
- Allow directories to be set from config.yaml (prevent forcing defaults)
### 2.0.0.1-8 (23-11-2023)
- Minor bugs fixed
- Finally all bugs solved !
### 2.0.0.1-6 (22-11-2023)
- Minor bugs fixed
- Allow names with spaces in directory names
### 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
- 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
- Feat : cifsdomain added
### 1.14.4-2 (09-05-2023)
- Minor bugs fixed
- Add variables to bashrc to allow cli with portainer
## 1.14.4 (06-05-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.14.2 (29-04-2023)
- Update to latest version from paperless-ngx/paperless-ngx
### 1.13.0-3 (16-04-2023)
- Minor bugs fixed
## 1.13.0 (19-02-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.12.2 (04-02-2023)
- Update to latest version from paperless-ngx/paperless-ngx
- Added consumption/media/data paths to addon config screen.
## 1.12.1 (28-01-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.11.3 (07-01-2023)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.11.2 (31-12-2022)
- Update to latest version from paperless-ngx/paperless-ngx
- Allow mariadb
- Allow ssl
## 1.10.2 (06-12-2022)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.10.1 (02-12-2022)
- Update to latest version from paperless-ngx/paperless-ngx
## 1.10.0 (28-11-2022)
- Update to latest version from paperless-ngx/paperless-ngx
- WARNING : update to supervisor 2022.11 before installing
## 1.9.2 (02-11-2022)
- Update to latest version from paperless-ngx/paperless-ngx
- BACKUP BEFORE UPDATE : switch to paperless-ngx image. Please backup before switch.
## v1.8.0-ls30 (24-09-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.8.0-ls29 (17-09-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.8.0-ls28 (09-09-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.8.0-ls27 (02-09-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.8.0-ls26 (20-08-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.8.0-ls25 (11-08-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls24 (23-07-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls23 (16-07-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls22 (09-07-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls21 (07-07-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls20 (02-07-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls19 (25-06-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls18 (18-06-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls17 (11-06-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls16 (04-06-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls15 (31-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls14 (19-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls13 (17-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls12 (14-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## v1.7.1-ls10 (12-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.7.0-ls9 (10-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.7.0-ls8 (06-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.7.0-ls7 (01-05-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.7.0-ls6 (29-04-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.7.0-ls5 (27-04-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.6.0-ls4 (14-04-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.6.0-ls3 (09-04-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.6.0-ls2 (02-04-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
## ngx-1.6.0-ls1 (28-03-2022)
- Update to latest version from linuxserver/docker-paperless-ngx
- Major change : switch to paperless NGX
- Add codenotary sign
- Cleanup: config base folder changed to /config/addons_config (thanks @bruvv)
- MultiOCR: in OCRLANG field use comma separated value. Ex: fra,deu (working)
- Manual install pikepdf
- New standardized logic for Dockerfile build and packages installation
- Allow !secrets in config.yaml (see Home Assistant documentation)
## 1.5.0 (27-11-2021)
- Update to latest version from linuxserver/docker-paperless-ng
- Add config.yaml configurable options (see readme)
- Initial build

View File

@@ -0,0 +1,112 @@
#============================#
# ALEXBELGIUM'S DOCKERFILE #
#============================#
# _.------.
# _.-` ('>.-`"""-.
# '.--'` _'` _ .--.)
# -' '-.-';` `
# ' - _.' ``'--.
# '---` .-'""`
# /`
#=== Home Assistant Addon ===#
#################
# 1 Build Image #
#################
ARG BUILD_FROM
ARG BUILD_VERSION
FROM ${BUILD_FROM}
##################
# 2 Modify Image #
##################
# Set S6 wait time
ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
#&& \
# 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 #
##################
# Add rootfs
COPY rootfs/ /
# Modules
ARG MODULES="00-banner.sh 00-local_mounts.sh 00-smb_mounts.sh 01-custom_script.sh"
# Automatic modules download
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"
# Automatic apps & bashio
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 #
################
# Add entrypoint
ENV S6_STAGE2_HOOK=/ha_entrypoint.sh
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh"
# Entrypoint modifications
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
RUN \
# Activate imagemagick
sed -i "s/rights=\"none\"/rights=\"read|write\"/g" /etc/ImageMagick-6/policy.xml
#ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/ha_entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############
# 5 Labels #
############
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
LABEL \
io.hass.name="${BUILD_NAME}" \
io.hass.description="${BUILD_DESCRIPTION}" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.title="${BUILD_NAME}" \
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
org.opencontainers.image.vendor="Home Assistant Add-ons" \
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://github.com/alexbelgium" \
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}
####################
# 6 HealthcheckNOT #
####################

View File

@@ -0,0 +1,78 @@
# Home assistant add-on: Paperless NGX
# ⚠️ It is recommended to use this new addon (https://github.com/BenoitAnastay/home-assistant-addons-repository). It is more robust and has more functions. ⚠️
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fpaperless_ngx%2Fconfig.json)
![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fpaperless_ngx%2Fconfig.json)
![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://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
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
[![Stargazers repo roster for @alexbelgium/hassio-addons](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.github/stars2.svg)](https://github.com/alexbelgium/hassio-addons/stargazers)
![downloads evolution](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/paperless_ngx/stats.png)
## About
[Paperless NGX](https://github.com/paperless-ngx/paperless-ngx) is a document management system that transforms your physical documents into a searchable online archive so you can keep, well, less paper.
Alternative quality addon : https://github.com/BenoitAnastay/home-assistant-addons-repository/tree/main/paperless-ngx
## Configuration
Default username:password is admin:admin. Once logged in, you can change it from within the administration panel.
Options can be configured through two ways :
- Addon options
```yaml
PGID: user
GPID: user
localdisks: sda1 #put the hardware name of your drive to mount separated by commas, or its label. ex. sda1, sdb1, MYNAS...
networkdisks: "<//SERVER/SHARE>" # list of smbv2/3 servers to mount (optional)
cifsusername: "username" # smb username (optional)
cifspassword: "password" # smb password (optional)
CONFIG_LOCATION: Location of the config.yaml (see below)
OCRLANG: eng fra #Any language can be set from this page (always three letters) [here](https://tesseract-ocr.github.io/tessdoc/Data-Files#data-files-for-version-400-november-29-2016).
TZ: Europe/Paris # Sets a specific timezone
```
- Config.yaml
Custom env variables can be added to the config.yaml file referenced in the addon options. Full env variables can be found here : https://paperless-ngx.readthedocs.io/en/latest/configuration.html. It must be entered in a valid yaml format, that is verified at launch of the addon.
## Installation
The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on.
1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA)
[![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons)
1. Install this add-on.
1. Click the `Save` button to store your configuration.
1. Set the add-on options to your preferences
1. Start the add-on.
1. Check the logs of the add-on to see if everything went well.
1. Open the webUI and adapt the software options
## Integration with HA
No specific integration, it is a self hosted system
## Support
Create an issue on github
## Illustration
---
![illustration](https://paperless-ngx.readthedocs.io/en/latest/_images/documents-smallcards.png)

View File

@@ -0,0 +1,67 @@
#include <tunables/global>
profile addon_db21ed7f_paperless_ngx flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
capability,
file,
signal,
mount,
umount,
remount,
network udp,
network tcp,
network dgram,
network stream,
network inet,
network inet6,
network netlink raw,
network unix dgram,
capability setgid,
capability setuid,
capability sys_admin,
capability dac_read_search,
# capability dac_override,
# capability sys_rawio,
# S6-Overlay
/init ix,
/run/{s6,s6-rc*,service}/** ix,
/package/** ix,
/command/** ix,
/run/{,**} rwk,
/dev/tty rw,
/bin/** ix,
/usr/bin/** ix,
/usr/lib/bashio/** ix,
/etc/s6/** rix,
/run/s6/** rix,
/etc/services.d/** rwix,
/etc/cont-init.d/** rwix,
/etc/cont-finish.d/** rwix,
/init rix,
/var/run/** mrwkl,
/var/run/ mrwkl,
/dev/i2c-1 mrwkl,
# Files required
/dev/fuse mrwkl,
/dev/sda1 mrwkl,
/dev/sdb1 mrwkl,
/dev/nvme0 mrwkl,
/dev/nvme1 mrwkl,
/dev/mmcblk0p1 mrwkl,
/dev/ttyUSB0 mrwkl,
/dev/* mrwkl,
/tmp/** mrkwl,
# Data access
/data/** rw,
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
ptrace (trace,read) peer=docker-default,
# docker daemon confinement requires explict allow rule for signal
signal (receive) set=(kill,term) peer=/usr/bin/docker,
}

View File

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

View File

@@ -0,0 +1,139 @@
{
"arch": [
"aarch64",
"amd64"
],
"codenotary": "alexandrep.github@gmail.com",
"description": "Scan, index and archive all your physical documents",
"devices": [
"/dev/dri",
"/dev/dri/card0",
"/dev/dri/card1",
"/dev/dri/renderD128",
"/dev/vchiq",
"/dev/video10",
"/dev/video11",
"/dev/video12",
"/dev/video13",
"/dev/video14",
"/dev/video15",
"/dev/video16",
"/dev/ttyUSB0",
"/dev/sda",
"/dev/sdb",
"/dev/sdc",
"/dev/sdd",
"/dev/sde",
"/dev/sdf",
"/dev/sdg",
"/dev/nvme",
"/dev/nvme0n1p1",
"/dev/nvme0n1p2",
"/dev/nvme0n1p3",
"/dev/nvme1n1p1",
"/dev/nvme1n1p2",
"/dev/nvme1n1p3",
"/dev/nvme2n1p1",
"/dev/nvme2n1p2",
"/dev/nvme3n1p3",
"/dev/mmcblk",
"/dev/fuse",
"/dev/sda1",
"/dev/sdb1",
"/dev/sdc1",
"/dev/sdd1",
"/dev/sde1",
"/dev/sdf1",
"/dev/sdg1",
"/dev/sda2",
"/dev/sdb2",
"/dev/sdc2",
"/dev/sdd2",
"/dev/sde2",
"/dev/sdf2",
"/dev/sdg2",
"/dev/sda3",
"/dev/sdb3",
"/dev/sda4",
"/dev/sdb4",
"/dev/sda5",
"/dev/sda6",
"/dev/sda7",
"/dev/sda8",
"/dev/nvme0",
"/dev/nvme1",
"/dev/nvme2"
],
"environment": {
"PAPERLESS_ADMIN_PASSWORD": "admin",
"PAPERLESS_ADMIN_USER": "admin",
"PAPERLESS_CONSUMPTION_DIR": "/config/consume",
"PAPERLESS_DATA_DIR": "/config/data",
"PAPERLESS_EXPORT_DIR": "/config/export",
"PAPERLESS_MEDIA_ROOT": "/config/media",
"PGID": "0",
"PUID": "0"
},
"image": "ghcr.io/alexbelgium/paperless_ng-{arch}",
"init": false,
"map": [
"addon_config:rw",
"homeassistant_config:rw",
"share:rw",
"media:rw",
"ssl"
],
"name": "zzz_archived - Paperless NGX",
"options": {
"CONFIG_LOCATION": "/config/config.yaml",
"OCRLANG": "ENG FRA DEU",
"PAPERLESS_OCR_MODE": "skip",
"PGID": 0,
"PUID": 0,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"ssl": true
},
"ports": {
"8000/tcp": 8011,
"8443/tcp": null
},
"ports_description": {
"8000/tcp": "http web interface",
"8443/tcp": "https web interface"
},
"privileged": [
"SYS_ADMIN",
"DAC_READ_SEARCH"
],
"schema": {
"CONFIG_LOCATION": "str",
"OCRLANG": "str?",
"PAPERLESS_CONSUMPTION_DIR": "str?",
"PAPERLESS_DATA_DIR": "str?",
"PAPERLESS_MEDIA_ROOT": "str?",
"PAPERLESS_OCR_MODE": "list(skip|redo|force|skip_noarchive)?",
"PAPERLESS_URL": "str?",
"PGID": "int",
"PUID": "int",
"TZ": "str?",
"certfile": "str",
"cifsdomain": "str?",
"cifspassword": "str?",
"cifsusername": "str?",
"database": "list(|sqlite|mariadb_addon)?",
"keyfile": "str",
"localdisks": "str?",
"networkdisks": "str?",
"ssl": "bool"
},
"services": [
"mysql:want"
],
"slug": "paperless_ng",
"stage": "deprecated",
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "2.5.4",
"webui": "http://[HOST]:[PORT:8000]"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,19 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
echo ""
bashio::log.yellow "####################"
bashio::log.yellow "# ADDON deprecated #"
bashio::log.yellow "####################"
echo ""
bashio::log.yellow "A better alternative is existing for paperless NGX managed by BenoitAnastay : https://github.com/BenoitAnastay/home-assistant-addons-repository"
bashio::log.yellow "It is recommended to transfer to his version that will be more robust and include ingress"
bashio::log.yellow "Thanks for all users over the years !"
echo ""
sleep 5

View File

@@ -0,0 +1,13 @@
#!/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
mkdir -p /config/data
mv /homeassistant/addons_config/"$slug"/* /config/data/ || true
rm -r /homeassistant/addons_config/"$slug"
fi

View File

@@ -0,0 +1,24 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
if bashio::config.true 'ssl'; then
# Validate ssl
bashio::config.require.ssl
# Adapt nginx template
certfile=$(bashio::config 'certfile')
keyfile=$(bashio::config 'keyfile')
sed -i "s#%%certfile%%#${certfile}#g" /etc/nginx/servers/direct.conf
sed -i "s#%%keyfile%%#${keyfile}#g" /etc/nginx/servers/direct.conf
# Configure URL
if bashio::config.has_value "PAPERLESS_URL"; then
bashio::log.warning "Ssl enabled, your site will be available at $(bashio::config "PAPERLESS_URL"). Don't forget to enable the https alternative port in the addon options."
else
bashio::log.fatal "PAPERLESS_URL not set, you won't be able to access your site (CSRF error)"
fi
else
sed -i "s|default_server ssl|default_server|g" /etc/nginx/servers/direct.conf
sed -i "/ssl/d" /etc/nginx/servers/direct.conf
fi

View File

@@ -0,0 +1,123 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# shellcheck disable=SC2155
####################
# Define 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 "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,,}"
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_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_EXPORT_DIR"; then export PAPERLESS_EXPORT_DIR="$(bashio::config "PAPERLESS_EXPORT_DIR")"; 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
echo "Creating directory \"$variable\""
mkdir -p "$variable"
chmod -R 755 "$variable"
chown -R paperless:paperless "$variable"
done
###################
# Define database #
###################
bashio::log.info "Defining database"
case "$(bashio::config 'database')" in
# Use mariadb
mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
if ! bashio::services.available 'mysql'; then
bashio::log.fatal \
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
fi
# Use values
export PAPERLESS_DBENGINE=mariadb
export PAPERLESS_DBHOST="$(bashio::services 'mysql' 'host')"
export PAPERLESS_DBPORT="$(bashio::services 'mysql' 'port')"
export PAPERLESS_DBNAME=paperless
export PAPERLESS_DBUSER="$(bashio::services "mysql" "username")"
export PAPERLESS_DBPASS="$(bashio::services "mysql" "password")"
# Create database
mysql --host="$PAPERLESS_DBHOST" --port="$PAPERLESS_DBPORT" --user="$PAPERLESS_DBUSER" --password="$PAPERLESS_DBPASS" -e"CREATE DATABASE IF NOT EXISTS $PAPERLESS_DBNAME;"
# Informations
bashio::log.warning "This addon is using the Maria DB addon"
bashio::log.warning "Please ensure this is included in your backups"
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
;;
# Use sqlite
*)
bashio::log.info "Using sqlite as database driver"
;;
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_DBENGINE PAPERLESS_DBHOST PAPERLESS_DBPORT PAPERLESS_DBNAME PAPERLESS_DBUSER PAPERLESS_DBPASS; do
# Skip if not defined
if [[ -z "$(eval echo "\$$variable")" ]]; then continue; fi
# Variable content
variablecontent="$(eval echo "\$$variable")"
# Sanitize " ' ` in current variable
variablecontent="${variablecontent//[\"\'\`]/}"
#if [[ "$variablecontent" = *" "* ]] && [[ "$variable" != "PAPERLESS_OCR_LANGUAGES" ]]; then
# variablecontent="\"$variablecontent\""
#fi
bashio::log.blue "$variable=\"$variablecontent\""
# Add to entrypoint
sed -i "1a export $variable=\"$variablecontent\"" /sbin/docker-entrypoint.sh
# 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
#################
# Staring redis #
#################
exec redis-server & bashio::log.info "Starting redis"
#################
# Staring nginx #
#################
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."

View File

@@ -0,0 +1,96 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@@ -0,0 +1,16 @@
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_hide_header X-Frame-Options;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;

View File

@@ -0,0 +1 @@
resolver 127.0.0.11 ipv6=off;

View File

@@ -0,0 +1,6 @@
root /dev/null;
server_name $hostname;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;

View File

@@ -0,0 +1,9 @@
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_ecdh_curve secp384r1;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;

View File

@@ -0,0 +1,3 @@
upstream backend {
server 127.0.0.1:8001;
}

View File

@@ -0,0 +1,57 @@
# Run nginx in foreground.
daemon off;
# This is run inside Docker.
user root;
# Pid storage location.
pid /var/run/nginx.pid;
# Set number of worker processes.
worker_processes 1;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;
# Write error log to Hass.io add-on log.
error_log /proc/1/fd/1 error;
# Load allowed environment vars
env HASSIO_TOKEN;
# Load dynamic modules.
include /etc/nginx/modules/*.conf;
# Max num of simultaneous connections by a worker process.
events {
worker_connections 512;
}
http {
include /etc/nginx/includes/mime.types;
log_format hassio '[$time_local] $status '
'$http_x_forwarded_for($remote_addr) '
'$request ($http_user_agent)';
access_log /proc/1/fd/1 hassio;
client_max_body_size 4G;
default_type application/octet-stream;
gzip on;
keepalive_timeout 65;
sendfile on;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
include /etc/nginx/includes/resolver.conf;
include /etc/nginx/includes/upstream.conf;
include /etc/nginx/servers/*.conf;
}

View File

@@ -0,0 +1,27 @@
server {
listen 8443 default_server ssl;
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/ssl_params.conf;
include /etc/nginx/includes/proxy_params.conf;
ssl_certificate /ssl/%%certfile%%;
ssl_certificate_key /ssl/%%keyfile%%;
location / {
# Adjust host and port as required.
proxy_pass http://127.0.0.1:8000/;
# These configuration options are required for WebSockets to work.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}

View File

@@ -0,0 +1,12 @@
#============================#
# ALEXBELGIUM'S ENV INJECTOR #
#============================#
#
# All env variables set in this file will be enabled in the app
# This allows enabling more options that normally available in the addon options
# This file must be filled according to the yaml format. If the format is invalid, the addon will note an error. To validate your yaml, you can use the free online tool http://www.yamllint.com/
# EXAMPLE of the format (you need to remove the # for it to become active)
# TZ: Europe/Paris
PAPERLESS_OCR_LANGUAGE: eng
PAPERLESS_OCR_MODE: skip

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,10 @@
{
"github_beta": "false",
"github_fulltag": "false",
"last_update": "02-03-2024",
"repository": "alexbelgium/hassio-addons",
"slug": "paperless_ng",
"source": "github",
"upstream_repo": "paperless-ngx/paperless-ngx",
"upstream_version": "2.5.4"
}