diff --git a/.editorconfig b/.editorconfig index b7a329e..ec07101 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,9 +16,3 @@ tab_width = 2 [*.md] trim_trailing_whitespace = false - -[*.py] -end_of_line = lf -indent_style = space -indent_size = 4 -tab_width = 4 diff --git a/.gitignore b/.gitignore index ba238b6..8682eff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .env -**/.vscode/* -paperless/scripts/passwords.txt +**/.vscode/* \ No newline at end of file diff --git a/dashboard/docker-compose.yaml b/dashboard/docker-compose.yaml index a6b4896..f13d8aa 100644 --- a/dashboard/docker-compose.yaml +++ b/dashboard/docker-compose.yaml @@ -1,19 +1,22 @@ services: - homer: - image: b4bz/homer + app: + image: linuxserver/heimdall:${HEIMDALL_VERSION} + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/Berlin volumes: - - ${VOLUMES_PATH}/dashboard/homer:/www/assets + - ${VOLUMES_PATH}/dashboard/heimdall:/config + expose: + - "80" networks: - web - user: 1000:1000 - environment: - - INIT_ASSETS=1 labels: - "traefik.enable=true" - - "traefik.http.routers.homer.rule=Host(`dashboard.${DOMAIN}`)" - - "traefik.http.routers.homer.entrypoints=web" - - "traefik.http.services.homer.loadbalancer.server.port=8080" + - "traefik.http.routers.heimdall.rule=Host(`dashboard.${DOMAIN}`)" + - "traefik.http.routers.heimdall.entrypoints=web" + - "traefik.http.services.heimdall.loadbalancer.server.port=80" - "docker.group=dashboard" restart: unless-stopped diff --git a/doc/manual.md b/doc/manual.md deleted file mode 100644 index a613734..0000000 --- a/doc/manual.md +++ /dev/null @@ -1,62 +0,0 @@ -# Manual and Help - -## Upgrade Postgrs to newer Version (i.e. 15 to 16) - - -### 1. Copy Service - -1.1 Copy whole service definition in docker-compose.yaml -1.2 Rename old service to *-old -1.3 Move path from new service to i.e postgres16 -1.4 Set postgres version explicit to new version - -Example: -``` - databasedb-old: - image: postgres:${POSTGRES_VERSION} - volumes: - - ${VOLUMES_PATH}/databasedb:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${POSTGRES_DB} - - POSTGRES_USER=${POSTGRES_USER} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - databasedb: - image: postgres:16 - volumes: - - ${VOLUMES_PATH}/databasedb16:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${POSTGRES_DB} - - POSTGRES_USER=${POSTGRES_USER} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} -``` - -### 2. Move data -Backup data from service one to new servic with the following command: -``` -docker exec old-service pg_dumpall -U dbuser | docker exec -i new-service psql -U dbuser -d database -``` - -### 3. Set password -``` -docker exec -i monitoring-databasedb-1 psql -U dbuser -d database -c "ALTER USER \"dbuser\" PASSWORD 'secret';" -``` - -### 4. Test -```docker compose up -d``` and check if service is correctly running. - -### 5. Cleanup -5.1 Remove old service in docker-compose.yaml -5.2 Set explicit version again to ${POSTGRES_VERSION} and adopt .env file -5.4 remove old volume dir - - -### 6. May be move Data dir -6.1. ```docker compose down``` -6.2 ```mv /mnt/dockervolumes/databasedb16 /mnt/dockervolumes/databasedb``` -6.3 docker-compose.yaml anpassen -6.1. ```docker compose up -d``` - - - - diff --git a/paperless/docker-compose.yaml b/paperless/docker-compose.yaml index 53c1caf..9e77420 100644 --- a/paperless/docker-compose.yaml +++ b/paperless/docker-compose.yaml @@ -40,7 +40,7 @@ services: retries: 5 volumes: - ${VOLUMES_PATH}/paperless/data:/usr/src/paperless/data - - ./scripts:/usr/src/paperless/scripts + - ${VOLUMES_PATH}/paperless/scripts:/usr/src/paperless/scripts - ${MEDIA_PATH}:/usr/src/paperless/media - ${EXPORT_PATH}:/usr/src/paperless/export - ${CONSUME_PATH}:/usr/src/paperless/consume diff --git a/paperless/scripts/removePdfPassword.py b/paperless/scripts/removePdfPassword.py deleted file mode 100755 index 57942e6..0000000 --- a/paperless/scripts/removePdfPassword.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -"""Script for papeless-ngx to decrypt pdf files secured with a password -Passwords to check ar in file /usr/src/paperless/scripts/passwords.txt -Original from https://piep.tech/posts/automatic-password-removal-in-paperless-ngx/ -""" - -import sys -import os -import pikepdf - - -PWD_PATH = "/usr/src/paperless/scripts/passwords.txt" -#PWD_PATH = "input/passwords.txt" - - -def read_passwords_from_file(): - """Read Paswors from file""" - passwords = [] - - with open(PWD_PATH, "r", encoding="utf-8") as f: - passwords = f.readlines() - - passwords = list(filter(len, map(str.strip, passwords))) - if not passwords: - print("Empty password file") - - passwords.append("") # some PDFs are encrypted with empty password - return passwords - - -def unlock_pdf(file_path, password_list): - """Removes Password from PDF. A list of passwords is tried through.""" - for pwd in password_list: - try: - with pikepdf.open(file_path, password=pwd, allow_overwriting_input=True) as pdf: - pdf.save(file_path) - return True - except pikepdf.PasswordError: - continue - return False - - -def is_pdf_encrypted(file_path): - """Checks if a PDF file is encrypted""" - try: - with pikepdf.open(file_path) as pdf: - return pdf.is_encrypted - except pikepdf.PasswordError: - return True - - -def is_pdf(file_path): - """Check if Filename ends with PDF. File is not opened""" - return os.path.splitext(file_path)[-1].lower() == ".pdf" - - -if __name__ == "__main__": - - doc_path = os.environ.get('DOCUMENT_WORKING_PATH') - - if not doc_path: - doc_path = sys.argv[1] - - if not doc_path: - print("Neither DOCUMENT_WORKING_PATH set nor document passed by parameter.") - sys.exit(1) - - if not os.path.exists(doc_path): - print(f"Document {doc_path} not found.") - sys.exit(1) - - if not is_pdf(doc_path): - print(f"Document {doc_path} is not a PDF. So no decryption needed.") - sys.exit(0) - - if not is_pdf_encrypted(doc_path): - print(f"Document {doc_path} was already decrypted and no password needed.") - sys.exit(0) - - pwds = read_passwords_from_file() - if unlock_pdf(doc_path, pwds): - print(f"Document {doc_path} successfull decrypted.") - sys.exit(0) - else: - print(f"Document {doc_path} could not be decrypted.") - sys.exit(1) diff --git a/smartHome/docker-compose.yaml b/smartHome/docker-compose.yaml index 52b697a..5e15c6e 100644 --- a/smartHome/docker-compose.yaml +++ b/smartHome/docker-compose.yaml @@ -1,7 +1,7 @@ services: homeassistant: - image: ghcr.io/home-assistant/home-assistant:${HASSI_VERSION} + image: ghcr.io/home-assistant/home-assistant:stable volumes: - ${VOLUMES_PATH}/smartHome/homeassistent:/config - /run/dbus:/run/dbus:ro @@ -17,7 +17,7 @@ services: - "docker.group=smartHome" mqttbroker: - image: eclipse-mosquitto:${MOSQUITTO_VERSION} + image: eclipse-mosquitto:2.0 restart: unless-stopped network_mode: host expose: