keycloak-aplcache

Details

diff --git a/distribution/server-dist/src/main/welcome-content/index.html b/distribution/server-dist/src/main/welcome-content/index.html
index b88d5b3..bcf20ac 100644
--- a/distribution/server-dist/src/main/welcome-content/index.html
+++ b/distribution/server-dist/src/main/welcome-content/index.html
@@ -20,6 +20,7 @@
 <head>
     <title>Welcome to Keycloak</title>
     <meta http-equiv="refresh" content="0; url=/auth/" />
+    <meta name="robots" content="noindex, nofollow">
 </head>
 
 <body>
diff --git a/distribution/server-dist/src/main/welcome-content/robots.txt b/distribution/server-dist/src/main/welcome-content/robots.txt
new file mode 100644
index 0000000..77470cb
--- /dev/null
+++ b/distribution/server-dist/src/main/welcome-content/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /
\ No newline at end of file
diff --git a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java
index 0294e9c..d6d44d4 100644
--- a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java
+++ b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java
@@ -81,6 +81,7 @@ public class KeycloakApplication extends Application {
         context.setAttribute(KeycloakSessionFactory.class.getName(), this.sessionFactory);
 
         singletons.add(new ServerVersionResource());
+        singletons.add(new RobotsResource());
         singletons.add(new RealmsResource());
         singletons.add(new AdminRoot());
         classes.add(ThemeResource.class);
diff --git a/services/src/main/java/org/keycloak/services/resources/RobotsResource.java b/services/src/main/java/org/keycloak/services/resources/RobotsResource.java
new file mode 100755
index 0000000..16e9393
--- /dev/null
+++ b/services/src/main/java/org/keycloak/services/resources/RobotsResource.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2016 Red Hat, Inc. and/or its affiliates
+ * and other contributors as indicated by the @author tags.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.keycloak.services.resources;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/robots.txt")
+public class RobotsResource {
+
+    private static final String robots = "User-agent: *\n" + "Disallow: /";
+
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public String getRobots() {
+        return robots;
+    }
+
+}
diff --git a/themes/src/main/resources/theme/base/account/template.ftl b/themes/src/main/resources/theme/base/account/template.ftl
index 3b7dd80..c117cff 100644
--- a/themes/src/main/resources/theme/base/account/template.ftl
+++ b/themes/src/main/resources/theme/base/account/template.ftl
@@ -3,6 +3,9 @@
 <html>
 <head>
     <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="robots" content="noindex, nofollow">
+
     <title>${msg("accountManagementTitle")}</title>
     <link rel="icon" href="${url.resourcesPath}/img/favicon.ico">
     <#if properties.styles?has_content>
diff --git a/themes/src/main/resources/theme/base/admin/index.ftl b/themes/src/main/resources/theme/base/admin/index.ftl
index 243c79b..e4db6f9 100755
--- a/themes/src/main/resources/theme/base/admin/index.ftl
+++ b/themes/src/main/resources/theme/base/admin/index.ftl
@@ -2,7 +2,12 @@
 <html>
 <head>
     <title></title>
+
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="robots" content="noindex, nofollow">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
     <link rel="shortcut icon" href="${resourceUrl}/img/favicon.ico">
     <#if properties.styles?has_content>
     <#list properties.styles?split(' ') as style>
diff --git a/themes/src/main/resources/theme/base/login/template.ftl b/themes/src/main/resources/theme/base/login/template.ftl
index a999fd8..855f40e 100755
--- a/themes/src/main/resources/theme/base/login/template.ftl
+++ b/themes/src/main/resources/theme/base/login/template.ftl
@@ -3,7 +3,10 @@
 <html xmlns="http://www.w3.org/1999/xhtml" class="${properties.kcHtmlClass!}">
 
 <head>
+    <meta charset="utf-8">
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="robots" content="noindex, nofollow">
+
     <#if properties.meta?has_content>
         <#list properties.meta?split(' ') as meta>
             <meta name="${meta?split('==')[0]}" content="${meta?split('==')[1]}"/>
diff --git a/themes/src/main/resources/theme/keycloak/welcome/index.ftl b/themes/src/main/resources/theme/keycloak/welcome/index.ftl
index 26b3edb..43bec62 100755
--- a/themes/src/main/resources/theme/keycloak/welcome/index.ftl
+++ b/themes/src/main/resources/theme/keycloak/welcome/index.ftl
@@ -24,6 +24,11 @@
 <html>
 <head>
     <title>Welcome to Keycloak</title>
+
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="robots" content="noindex, nofollow">
+
     <link rel="shortcut icon" href="welcome-content/favicon.ico" type="image/x-icon">
     <link rel="StyleSheet" href="welcome-content/keycloak.css" type="text/css">
     <style>