diff --git a/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb b/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb index 28f1b8523d..496d773c3c 100644 --- a/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb +++ b/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb @@ -146,6 +146,7 @@ services: links: - postgres:postgres volumes: + - '<%= scope.lookupvar('che::che_instance') -%>/config/keycloak/che:/opt/jboss/keycloak/themes/che' - '<%= scope.lookupvar('che::che_instance') -%>/config/keycloak/:/export' - '<%= scope.lookupvar('che::che_instance') -%>/data/keycloak:/opt/jboss/keycloak/standalone/data' - '<%= scope.lookupvar('che::che_instance') -%>/logs/keycloak:/opt/jboss/keycloak/standalone/log' diff --git a/dockerfiles/init/modules/keycloak/files/che/login/login-reset-password.ftl b/dockerfiles/init/modules/keycloak/files/che/login/login-reset-password.ftl new file mode 100644 index 0000000000..6009c296b7 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/login-reset-password.ftl @@ -0,0 +1,34 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout displayInfo=true; section> + <#if section = "title"> + ${msg("emailForgotTitle")} + <#elseif section = "header"> + ${msg("emailForgotTitle")} + <#elseif section = "form"> + <#include "logo.ftl"> + +
+
+
${msg("passwordRecover")}
+ +
+ ${msg("usernameOrEmail")}<#else>${msg("email")}"/> +
+
+ +
+ + +
+ +
+
+
+ <#elseif section = "info" > + ${msg("emailInstruction")} + + diff --git a/dockerfiles/init/modules/keycloak/files/che/login/login-update-password.ftl b/dockerfiles/init/modules/keycloak/files/che/login/login-update-password.ftl new file mode 100644 index 0000000000..37830eaf01 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/login-update-password.ftl @@ -0,0 +1,40 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout displayInfo=true; section> + <#if section = "title"> + ${msg("updatePasswordTitle")} + <#elseif section = "header"> + ${msg("updatePasswordTitle")} + <#elseif section = "form"> + <#include "logo.ftl"> + +
+ + + +
Setup your password.
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+ +
+
+
+ + diff --git a/dockerfiles/init/modules/keycloak/files/che/login/login.ftl b/dockerfiles/init/modules/keycloak/files/che/login/login.ftl new file mode 100644 index 0000000000..30f6e8c1f8 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/login.ftl @@ -0,0 +1,76 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout displayInfo=social.displayInfo; section> + <#if section = "title"> + ${msg("loginTitle",(realm.displayName!''))} + <#elseif section = "header"> + ${msg("loginTitleHtml",(realm.displayNameHtml!''))} + <#elseif section = "form"> + <#include "logo.ftl"> + + <#if realm.password> +
+
+
${msg("passwordLogin")}
+
+ <#if usernameEditDisabled??> + + <#else> + ${msg("usernameOrEmail")}<#else>${msg("email")}" /> + +
+
+ +
+
+ +
+
+ +
+
+ <#if realm.rememberMe && !usernameEditDisabled??> +
+ +
+ +
+ <#if realm.resetPasswordAllowed> + ${msg("doForgotPassword")} + +
+
+ +
+
+ +
+
+
+
+ + <#elseif section = "info" > + <#if realm.password && social.providers??> +
${msg("oauthLogin")}
+
+ +
+ + + <#if realm.password && realm.registrationAllowed && !usernameEditDisabled??> +
+ ${msg("noAccount")} ${msg("doRegister")} +
+ + + + diff --git a/dockerfiles/init/modules/keycloak/files/che/login/logo.ftl b/dockerfiles/init/modules/keycloak/files/che/login/logo.ftl new file mode 100644 index 0000000000..bf06c8ec3a --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/logo.ftl @@ -0,0 +1,4 @@ +
+ + ${msg("product")} +
diff --git a/dockerfiles/init/modules/keycloak/files/che/login/messages/messages_en.properties b/dockerfiles/init/modules/keycloak/files/che/login/messages/messages_en.properties new file mode 100644 index 0000000000..72d947c609 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/messages/messages_en.properties @@ -0,0 +1,6 @@ +product=Eclipse Che + +passwordLogin=Login with password +oauthLogin=Login with OAuth +formRegister=Create an account with a form +passwordRecover=Forgot your password?
Enter your email below. diff --git a/dockerfiles/init/modules/keycloak/files/che/login/register.ftl b/dockerfiles/init/modules/keycloak/files/che/login/register.ftl new file mode 100644 index 0000000000..94690d7772 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/register.ftl @@ -0,0 +1,76 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout; section> + <#if section = "title"> + ${msg("registerWithTitle",(realm.displayName!''))} + <#elseif section = "header"> + ${msg("registerWithTitleHtml",(realm.displayNameHtml!''))} + <#elseif section = "form"> + <#include "logo.ftl"> + +
+ + + +
${msg("formRegister")}
+ + <#if !realm.registrationEmailAsUsername> +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + <#if passwordRequired> +
+
+ +
+
+ +
+
+ +
+
+ + + <#if recaptchaRequired??> +
+
+
+
+
+ + +
+ + +
+ +
+
+
+ + diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/css/styles.css b/dockerfiles/init/modules/keycloak/files/che/login/resources/css/styles.css new file mode 100644 index 0000000000..a169bada10 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/resources/css/styles.css @@ -0,0 +1,248 @@ + +body { + background-color: #1b2b57; + color: #4a90e2; + font-family: 'Open Sans'; + font-size: 14px; +} + +a { + color: #fff; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +div#kc-content { + position: absolute; + top: 20%; + left: 50%; + width: 400px; + margin-left: -225px; +} + +div#kc-form { + float: left; + width: 400px; +} + +div#kc-form label { + display: block; + font-family: 'Open Sans'; + font-size: 24px; + margin-bottom: 10px; +} + +div#info-area { + position: fixed; + bottom: 0; + left: 0; + margin-top: 40px; + background-color: rgba(0, 0, 0, 0.4); + padding: 20px; + width: 100%; +} + +div#info-area p { + margin-right: 30px; + display: inline; + text-shadow: none; +} + +input[type=text], input[type=password] { + width: 375px; + height: 46px; + margin: 0 0 10px 0; + border-radius: 5px; + padding-left: 21px; + color: #fff; + background: #2d407d; + font-size: 16px; + font-size: 18px; + vertical-align: middle; + border: none; +} + +input[type=text]:focus, input[type=password]:focus { + background: #3f55ae; + outline: none; +} + +input[type=submit] { + border: none; + width: 180px; + height: 40px; + border-radius: 5px; + font-size: 16px; + font-weight: bold; + color: #fff; + background: #44a73b; + cursor: pointer; + + padding: 10px; + margin-top: 20px; + margin-right: 10px; + margin-bottom: 25px; +} + +input[type=submit]:hover { + background-color: #398842; +} + +div#kc-form-options div { + display: inline-block; + margin-right: 20px; + font-size: 12px; +} + +div#kc-form-options a { + font-size: 14px; + font-family: 'Open Sans'; +} + +div#kc-form-options div label { + font-size: 14px; +} + +div#kc-feedback { + box-shadow: 0px 0px 6px rgba(0,0,0,0.5); + position: fixed; + top: 0; + left: 0; + width: 100%; + text-align: center; +} + +.kc-feedback-text { + color: #fff; + font-size: 18px; + text-align: center; + display: block; + margin-bottom: 25px; + padding: 15px; +} + +div#kc-feedback-wrapper { + padding: 1em; +} + +div.feedback-success { + background-color: rgba(155,155,255,0.1); +} + +div.feedback-warning { + background-color: rgba(255,175,0,0.1); +} + +div.feedback-error { + background-color: rgba(255,0,0,0.1); +} + +.alert { + border-radius: 5px; +} + +.alert-success { + background-color: #44a73b; +} + +.alert-warning { + background-color: #8c9837; +} + +.alert-error { + background-color: #d7342d; +} + + +div#kc-error-message { + color: #fff; + background-color: #d7342d; + border-radius: 5px; + text-align: center; + display: inline-block; + font-size: 16px; + padding-left: 15px; + padding-right: 15px; +} + +div#kc-header { + display: none; +} + +div#kc-registration { + font-size: 20px; + margin-bottom: 20px; +} + +div#social-login { + border-left: 1px solid rgba(255, 255, 255, 0.2); + float: right; + width: 150px; + padding: 20px 0 200px 40px; +} + +div.social-login span { + display: none; +} + +div#kc-social-providers ul { + list-style: none; + margin: 0; + padding: 0; +} + +div#kc-social-providers ul li { + margin-bottom: 20px; +} + +div#kc-social-providers ul li span { + display: inline; + width: 100px; +} + +a.zocial { + border: none; + padding-top: 0.2em; + padding-bottom: 0.2em; +} + +#zocial-image-github { + width: 48px; + height: 48px; + background-size: cover; + background-image: url("../img/logo-github@3x.png"); +} + +#zocial-image-github:hover { + background-image: url("../img/logo-github-hover@3x.png"); +} + +#logo-banner { + color: #fff; + font-weight: bold; + font-size: 36px; + display: inline-block; + margin-bottom: 25px; +} + +#logo-banner #che-logo { + width: 64px; + height: 64px; + vertical-align: middle; +} + +#logo-banner span { + display: inline-block; + vertical-align: middle; + margin-left: 10px; +} + +.kc-form-title { + font-family: 'Open Sans'; + font-size: 20px; + margin-bottom: 10px; +} + diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/img/che-logo.svg b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/che-logo.svg new file mode 100644 index 0000000000..d37c67c687 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/che-logo.svg @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/img/favicon.ico b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/favicon.ico new file mode 100644 index 0000000000..903abcb13f Binary files /dev/null and b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/favicon.ico differ diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/img/logo-github-hover@3x.png b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/logo-github-hover@3x.png new file mode 100644 index 0000000000..2576eb4417 Binary files /dev/null and b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/logo-github-hover@3x.png differ diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/img/logo-github@3x.png b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/logo-github@3x.png new file mode 100644 index 0000000000..855da76d99 Binary files /dev/null and b/dockerfiles/init/modules/keycloak/files/che/login/resources/img/logo-github@3x.png differ diff --git a/dockerfiles/init/modules/keycloak/files/che/login/theme.properties b/dockerfiles/init/modules/keycloak/files/che/login/theme.properties new file mode 100644 index 0000000000..298aa65ac2 --- /dev/null +++ b/dockerfiles/init/modules/keycloak/files/che/login/theme.properties @@ -0,0 +1,2 @@ +parent=base +styles=css/styles.css diff --git a/dockerfiles/init/modules/keycloak/manifests/init.pp b/dockerfiles/init/modules/keycloak/manifests/init.pp index b809287eef..7d1350cae4 100644 --- a/dockerfiles/init/modules/keycloak/manifests/init.pp +++ b/dockerfiles/init/modules/keycloak/manifests/init.pp @@ -22,5 +22,11 @@ class keycloak { ensure => "present", content => template("keycloak/master-users-0.json.erb"), mode => "644", + } -> + file { 'keycloak theme custom login page': + path => '/opt/che/config/keycloak/che', + ensure => "present", + source => 'puppet:///modules/keycloak/che', + recurse => true, } } diff --git a/dockerfiles/init/modules/keycloak/templates/che-realm.json.erb b/dockerfiles/init/modules/keycloak/templates/che-realm.json.erb index 252e67b56f..4a246f54a8 100644 --- a/dockerfiles/init/modules/keycloak/templates/che-realm.json.erb +++ b/dockerfiles/init/modules/keycloak/templates/che-realm.json.erb @@ -13,13 +13,13 @@ "accessCodeLifespanLogin" : 1800, "enabled" : true, "sslRequired" : "external", - "registrationAllowed" : false, + "registrationAllowed" : true, "registrationEmailAsUsername" : false, "rememberMe" : false, "verifyEmail" : false, "loginWithEmailAllowed" : true, "duplicateEmailsAllowed" : false, - "resetPasswordAllowed" : false, + "resetPasswordAllowed" : true, "editUsernameAllowed" : false, "bruteForceProtected" : false, "maxFailureWaitSeconds" : 900, @@ -302,6 +302,7 @@ "xXSSProtection" : "1; mode=block", "contentSecurityPolicy" : "frame-src 'self'" }, + "loginTheme" : "che", "smtpServer" : { }, "eventsEnabled" : false, "eventsListeners" : [ "jboss-logging" ], @@ -735,5 +736,5 @@ "minimumQuickLoginWaitSeconds" : "60", "waitIncrementSeconds" : "60" }, - "keycloakVersion" : "3.1.0.Final" + "keycloakVersion" : "3.2.1.Final" }