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 @@
1
+<?xml version="1.0"?>
2
+<projectDescription>
3
+	<name>net.bluemind.p2.we.adminconsole-monitoring</name>
4
+	<comment/>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+	</buildSpec>
9
+	<natures>
10
+		
11
+	</natures>
12
+</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 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<classpath>
3
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5
+	<classpathentry kind="src" path="src"/>
6
+	<classpathentry kind="output" path="bin"/>
7
+</classpath>
0 8
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<projectDescription>
3
+	<name>net.bluemind.hps.metrics.forward</name>
4
+	<comment></comment>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+		<buildCommand>
9
+			<name>org.eclipse.jdt.core.javabuilder</name>
10
+			<arguments>
11
+			</arguments>
12
+		</buildCommand>
13
+		<buildCommand>
14
+			<name>org.eclipse.pde.ManifestBuilder</name>
15
+			<arguments>
16
+			</arguments>
17
+		</buildCommand>
18
+		<buildCommand>
19
+			<name>org.eclipse.pde.SchemaBuilder</name>
20
+			<arguments>
21
+			</arguments>
22
+		</buildCommand>
23
+	</buildSpec>
24
+	<natures>
25
+		<nature>org.eclipse.pde.PluginNature</nature>
26
+		<nature>org.eclipse.jdt.core.javanature</nature>
27
+	</natures>
28
+</projectDescription>
0 29
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+Manifest-Version: 1.0
2
+Bundle-ManifestVersion: 2
3
+Bundle-Name: net.bluemind.hps.forward.metrics
4
+Bundle-SymbolicName: net.bluemind.hps.metrics.forward;singleton:=true
5
+Bundle-Version: 3.1.0.qualifier
6
+Bundle-Activator: net.bluemind.hps.forward.metrics.Activator
7
+Bundle-Vendor: bluemind.net
8
+Require-Bundle: org.eclipse.core.runtime,
9
+ net.bluemind.proxy.http
10
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
11
+Automatic-Module-Name: net.bluemind.hps.forward.metrics
12
+Bundle-ActivationPolicy: lazy
0 13
new file mode 100644
... ...
@@ -0,0 +1,5 @@
1
+source.. = src/
2
+output.. = bin/
3
+bin.includes = META-INF/,\
4
+               .,\
5
+               plugin.xml
0 6
new file mode 100644
... ...
@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<?eclipse version="3.4"?>
3
+<plugin>
4
+   <extension
5
+         point="net.bluemind.proxy.http.forward">
6
+      <forward
7
+            auth_kind="CORE2"
8
+            path="/tick"
9
+            role="bmMonitoring"
10
+            target="locator://metrics/influxdb:8888/tick">
11
+      </forward>
12
+   </extension>
13
+
14
+</plugin>
0 15
new file mode 100644
... ...
@@ -0,0 +1,11 @@
1
+<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">
2
+  <modelVersion>4.0.0</modelVersion>
3
+  <parent>
4
+    <groupId>net.bluemind</groupId>
5
+    <version>3.1.0-SNAPSHOT</version>
6
+    <artifactId>net.bluemind.metrics.plugins</artifactId>
7
+  </parent>
8
+  <artifactId>net.bluemind.hps.metrics.forward</artifactId>
9
+  <packaging>eclipse-plugin</packaging>
10
+  
11
+</project>
0 12
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+package net.bluemind.hps.forward.metrics;
2
+
3
+import org.osgi.framework.BundleActivator;
4
+import org.osgi.framework.BundleContext;
5
+
6
+public class Activator implements BundleActivator {
7
+
8
+	private static BundleContext context;
9
+
10
+	static BundleContext getContext() {
11
+		return context;
12
+	}
13
+
14
+	/*
15
+	 * (non-Javadoc)
16
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
17
+	 */
18
+	public void start(BundleContext bundleContext) throws Exception {
19
+		Activator.context = bundleContext;
20
+	}
21
+
22
+	/*
23
+	 * (non-Javadoc)
24
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
25
+	 */
26
+	public void stop(BundleContext bundleContext) throws Exception {
27
+		Activator.context = null;
28
+	}
29
+
30
+}
0 31
new file mode 100644
... ...
@@ -0,0 +1,7 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<classpath>
3
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5
+	<classpathentry kind="src" path="src"/>
6
+	<classpathentry kind="output" path="bin"/>
7
+</classpath>
0 8
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<projectDescription>
3
+	<name>net.bluemind.ui.metrics.application</name>
4
+	<comment></comment>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+		<buildCommand>
9
+			<name>org.eclipse.jdt.core.javabuilder</name>
10
+			<arguments>
11
+			</arguments>
12
+		</buildCommand>
13
+		<buildCommand>
14
+			<name>org.eclipse.pde.ManifestBuilder</name>
15
+			<arguments>
16
+			</arguments>
17
+		</buildCommand>
18
+		<buildCommand>
19
+			<name>org.eclipse.pde.SchemaBuilder</name>
20
+			<arguments>
21
+			</arguments>
22
+		</buildCommand>
23
+	</buildSpec>
24
+	<natures>
25
+		<nature>org.eclipse.pde.PluginNature</nature>
26
+		<nature>org.eclipse.jdt.core.javanature</nature>
27
+	</natures>
28
+</projectDescription>
0 29
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+Manifest-Version: 1.0
2
+Bundle-ManifestVersion: 2
3
+Bundle-Name: net.bluemind.ui.metrics.application
4
+Bundle-SymbolicName: net.bluemind.ui.metrics.application;singleton:=true
5
+Bundle-Version: 3.1.0.qualifier
6
+Bundle-Activator: net.bluemind.ui.metrics.application.Activator
7
+Bundle-Vendor: bluemind.net
8
+Require-Bundle: org.eclipse.core.runtime,
9
+ net.bluemind.ui.banner
10
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
11
+Automatic-Module-Name: net.bluemind.ui.metrics.application
12
+Bundle-ActivationPolicy: lazy
13
+Bundle-Localization: OSGI/l10n/bundle
0 14
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+tick.label=Dashboards
2
+tick.description=Monitoring Dashboards
0 3
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+tick.label=Supervision
2
+tick.description=Graphes de supervision
0 3
new file mode 100644
... ...
@@ -0,0 +1,6 @@
1
+source.. = src/
2
+output.. = bin/
3
+bin.includes = META-INF/,\
4
+               .,\
5
+               plugin.xml,\
6
+               OSGI/
0 7
new file mode 100644
... ...
@@ -0,0 +1,17 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<?eclipse version="3.4"?>
3
+<plugin>
4
+   <extension
5
+         point="net.bluemind.ui.commons.banner">
6
+      <banner-entry
7
+            cssIcon="fa fa-lg fa-bar-chart"
8
+            description="%tick.description"
9
+            name="%tick.label"
10
+            offline="false"
11
+            priority="256"
12
+            role="bmMonitoring"
13
+            root="/tick/">
14
+      </banner-entry>
15
+   </extension>
16
+
17
+</plugin>
0 18
new file mode 100644
... ...
@@ -0,0 +1,11 @@
1
+<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">
2
+  <modelVersion>4.0.0</modelVersion>
3
+  <parent>
4
+    <groupId>net.bluemind</groupId>
5
+    <version>3.1.0-SNAPSHOT</version>
6
+    <artifactId>net.bluemind.metrics.plugins</artifactId>
7
+  </parent>
8
+  <artifactId>net.bluemind.ui.metrics.application</artifactId>
9
+  <packaging>eclipse-plugin</packaging>
10
+  
11
+</project>
0 12
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+package net.bluemind.ui.metrics.application;
2
+
3
+import org.osgi.framework.BundleActivator;
4
+import org.osgi.framework.BundleContext;
5
+
6
+public class Activator implements BundleActivator {
7
+
8
+	private static BundleContext context;
9
+
10
+	static BundleContext getContext() {
11
+		return context;
12
+	}
13
+
14
+	/*
15
+	 * (non-Javadoc)
16
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
17
+	 */
18
+	public void start(BundleContext bundleContext) throws Exception {
19
+		Activator.context = bundleContext;
20
+	}
21
+
22
+	/*
23
+	 * (non-Javadoc)
24
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
25
+	 */
26
+	public void stop(BundleContext bundleContext) throws Exception {
27
+		Activator.context = null;
28
+	}
29
+
30
+}
... ...
@@ -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>