From 02efe446452d672f24d97bdc334ec2193700eff6 Mon Sep 17 00:00:00 2001 From: George Vlahavas Date: Tue, 31 Aug 2021 11:36:36 +0300 Subject: [PATCH] Use separate KIBANA_URL and GRAFANA_URL --- api/.env.example | 2 ++ api/app/Http/Controllers/ConfigController.php | 6 +++--- api/start.sh | 4 +++- docker-compose-hetzner.yml | 11 +++++++++++ hetzner_deploy.groovy | 6 ++++-- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/api/.env.example b/api/.env.example index 3299a3b..6932177 100644 --- a/api/.env.example +++ b/api/.env.example @@ -54,6 +54,8 @@ KEYCLOAK_REALM=Integration KEYCLOAK_URL=https://keycloak-curex.gnubila.fr/auth/ KEYCLOAK_CLIENT_ID=KEA +KIBANA_URL=$APP_URL +GRAFANA_URL=$APP_URL KIBANA_PORT=5611 GRAFANA_PORT=3001 diff --git a/api/app/Http/Controllers/ConfigController.php b/api/app/Http/Controllers/ConfigController.php index 46db737..db33343 100644 --- a/api/app/Http/Controllers/ConfigController.php +++ b/api/app/Http/Controllers/ConfigController.php @@ -10,9 +10,9 @@ class ConfigController extends Controller { return [ 'base_url' => env('APP_URL'), - 'od_url' => env('APP_URL') . ':' . env('GRAFANA_PORT') . env('OD_GRAFANA_PARAMS'), - 'mltd_url' => env('APP_URL') . ':' . env('GRAFANA_PORT') . env('MLTD_GRAFANA_PARAMS'), - 'ceptd_url' => env('APP_URL') . ':' . env('KIBANA_PORT') . env('CEPTD_KIBANA_PARAMS'), + 'od_url' => env('GRAFANA_URL'), + 'mltd_url' => env('GRAFANA_URL'), + 'ceptd_url' => env('KIBANA_URL') ]; } diff --git a/api/start.sh b/api/start.sh index fcf10bb..fe77e5a 100755 --- a/api/start.sh +++ b/api/start.sh @@ -1,5 +1,7 @@ #!/bin/sh -sed "s|^APP_URL=.*|APP_URL=${APP_URL}|" .env.example > .env +sed "s|^APP_URL=.*|APP_URL=${APP_URL}|" .env.example | \ + sed "s|^GRAFANA_URL=.*|GRAFANA_URL=${GRAFANA_URL}|" | \ + sed "s|^KIBANA_URL=.*|KIBANA_URL=${KIBANA_URL}" > .env php-fpm diff --git a/docker-compose-hetzner.yml b/docker-compose-hetzner.yml index b1930dd..d29938e 100644 --- a/docker-compose-hetzner.yml +++ b/docker-compose-hetzner.yml @@ -58,6 +58,11 @@ services: - 5601 networks: - "proxy-network" + environment: + - "VIRTUAL_HOST=kea-kibana.vlahavas.com" + - "VIRTUAL_PORT=5601" + - "LETSENCRYPT_HOST=kea-kibana.vlahavas.com" + - "LETSENCRYPT_EMAIL=gvlahavas@csd.auth.gr" #Controller webserver: @@ -92,6 +97,8 @@ services: - "APP_ENV=${APP_ENV}" - "APP_DEBUG=${APP_DEBUG}" - "APP_URL=${APP_URL}" + - "KIBANA_URL=${KIBANA_URL}" + - "GRAFANA_URL=${GRAFANA_URL}" - "KIBANA_PORT=${KIBANA_PORT}" - "GRAFANA_PORT=${GRAFANA_PORT}" - "LOG_CHANNEL=${LOG_CHANNEL}" @@ -192,6 +199,10 @@ services: - GF_SECURITY_COOKIE_SAMESITE=none - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + - "VIRTUAL_HOST=kea-grafana.vlahavas.com" + - "VIRTUAL_PORT=3000" + - "LETSENCRYPT_HOST=kea-grafana.vlahavas.com" + - "LETSENCRYPT_EMAIL=gvlahavas@csd.auth.gr" networks: - "proxy-network" diff --git a/hetzner_deploy.groovy b/hetzner_deploy.groovy index a68ded3..3e68710 100644 --- a/hetzner_deploy.groovy +++ b/hetzner_deploy.groovy @@ -24,8 +24,10 @@ pipeline { APP_DEBUG = "true" APP_URL = "https://kea.curex-project.eu" - KIBANA_PORT = "5601" - GRAFANA_PORT = "3000" + KIBANA_URL = "https://kea-kibana.vlahavas.com" + GRAFANA_URL = "https://kea-grafana.vlahavas.com" + KIBANA_PORT = "443" + GRAFANA_PORT = "443" LOG_CHANNEL = "stack" -- 2.2.2