From c01b8b66f1c25310c4666d3335a4b2df32352201 Mon Sep 17 00:00:00 2001 From: Wolfgang Silbermayr <w.silbermayr@opentalk.eu> Date: Tue, 25 Mar 2025 16:12:33 +0100 Subject: [PATCH] feat(container): generate .well-known/opentalk/client file Closes #1497 --- ci/entrypoint.sh | 19 ++++++++++++++++++- ci/nginx-default.conf.template | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh index a730b86a5..29b92c95f 100644 --- a/ci/entrypoint.sh +++ b/ci/entrypoint.sh @@ -3,6 +3,9 @@ # SPDX-FileCopyrightText: OpenTalk GmbH <mail@opentalk.eu> # # SPDX-License-Identifier: EUPL-1.2 + +HTML_ROOT=/usr/share/nginx/html + ACTIVE_FEATURES="{ userSearch: ${FEATURE_USER_SEARCH:-true}, muteUsers: ${FEATURE_MUTE_USER:-true}, @@ -61,7 +64,7 @@ if [[ x"${KEYCLOAK_AUTHORITY}" != "x" ]]; then OIDC_ISSUER=$KEYCLOAK_AUTHORITY fi -cat >/usr/share/nginx/html/config.js << EOF +cat >$HTML_ROOT/config.js << EOF window.config = { logLevel: "${LOG_LEVEL:-info}", controller: "${CONTROLLER_HOST}", @@ -119,3 +122,17 @@ window.config = { } } EOF + +CONTROLLER_SCHEMA="https" +if [ "$INSECURE" = "true" ]; then + CONTROLLER_SCHEMA="http" +fi + +mkdir -p $HTML_ROOT/.well-known/opentalk +cat >$HTML_ROOT/.well-known/opentalk/client << EOF +{ + "opentalk_controller": { + "base_url": "$CONTROLLER_SCHEMA://$CONTROLLER_HOST" + } +} +EOF diff --git a/ci/nginx-default.conf.template b/ci/nginx-default.conf.template index 6340ef4e4..2cda7269f 100644 --- a/ci/nginx-default.conf.template +++ b/ci/nginx-default.conf.template @@ -41,6 +41,10 @@ http { location /static { add_header Cache-Control 'public, no-transform, immutable'; } + + location /.well-known/opentalk/client { + default_type application/json; + } } } } -- GitLab