From 331a3beb559511611081444c1c89b7242e77416e Mon Sep 17 00:00:00 2001 From: Timshel Date: Tue, 5 Mar 2024 16:31:38 +0100 Subject: [PATCH] Toggle SSO button depending on SSO_ENABLED in docker start --- docker/keycloak/docker-compose.yml | 4 +--- docker/keycloak/vaultwarden.sh | 4 ---- docker/start.sh | 7 +++++++ 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100755 docker/keycloak/vaultwarden.sh diff --git a/docker/keycloak/docker-compose.yml b/docker/keycloak/docker-compose.yml index 6c0274c6..97af449f 100644 --- a/docker/keycloak/docker-compose.yml +++ b/docker/keycloak/docker-compose.yml @@ -24,10 +24,8 @@ services: profiles: ["VaultWarden"] network_mode: "host" build: - context: ../../.. + context: ../.. dockerfile: Dockerfile depends_on: - keycloak env_file: ${ENV}.env - volumes: - - ./vaultwarden.sh:/etc/vaultwarden.sh diff --git a/docker/keycloak/vaultwarden.sh b/docker/keycloak/vaultwarden.sh deleted file mode 100755 index b956d94e..00000000 --- a/docker/keycloak/vaultwarden.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -# Remove CSS to hide SSO Link -sed -i 's#a\[routerlink="/sso"\],##' /web-vault/app/main.*.css diff --git a/docker/start.sh b/docker/start.sh index e9a932e4..e0aae367 100755 --- a/docker/start.sh +++ b/docker/start.sh @@ -22,4 +22,11 @@ elif [ -d /etc/bitwarden_rs.d ]; then done fi +# Toggle the SSO Link +if [ "$SSO_ENABLED" = "true" ]; then + sed -i 's#a\[routerlink="/sso"\]#a\[routerlink="/sso-sed"\]#' /web-vault/app/main.*.css +else + sed -i 's#a\[routerlink="/sso-sed"\]#a\[routerlink="/sso"\]#' /web-vault/app/main.*.css +fi + exec /vaultwarden "${@}"