├── paperless-ngx ├── .dockerignore ├── icon.png ├── logo.png ├── data │ └── options.json ├── build.json ├── scripts │ ├── wait-for-redis.sh │ ├── setup_superuser.py │ ├── docker-prepare.sh │ └── docker-entrypoint.sh ├── config.json ├── CHANGELOG.md ├── README.md ├── DOCS.md ├── Dockerfile ├── docker-compose.yml └── redis.conf ├── ingress-proxy ├── rootfs │ └── etc │ │ ├── nginx │ │ ├── includes │ │ │ ├── upstream.conf │ │ │ ├── server_params.conf │ │ │ ├── proxy_params.conf │ │ │ └── mime.types │ │ ├── servers │ │ │ └── .gitkeep │ │ ├── templates │ │ │ └── direct.gtpl │ │ └── nginx.conf │ │ ├── services.d │ │ └── nginx │ │ │ ├── run │ │ │ └── finish │ │ └── cont-init.d │ │ └── nginx.sh ├── build.yaml ├── config.yaml └── Dockerfile ├── repository.json ├── .vscode └── settings.json ├── .github └── workflows │ ├── test.yml │ └── publish.yml └── README.md /paperless-ngx/.dockerignore: -------------------------------------------------------------------------------- 1 | data/ -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/nginx/includes/upstream.conf: -------------------------------------------------------------------------------- 1 | upstream backend { 2 | server 127.0.0.1:80; 3 | } 4 | -------------------------------------------------------------------------------- /paperless-ngx/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tux2000/home-assistant-addons/HEAD/paperless-ngx/icon.png -------------------------------------------------------------------------------- /paperless-ngx/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tux2000/home-assistant-addons/HEAD/paperless-ngx/logo.png -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/services.d/nginx/run: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bashio 2 | 3 | bashio::log.info "Starting NGINX..." 4 | 5 | exec nginx 6 | -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/nginx/servers/.gitkeep: -------------------------------------------------------------------------------- 1 | Without requirements or design, programming is the art of adding bugs to an empty text file. (Louis Srygley) -------------------------------------------------------------------------------- /repository.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tux2000's HA Addons", 3 | "url": "https://github.com/tux2000/home-assistant-addons", 4 | "maintainer": "Tux2000" 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "gitpod", 4 | "homeassistant", 5 | "streetsidesoftware", 6 | "superviser" 7 | ] 8 | } -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/nginx/includes/server_params.conf: -------------------------------------------------------------------------------- 1 | server_name $hostname; 2 | root /data; 3 | 4 | client_max_body_size 64M; 5 | 6 | 7 | location ~ /\.ht { 8 | deny all; 9 | } 10 | -------------------------------------------------------------------------------- /ingress-proxy/build.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | build_from: 3 | aarch64: ghcr.io/hassio-addons/base:12.2.2 4 | amd64: ghcr.io/hassio-addons/base:12.2.2 5 | armhf: ghcr.io/hassio-addons/base:12.2.2 6 | armv7: ghcr.io/hassio-addons/base:12.2.2 7 | i386: ghcr.io/hassio-addons/base:12.2.2 8 | -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/services.d/nginx/finish: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bashio 2 | if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then 3 | bashio::log.warning "NGINX crashed, halting add-on" 4 | /run/s6/basedir/bin/halt 5 | fi 6 | 7 | bashio::log.info "NGINX stopped, restarting..." 8 | -------------------------------------------------------------------------------- /paperless-ngx/data/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_superuser": { 3 | "username": "admin", 4 | "email": "admin@example.com", 5 | "password": "password123" 6 | }, 7 | "ocr": { 8 | "language": "eng" 9 | }, 10 | "filename": { 11 | "format": "{created_year}/{correspondent}/{title}" 12 | } 13 | } -------------------------------------------------------------------------------- /paperless-ngx/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "build_from": { 3 | "armhf": "homeassistant/armhf-base-debian:latest", 4 | "armv7": "homeassistant/armv7-base-debian:latest", 5 | "aarch64": "homeassistant/aarch64-base-debian:latest", 6 | "amd64": "homeassistant/amd64-base-debian:latest", 7 | "i386": "homeassistant/i386-base-debian:latest" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/cont-init.d/nginx.sh: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bashio 2 | 3 | DESTINATION=$(bashio::config 'destination') 4 | 5 | bashio::log.info "Destination: ${DESTINATION}" 6 | 7 | bashio::var.json \ 8 | destination "$(bashio::config 'destination')" \ 9 | | tempio \ 10 | -template /etc/nginx/templates/direct.gtpl \ 11 | -out /etc/nginx/servers/direct.conf 12 | -------------------------------------------------------------------------------- /paperless-ngx/scripts/wait-for-redis.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # https://github.com/Hronom/wait-for-redis 4 | 5 | redis-server --daemonize yes 6 | 7 | echo "Start waiting for Redis fully start. Host '$HOST', '$PORT'..." 8 | echo "Try ping Redis... " 9 | PONG=`redis-cli ping | grep PONG` 10 | while [ -z "$PONG" ]; do 11 | sleep 1 12 | echo "Retry Redis ping... " 13 | PONG=`redis-cli ping | grep PONG` 14 | done 15 | echo "Redis fully started." -------------------------------------------------------------------------------- /ingress-proxy/config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ingress proxy 3 | version: 0.2.4 4 | slug: ingress_proxy 5 | description: nginx reverse proxy to expose network resources through HA ingress 6 | webui: "[PROTO:ssl]://[HOST]:[PORT:80]" 7 | init: false 8 | ingress: true 9 | arch: 10 | - aarch64 11 | - amd64 12 | - armhf 13 | - armv7 14 | - i386 15 | map: 16 | - ssl 17 | options: 18 | destination: "http://192.168.0.1" 19 | schema: 20 | destination: str? 21 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: 'Test' 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | name: Test build of paperless-ngx 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout the repository 11 | uses: actions/checkout@v2 12 | - name: Test build 13 | uses: home-assistant/builder@master 14 | with: 15 | args: | 16 | --test \ 17 | --all \ 18 | --target paperless-ngx \ 19 | --docker-hub ${{ secrets.DOCKERHUB_USERNAME }} 20 | -------------------------------------------------------------------------------- /paperless-ngx/scripts/setup_superuser.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from django.contrib.auth import get_user_model 4 | from django.db.utils import IntegrityError 5 | 6 | USERNAME = os.getenv("DEFAULT_USERNAME") 7 | EMAIL = os.getenv("DEFAULT_EMAIL") 8 | PASSWORD = os.getenv("DEFAULT_PASSWORD") 9 | 10 | try: 11 | User = get_user_model() 12 | User.objects.create_superuser(USERNAME, EMAIL, PASSWORD) 13 | print("Default admin user created") 14 | except IntegrityError as error: 15 | print("User already created. Skiping...") 16 | -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/nginx/includes/proxy_params.conf: -------------------------------------------------------------------------------- 1 | proxy_http_version 1.1; 2 | proxy_ignore_client_abort off; 3 | proxy_read_timeout 86400s; 4 | #proxy_redirect off; 5 | proxy_send_timeout 86400s; 6 | proxy_max_temp_file_size 0; 7 | 8 | proxy_set_header Accept-Encoding ""; 9 | proxy_set_header Connection $connection_upgrade; 10 | proxy_set_header Host $http_host; 11 | proxy_set_header Upgrade $http_upgrade; 12 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 13 | proxy_set_header X-Forwarded-Proto $scheme; 14 | proxy_set_header X-NginX-Proxy true; 15 | proxy_set_header X-Real-IP $remote_addr; 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Addons Repository 2 | 3 | ## About 4 | 5 | Home Assistant allows anyone to create add-on repositories to share their add-ons for Home Assistant easily. This repository is one of those repositories, providing extra Home Assistant add-ons for your installation. 6 | 7 | In the Home Assistant add-on store, a possibility to add a repository is provided. 8 | 9 | Use the following URL to add this repository: 10 | 11 | ``` 12 | https://github.com/tux2000/home-assistant-addons 13 | ``` 14 | 15 | ## Add-ons provided by this repository 16 | 17 | ### [Paperless-ngx](paperless-ngx) 18 | 19 | [Docs](paperless-ngx/DOCS.md) 20 | 21 | 22 | ### [ingress-proxy](ingress-proxy) 23 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: 'Publish' 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | publish: 9 | name: Publish 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout the repository 13 | uses: actions/checkout@v2 14 | - name: Login to DockerHub 15 | uses: docker/login-action@v1 16 | with: 17 | username: ${{ secrets.DOCKERHUB_USERNAME }} 18 | password: ${{ secrets.DOCKERHUB_TOKEN }} 19 | - name: Publish 20 | uses: home-assistant/builder@master 21 | with: 22 | args: | 23 | --all \ 24 | --target paperless-ngx \ 25 | --docker-hub ${{ secrets.DOCKERHUB_USERNAME }} 26 | -------------------------------------------------------------------------------- /ingress-proxy/rootfs/etc/nginx/templates/direct.gtpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8099 default_server; 3 | 4 | include /etc/nginx/includes/server_params.conf; 5 | 6 | location / { 7 | absolute_redirect off; 8 | 9 | proxy_set_header Host $host; 10 | proxy_set_header X-Real-IP $remote_addr; 11 | proxy_set_header Origin ""; 12 | proxy_pass {{ .destination }}; 13 | proxy_redirect '/' $http_x_ingress_path/; 14 | sub_filter 'href="/' 'href="$http_x_ingress_path/'; 15 | sub_filter '