Commit 3665350d authored by Jérome Perrin's avatar Jérome Perrin

grafana: request an apache frontend

parent 163d5ce0
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[instance-profile] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = e056fb1146c1e741e99a4a713cb65767 md5sum = 3991cc23a43da437a12c5af0edb1de9f
[influxdb-config-file] [influxdb-config-file]
filename = influxdb-config-file.cfg.in filename = influxdb-config-file.cfg.in
...@@ -28,4 +28,4 @@ md5sum = a1a9c22c2a7829c66a49fc2504604d21 ...@@ -28,4 +28,4 @@ md5sum = a1a9c22c2a7829c66a49fc2504604d21
[grafana-config-file] [grafana-config-file]
filename = grafana-config-file.cfg.in filename = grafana-config-file.cfg.in
md5sum = 121233d1f376913141aecc44e17f0c5c md5sum = 8244d430905b968795c7946049bed9e3
...@@ -41,14 +41,14 @@ http_addr = [{{ grafana['ipv6'] }}] ...@@ -41,14 +41,14 @@ http_addr = [{{ grafana['ipv6'] }}]
http_port = {{ grafana['port'] }} http_port = {{ grafana['port'] }}
# The public facing domain name used to access grafana from a browser # The public facing domain name used to access grafana from a browser
domain = localhost domain = {{ apache_frontend['connection-domain'] }}
# Redirect to correct domain if host header does not match domain # Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks # Prevents DNS rebinding attacks
enforce_domain = false enforce_domain = false
# The full public facing url # The full public facing url
root_url = %(protocol)s://%(domain)s:%(http_port)s/ root_url = {{ apache_frontend['connection-secure_access'] }}
# Log web requests # Log web requests
router_logging = false router_logging = false
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"url": { "url": {
"description": "IPv6 URL to access grafana", "description": "Shared frontend for this Grafana instance",
"pattern": "^https://", "pattern": "^https://",
"type": "string" "type": "string"
}, },
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
"description": "Password for grafana's admin user", "description": "Password for grafana's admin user",
"type": "string" "type": "string"
}, },
"grafana-url": {
"description": "IPv6 URL to access grafana",
"pattern": "^https://",
"type": "string"
},
"influxdb-url": { "influxdb-url": {
"description": "IPv6 URL of influxdb HTTP endpoint", "description": "IPv6 URL of influxdb HTTP endpoint",
"pattern": "^https://", "pattern": "^https://",
......
...@@ -8,13 +8,23 @@ develop-eggs-directory = {{ buildout['develop-eggs-directory'] }} ...@@ -8,13 +8,23 @@ develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true offline = true
[instance-parameter] [instance-parameter]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
computer = ${slap_connection:computer_id} computer = ${slap-connection:computer-id}
partition = ${slap_connection:partition_id} partition = ${slap-connection:partition-id}
url = ${slap_connection:server_url} url = ${slap-connection:server-url}
key = ${slap_connection:key_file} key = ${slap-connection:key-file}
cert = ${slap_connection:cert_file} cert = ${slap-connection:cert-file}
[slap-configuration]
# apache-frontend reads from from a part named [slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -143,6 +153,7 @@ recipe = slapos.cookbook:generate.password ...@@ -143,6 +153,7 @@ recipe = slapos.cookbook:generate.password
<= config-file <= config-file
context = context =
section grafana grafana section grafana grafana
section apache_frontend apache-frontend
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
[grafana-listen-promise] [grafana-listen-promise]
...@@ -167,6 +178,17 @@ context = ...@@ -167,6 +178,17 @@ context =
section telegraf telegraf section telegraf telegraf
[apache-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Grafana Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config-url = ${grafana:url}
config-https-only = true
return = domain secure_access
[promises] [promises]
recipe = recipe =
...@@ -178,13 +200,12 @@ instance-promises = ...@@ -178,13 +200,12 @@ instance-promises =
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
influxdb-url = ${influxdb:url} influxdb-url = ${influxdb:url}
influxdb-database = ${influxdb:database} influxdb-database = ${influxdb:database}
influxdb-username = ${influxdb:auth-username} influxdb-username = ${influxdb:auth-username}
influxdb-password = ${influxdb:auth-password} influxdb-password = ${influxdb:auth-password}
telegraf-extra-config-dir = ${telegraf:extra-config-dir} telegraf-extra-config-dir = ${telegraf:extra-config-dir}
url = ${grafana:url} grafana-url = ${grafana:url}
grafana-username = ${grafana:admin-user} grafana-username = ${grafana:admin-user}
grafana-password = ${grafana:admin-password} grafana-password = ${grafana:admin-password}
url = ${apache-frontend:connection-secure_access}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment