From 70acea0a3fe907b832668debc7f8f805ff91638f Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:32:11 +0200 Subject: [PATCH] photoprism: make url more clear that needs scheme (#1152) --- ix-dev/stable/photoprism/app.yaml | 2 +- ix-dev/stable/photoprism/questions.yaml | 9 +++++++-- ix-dev/stable/photoprism/templates/docker-compose.yaml | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ix-dev/stable/photoprism/app.yaml b/ix-dev/stable/photoprism/app.yaml index c3ec80e880..ab4d5f4f2e 100644 --- a/ix-dev/stable/photoprism/app.yaml +++ b/ix-dev/stable/photoprism/app.yaml @@ -42,4 +42,4 @@ sources: - https://photoprism.app/ title: Photoprism train: stable -version: 1.2.1 +version: 1.2.2 diff --git a/ix-dev/stable/photoprism/questions.yaml b/ix-dev/stable/photoprism/questions.yaml index 6243b050dd..78b235bd1d 100644 --- a/ix-dev/stable/photoprism/questions.yaml +++ b/ix-dev/stable/photoprism/questions.yaml @@ -21,9 +21,14 @@ questions: attrs: - variable: site_url label: Site URL - description: The URL for the Photoprism site. + description: | + The URL for the Photoprism site.
+ Examples: + - https://photoprism.example.com/photoprism + - https://photoprism.example.com + - http://photoprism.example.com schema: - type: string + type: uri - variable: public label: Public description: | diff --git a/ix-dev/stable/photoprism/templates/docker-compose.yaml b/ix-dev/stable/photoprism/templates/docker-compose.yaml index 995dccd2c4..433853721e 100644 --- a/ix-dev/stable/photoprism/templates/docker-compose.yaml +++ b/ix-dev/stable/photoprism/templates/docker-compose.yaml @@ -17,6 +17,10 @@ {% do c1.environment.add_env("PHOTOPRISM_ORIGINALS_PATH", values.consts.originals_path) %} {% if values.photoprism.site_url %} + {% if "http://" not in values.photoprism.site_url and "https://" not in values.photoprism.site_url %} + {% do tpl.funcs.fail("Site URL must include a scheme (http:// or https://)") %} + {% endif %} + {% do c1.environment.add_env("PHOTOPRISM_SITE_URL", values.photoprism.site_url) %} {% set no_scheme = values.photoprism.site_url.split("://")[1] %} {% set path = no_scheme.split("/")[1:] %}