Browse code

[metrics] BM-13302 Feat: provide a banner button for Chronograf & use hps for its auth instead of a basic auth

Thomas Cataldo authored on 04/07/2018 08:44:48
Showing 21 changed files
... ...
@@ -57,6 +57,7 @@
57 57
       <plugin id="net.bluemind.group.api"/>
58 58
       <plugin id="net.bluemind.hornetq.client"/>
59 59
       <plugin id="net.bluemind.hps.auth.core2"/>
60
+      <plugin id="net.bluemind.hps.metrics.forward"/>
60 61
       <plugin id="net.bluemind.lib.jackson"/>
61 62
       <plugin id="net.bluemind.lib.jodatime"/>
62 63
       <plugin id="net.bluemind.lib.jta"/>
63 64
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+<?xml version="1.0"?>
1
+<projectDescription>
2
+	<name>net.bluemind.p2.we.adminconsole-monitoring</name>
3
+	<comment/>
4
+	<projects>
5
+	</projects>
6
+	<buildSpec>
7
+	</buildSpec>
8
+	<natures>
9
+		
10
+	</natures>
11
+</projectDescription>
... ...
@@ -3,4 +3,5 @@
3 3
    <bundle id="net.bluemind.ui.adminconsole.monitoring" version="3.1.0.qualifier"/>
4 4
    <bundle id="net.bluemind.monitoring.api" version="3.1.0.qualifier"/>
5 5
    <bundle id="net.bluemind.monitoring.api.gwt" version="3.1.0.qualifier"/>
6
+   <bundle id="net.bluemind.ui.metrics.application" version="3.1.0.qualifier"/>
6 7
 </site>
... ...
@@ -1,6 +1,12 @@
1 1
 location /tick/ {
2
-   auth_basic            "Blue Mind TICK";
3
-   auth_basic_user_file  /etc/nginx/sw.htpasswd;
4
-   proxy_http_version 1.1;
5
-   proxy_pass http://127.0.0.1:8888/tick/;
2
+    gzip             on;
3
+    gzip_min_length  1000;
4
+    gzip_proxied     any;
5
+    gzip_types       text/plain application/xml text/css text/javascript text/json application/json;
6
+    gzip_disable     "MSIE [1-6]\.";
7
+    gzip_comp_level 9;
8
+
9
+    proxy_pass http://hps/tick/;
10
+    client_max_body_size 10m;   
11
+    proxy_intercept_errors on;
6 12
 }
7 13
new file mode 100644
... ...
@@ -0,0 +1,7 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<classpath>
2
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
3
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
4
+	<classpathentry kind="src" path="src"/>
5
+	<classpathentry kind="output" path="bin"/>
6
+</classpath>
0 7
new file mode 100644
... ...
@@ -0,0 +1,28 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<projectDescription>
2
+	<name>net.bluemind.hps.metrics.forward</name>
3
+	<comment></comment>
4
+	<projects>
5
+	</projects>
6
+	<buildSpec>
7
+		<buildCommand>
8
+			<name>org.eclipse.jdt.core.javabuilder</name>
9
+			<arguments>
10
+			</arguments>
11
+		</buildCommand>
12
+		<buildCommand>
13
+			<name>org.eclipse.pde.ManifestBuilder</name>
14
+			<arguments>
15
+			</arguments>
16
+		</buildCommand>
17
+		<buildCommand>
18
+			<name>org.eclipse.pde.SchemaBuilder</name>
19
+			<arguments>
20
+			</arguments>
21
+		</buildCommand>
22
+	</buildSpec>
23
+	<natures>
24
+		<nature>org.eclipse.pde.PluginNature</nature>
25
+		<nature>org.eclipse.jdt.core.javanature</nature>
26
+	</natures>
27
+</projectDescription>
0 28
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+Manifest-Version: 1.0
1
+Bundle-ManifestVersion: 2
2
+Bundle-Name: net.bluemind.hps.forward.metrics
3
+Bundle-SymbolicName: net.bluemind.hps.metrics.forward;singleton:=true
4
+Bundle-Version: 3.1.0.qualifier
5
+Bundle-Activator: net.bluemind.hps.forward.metrics.Activator
6
+Bundle-Vendor: bluemind.net
7
+Require-Bundle: org.eclipse.core.runtime,
8
+ net.bluemind.proxy.http
9
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
10
+Automatic-Module-Name: net.bluemind.hps.forward.metrics
11
+Bundle-ActivationPolicy: lazy
0 12
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+source.. = src/
1
+output.. = bin/
2
+bin.includes = META-INF/,\
3
+               .,\
4
+               plugin.xml
0 5
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<?eclipse version="3.4"?>
2
+<plugin>
3
+   <extension
4
+         point="net.bluemind.proxy.http.forward">
5
+      <forward
6
+            auth_kind="CORE2"
7
+            path="/tick"
8
+            role="bmMonitoring"
9
+            target="locator://metrics/influxdb:8888/tick">
10
+      </forward>
11
+   </extension>
12
+
13
+</plugin>
0 14
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1
+  <modelVersion>4.0.0</modelVersion>
2
+  <parent>
3
+    <groupId>net.bluemind</groupId>
4
+    <version>3.1.0-SNAPSHOT</version>
5
+    <artifactId>net.bluemind.metrics.plugins</artifactId>
6
+  </parent>
7
+  <artifactId>net.bluemind.hps.metrics.forward</artifactId>
8
+  <packaging>eclipse-plugin</packaging>
9
+  
10
+</project>
0 11
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+package net.bluemind.hps.forward.metrics;
1
+
2
+import org.osgi.framework.BundleActivator;
3
+import org.osgi.framework.BundleContext;
4
+
5
+public class Activator implements BundleActivator {
6
+
7
+	private static BundleContext context;
8
+
9
+	static BundleContext getContext() {
10
+		return context;
11
+	}
12
+
13
+	/*
14
+	 * (non-Javadoc)
15
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
16
+	 */
17
+	public void start(BundleContext bundleContext) throws Exception {
18
+		Activator.context = bundleContext;
19
+	}
20
+
21
+	/*
22
+	 * (non-Javadoc)
23
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
24
+	 */
25
+	public void stop(BundleContext bundleContext) throws Exception {
26
+		Activator.context = null;
27
+	}
28
+
29
+}
0 30
new file mode 100644
... ...
@@ -0,0 +1,7 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<classpath>
2
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
3
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
4
+	<classpathentry kind="src" path="src"/>
5
+	<classpathentry kind="output" path="bin"/>
6
+</classpath>
0 7
new file mode 100644
... ...
@@ -0,0 +1,28 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<projectDescription>
2
+	<name>net.bluemind.ui.metrics.application</name>
3
+	<comment></comment>
4
+	<projects>
5
+	</projects>
6
+	<buildSpec>
7
+		<buildCommand>
8
+			<name>org.eclipse.jdt.core.javabuilder</name>
9
+			<arguments>
10
+			</arguments>
11
+		</buildCommand>
12
+		<buildCommand>
13
+			<name>org.eclipse.pde.ManifestBuilder</name>
14
+			<arguments>
15
+			</arguments>
16
+		</buildCommand>
17
+		<buildCommand>
18
+			<name>org.eclipse.pde.SchemaBuilder</name>
19
+			<arguments>
20
+			</arguments>
21
+		</buildCommand>
22
+	</buildSpec>
23
+	<natures>
24
+		<nature>org.eclipse.pde.PluginNature</nature>
25
+		<nature>org.eclipse.jdt.core.javanature</nature>
26
+	</natures>
27
+</projectDescription>
0 28
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+Manifest-Version: 1.0
1
+Bundle-ManifestVersion: 2
2
+Bundle-Name: net.bluemind.ui.metrics.application
3
+Bundle-SymbolicName: net.bluemind.ui.metrics.application;singleton:=true
4
+Bundle-Version: 3.1.0.qualifier
5
+Bundle-Activator: net.bluemind.ui.metrics.application.Activator
6
+Bundle-Vendor: bluemind.net
7
+Require-Bundle: org.eclipse.core.runtime,
8
+ net.bluemind.ui.banner
9
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
10
+Automatic-Module-Name: net.bluemind.ui.metrics.application
11
+Bundle-ActivationPolicy: lazy
12
+Bundle-Localization: OSGI/l10n/bundle
0 13
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+tick.label=Dashboards
1
+tick.description=Monitoring Dashboards
0 2
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+tick.label=Supervision
1
+tick.description=Graphes de supervision
0 2
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+source.. = src/
1
+output.. = bin/
2
+bin.includes = META-INF/,\
3
+               .,\
4
+               plugin.xml,\
5
+               OSGI/
0 6
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<?eclipse version="3.4"?>
2
+<plugin>
3
+   <extension
4
+         point="net.bluemind.ui.commons.banner">
5
+      <banner-entry
6
+            cssIcon="fa fa-lg fa-bar-chart"
7
+            description="%tick.description"
8
+            name="%tick.label"
9
+            offline="false"
10
+            priority="256"
11
+            role="bmMonitoring"
12
+            root="/tick/">
13
+      </banner-entry>
14
+   </extension>
15
+
16
+</plugin>
0 17
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1
+  <modelVersion>4.0.0</modelVersion>
2
+  <parent>
3
+    <groupId>net.bluemind</groupId>
4
+    <version>3.1.0-SNAPSHOT</version>
5
+    <artifactId>net.bluemind.metrics.plugins</artifactId>
6
+  </parent>
7
+  <artifactId>net.bluemind.ui.metrics.application</artifactId>
8
+  <packaging>eclipse-plugin</packaging>
9
+  
10
+</project>
0 11
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+package net.bluemind.ui.metrics.application;
1
+
2
+import org.osgi.framework.BundleActivator;
3
+import org.osgi.framework.BundleContext;
4
+
5
+public class Activator implements BundleActivator {
6
+
7
+	private static BundleContext context;
8
+
9
+	static BundleContext getContext() {
10
+		return context;
11
+	}
12
+
13
+	/*
14
+	 * (non-Javadoc)
15
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
16
+	 */
17
+	public void start(BundleContext bundleContext) throws Exception {
18
+		Activator.context = bundleContext;
19
+	}
20
+
21
+	/*
22
+	 * (non-Javadoc)
23
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
24
+	 */
25
+	public void stop(BundleContext bundleContext) throws Exception {
26
+		Activator.context = null;
27
+	}
28
+
29
+}
... ...
@@ -17,6 +17,8 @@
17 17
 	  <module>net.bluemind.metrics.annotations</module>
18 18
 	  <module>net.bluemind.metrics.testhelper</module>
19 19
 	  <module>net.bluemind.metrics.registry.tests</module>
20
+	  <module>net.bluemind.hps.metrics.forward</module>
21
+	  <module>net.bluemind.ui.metrics.application</module>
20 22
 	</modules>
21 23
 
22 24
 </project>