diff --git a/charts/fairspace-keycloak/values.yaml b/charts/fairspace-keycloak/values.yaml
index a5dcadf..333c92e 100644
--- a/charts/fairspace-keycloak/values.yaml
+++ b/charts/fairspace-keycloak/values.yaml
@@ -31,6 +31,26 @@ keycloakx:
database: keycloak
existingSecret: keycloak-postgresql
username: keycloak
+ extraInitContainers: |
+ - name: theme-provider
+ image: keycloak-fairspace-theme:latest
+ imagePullPolicy: IfNotPresent
+ command:
+ - sh
+ args:
+ - -c
+ - |
+ echo "Copying Fairspace theme..."
+ cp -R /fairspace_theme/* /theme
+ volumeMounts:
+ - name: theme
+ mountPath: /theme
+ extraVolumeMounts: |
+ - name: theme
+ mountPath: /opt/keycloak/themes/fairspace_theme
+ extraVolumes: |
+ - name: theme
+ emptyDir: { }
postgresql:
fullnameOverride: keycloak-db-postgresql
diff --git a/local-development/deploy.sh b/local-development/deploy.sh
index 58d3645..19e3101 100755
--- a/local-development/deploy.sh
+++ b/local-development/deploy.sh
@@ -7,6 +7,17 @@ helm_cmd=$(realpath ~/bin/helm3/helm)
# $ minikube start
# $ minikube addons enable ingress
+eval $(minikube docker-env)
+
+pushd "${here}"
+
+pushd ../themes
+(docker build . -t keycloak-fairspace-theme:latest) || {
+ echo "Building Fairspace theme image failed."
+ popd
+ exit 1
+}
+
pushd "${here}"
(kubectl get ns keycloak-dev || kubectl create ns keycloak-dev) && \
diff --git a/local-development/fairspace-realm.json b/local-development/fairspace-realm.json
index 52dd6d6..c9398c4 100644
--- a/local-development/fairspace-realm.json
+++ b/local-development/fairspace-realm.json
@@ -1,8 +1,9 @@
{
"id": "fairspace",
"realm": "fairspace",
- "displayName": "Fairspace (local environment)",
- "displayNameHtml": "Local environment
Fairspace",
+ "displayName": "Fairspace (test environment)",
+ "displayNameHtml": "
Fairspace
",
+ "loginTheme": "fairspace_theme",
"notBefore": 0,
"revokeRefreshToken": false,
"refreshTokenMaxReuse": 0,
diff --git a/local-development/local-values.yaml b/local-development/local-values.yaml
index 5aa5651..7bc83f0 100644
--- a/local-development/local-values.yaml
+++ b/local-development/local-values.yaml
@@ -4,6 +4,20 @@ fairspaceKeycloak:
postgresPassword: "keycloak" # Set passwords to prevent having a new password at every upgrade
keycloakx:
+ extraInitContainers: |
+ - name: theme-provider
+ image: keycloak-fairspace-theme:latest
+ imagePullPolicy: IfNotPresent
+ command:
+ - sh
+ args:
+ - -c
+ - |
+ echo "Copying Fairspace theme..."
+ cp -R /fairspace_theme/* /theme
+ volumeMounts:
+ - name: theme
+ mountPath: /theme
extraEnv: |
- name: KEYCLOAK_ADMIN
value: keycloak
diff --git a/themes/Dockerfile b/themes/Dockerfile
new file mode 100644
index 0000000..4339bfa
--- /dev/null
+++ b/themes/Dockerfile
@@ -0,0 +1,2 @@
+FROM busybox
+COPY fairspace_theme /fairspace_theme
\ No newline at end of file
diff --git a/themes/README.md b/themes/README.md
new file mode 100644
index 0000000..c361761
--- /dev/null
+++ b/themes/README.md
@@ -0,0 +1 @@
+TODO: document custom themes here...
\ No newline at end of file
diff --git a/themes/fairspace_theme/login/resources/css/fairspace/login.css b/themes/fairspace_theme/login/resources/css/fairspace/login.css
new file mode 100644
index 0000000..3aebc30
--- /dev/null
+++ b/themes/fairspace_theme/login/resources/css/fairspace/login.css
@@ -0,0 +1,62 @@
+/*# Overwrites login page style of keycloak theme.
+See: https://github.com/keycloak/keycloak/blob/main/themes/src/main/resources/theme/keycloak/login/resources/css/login.css */
+
+:root {
+ --kc-blue-light: rgba(106,134,232,1);
+ --kc-blue-light-transp-25: rgba(106,134,232,0.25);
+ --kc-blue-medium: rgba(52,95,157,1);
+ --kc-blue-dark: rgba(8,65,92,1);
+}
+
+.login-pf body {
+ background: radial-gradient(circle, var(--kc-blue-light) 5%, var(--kc-blue-medium) 25%, var(--kc-blue-dark) 75%);
+ background-size: cover;
+ height: 100%;
+}
+
+#kc-header-wrapper {
+ padding: 30px 10px 0;
+}
+
+div.kc-logo-text {
+ background-image: url(../../img/fairspace_logo_white.png);
+ background-size: contain;
+ background-position: center;
+ background-repeat: no-repeat;
+ height: 100px;
+ margin: 0 auto;
+}
+
+.card-pf {
+ color: white;
+ margin: 0 auto;
+ box-shadow: none;
+ max-width: 500px;
+ border: 1px solid;
+ border-radius: 25px;
+ border-color: var(--kc-blue-light-transp-25);
+ background-color: var(--kc-blue-light-transp-25);
+}
+
+.login-pf-page .card-pf {
+ padding: 60px 30px 70px;
+}
+
+.login-pf-page .login-pf-header h1 {
+ text-align: left;
+ font-weight: bold;
+}
+
+.pf-c-button.pf-m-primary {
+ background-color: var(--kc-blue-dark);
+ border-radius: 5px;
+}
+
+#kc-form-buttons {
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
+
+.pf-c-form-control:not(textarea) {
+ border-radius: 5px;
+}
\ No newline at end of file
diff --git a/themes/fairspace_theme/login/resources/img/fairspace_logo_white.png b/themes/fairspace_theme/login/resources/img/fairspace_logo_white.png
new file mode 100644
index 0000000..6291bdf
Binary files /dev/null and b/themes/fairspace_theme/login/resources/img/fairspace_logo_white.png differ
diff --git a/themes/fairspace_theme/login/theme.properties b/themes/fairspace_theme/login/theme.properties
new file mode 100644
index 0000000..acde0a9
--- /dev/null
+++ b/themes/fairspace_theme/login/theme.properties
@@ -0,0 +1,6 @@
+# Copy of Keycloak theme with customisations for Fairspace.
+parent=keycloak
+import=common/keycloak
+
+styles=css/login.css css/fairspace/login.css
+kcLogoLink=https://thehyve.nl/services/fairspace