From 979beeaf68c61b10d8204208d793bd1aa79e61ea Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Fri, 9 Sep 2022 15:23:26 -0400 Subject: [PATCH 1/4] Properly expose Photoprism --- apps/photoprism/config.json | 18 +++++++++++++++++- apps/photoprism/docker-compose.yml | 18 ++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/apps/photoprism/config.json b/apps/photoprism/config.json index 972e43c9..2ac458bb 100644 --- a/apps/photoprism/config.json +++ b/apps/photoprism/config.json @@ -4,7 +4,7 @@ "port": 8110, "available": true, "id": "photoprism", - "tipi_version": 1, + "tipi_version": 2, "version": "latest", "categories": ["photography"], "description": "PhotoPrism® is an AI-Powered Photos App for the Decentralized Web. It makes use of the latest technologies to tag and find pictures automatically without getting in your way. You can run it at home, on a private server, or in the cloud. Default username: admin", @@ -19,6 +19,22 @@ "min": 8, "required": true, "env_variable": "PHOTOPRISM_ADMIN_PASSWORD" + }, + { + "type": "random", + "label": "Photoprism DB password", + "max": 50, + "min": 8, + "required": true, + "env_variable": "DB_PASSWORD" + }, + { + "type": "random", + "label": "Photoprism root DB password", + "max": 50, + "min": 8, + "required": true, + "env_variable": "DB_ROOT_PASSWORD" } ] } diff --git a/apps/photoprism/docker-compose.yml b/apps/photoprism/docker-compose.yml index 1ffa33bc..2b2d5d7e 100644 --- a/apps/photoprism/docker-compose.yml +++ b/apps/photoprism/docker-compose.yml @@ -1,5 +1,4 @@ version: "3.7" - services: photoprism: # TODO: Special image for arm/v7 is available @@ -12,7 +11,7 @@ services: - "${APP_PORT}:2342" environment: PHOTOPRISM_ADMIN_PASSWORD: ${PHOTOPRISM_ADMIN_PASSWORD} - PHOTOPRISM_SITE_URL: "http://localhost:2342/" + PHOTOPRISM_SITE_URL: "https://${APP_DOMAIN}/" PHOTOPRISM_ORIGINALS_LIMIT: 5000 PHOTOPRISM_HTTP_COMPRESSION: "gzip" PHOTOPRISM_LOG_LEVEL: "info" @@ -34,7 +33,7 @@ services: PHOTOPRISM_DATABASE_SERVER: "photoprism-db:3306" PHOTOPRISM_DATABASE_NAME: "photoprism" PHOTOPRISM_DATABASE_USER: "photoprism" - PHOTOPRISM_DATABASE_PASSWORD: "photoprism" + PHOTOPRISM_DATABASE_PASSWORD: "${DB_PASSWORD}" PHOTOPRISM_SITE_CAPTION: "AI-Powered Photos App" working_dir: "/photoprism" volumes: @@ -42,10 +41,17 @@ services: - "${APP_DATA_DIR}/data/photoprism/storage:/photoprism/storage" networks: - tipi_main_network + labels: + traefik.enable: ${APP_EXPOSED} + traefik.http.routers.photoprism.rule: Host(`${APP_DOMAIN}`) + traefik.http.routers.photoprism.entrypoints: websecure + traefik.http.routers.photoprism.service: photoprism + traefik.http.routers.photoprism.tls.certresolver: myresolver + traefik.http.services.photoprism.loadbalancer.server.port: 2342 photoprism-db: restart: unless-stopped - image: mariadb:10.8.3 + image: mariadb:10.8 container_name: photoprism-db command: mysqld --innodb-buffer-pool-size=128M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120 volumes: @@ -53,7 +59,7 @@ services: environment: MARIADB_DATABASE: "photoprism" MARIADB_USER: "photoprism" - MARIADB_PASSWORD: "photoprism" - MARIADB_ROOT_PASSWORD: "photoprism" + MARIADB_PASSWORD: "${DB_PASSWORD}" + MARIADB_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}" networks: - tipi_main_network From fe4931ddce7b4a75b6a86e7566e59c8a5acea96d Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Fri, 9 Sep 2022 15:30:51 -0400 Subject: [PATCH 2/4] Add "exposable": true to config.json --- apps/photoprism/config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/photoprism/config.json b/apps/photoprism/config.json index 2ac458bb..98f59b20 100644 --- a/apps/photoprism/config.json +++ b/apps/photoprism/config.json @@ -3,6 +3,7 @@ "name": "PhotoPrism", "port": 8110, "available": true, + "exposable": true, "id": "photoprism", "tipi_version": 2, "version": "latest", From f34d684856cf851ac959b8e74dbf3dfd47e11d38 Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Fri, 9 Sep 2022 16:43:16 -0400 Subject: [PATCH 3/4] Make SITE_URL conditional --- apps/photoprism/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/photoprism/docker-compose.yml b/apps/photoprism/docker-compose.yml index 2b2d5d7e..4c615400 100644 --- a/apps/photoprism/docker-compose.yml +++ b/apps/photoprism/docker-compose.yml @@ -11,7 +11,7 @@ services: - "${APP_PORT}:2342" environment: PHOTOPRISM_ADMIN_PASSWORD: ${PHOTOPRISM_ADMIN_PASSWORD} - PHOTOPRISM_SITE_URL: "https://${APP_DOMAIN}/" + PHOTOPRISM_SITE_URL: "${APP_PROTOCOL:-http}://${APP_DOMAIN}/" PHOTOPRISM_ORIGINALS_LIMIT: 5000 PHOTOPRISM_HTTP_COMPRESSION: "gzip" PHOTOPRISM_LOG_LEVEL: "info" From 6c33dcb685e245907a171c696a65b7bf539cef6a Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sun, 11 Sep 2022 15:14:01 +0200 Subject: [PATCH 4/4] fix: config --- apps/photoprism/config.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/photoprism/config.json b/apps/photoprism/config.json index 98f59b20..e432da82 100644 --- a/apps/photoprism/config.json +++ b/apps/photoprism/config.json @@ -24,17 +24,11 @@ { "type": "random", "label": "Photoprism DB password", - "max": 50, - "min": 8, - "required": true, "env_variable": "DB_PASSWORD" }, { "type": "random", "label": "Photoprism root DB password", - "max": 50, - "min": 8, - "required": true, "env_variable": "DB_ROOT_PASSWORD" } ]