From e8ef91e89bb4245eb2b4cfa6bdcf5139c30fa323 Mon Sep 17 00:00:00 2001 From: Sebastian Blasiak Date: Sun, 17 Jun 2018 14:02:48 +0200 Subject: [PATCH] updating documentation (secure and insecure variants) --- README.md | 40 ++++++++++++++++++++++++++++++++++------ deploy_all.sh | 4 ++-- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b1fd32b..ecca8c0 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,41 @@ If not - it will still take mentioned ~ 1 minute + time needed for docker instal ## Here is how to install: +Prepare certificate in /etc/grafana/ (privkey1.pem, fullchain1.pem). + +**If you want to have your Grafana insecure comment following lines in** *docker-compose.yml*: + + GF_SERVER_CERT_FILE: "/etc/grafana/fullchain1.pem" + GF_SERVER_CERT_KEY: "/etc/grafana/privkey1.pem" + + + +Also comment these lines in "deploy_all.sh": + +``` +## NOW LET'S SECURE GRAFANA +# CHECKING OUT ORIGINAL FILE +echo -e "checking out original docker-compose.yml" +git checkout docker-compose.yml + +## STOPPING and REMOVING GRAFANA CONTAINER +echo -e "stopping & removing grafana container" +container_id=$(docker container ls | grep grafana| awk '{print $1}') +docker stop $container_id +docker rm $container_id + +# REPLACING HTTP with HTTPS +echo -e "changing http to https" +sed -i 's/GF_SERVER_PROTOCOL: "http"/GF_SERVER_PROTOCOL: "https"/g' docker-compose.yml +docker-compose up -d grafana +echo -e "reverting: changing https to http" +sed -i 's/GF_SERVER_PROTOCOL: "https"/GF_SERVER_PROTOCOL: "http"/g' docker-compose.yml +``` + +Next execute: * $ clone the repository * $ cd to cloned dir * $ chmod +x ./deploy_all.sh; ./deploy_all.sh - - + + Monitoring should be up and running http://_**hostname**_:3001/ - - - - diff --git a/deploy_all.sh b/deploy_all.sh index c9513e5..5aec4a2 100755 --- a/deploy_all.sh +++ b/deploy_all.sh @@ -82,8 +82,8 @@ docker exec -it -u 0 grafana /var/lib/grafana/ds/add_dashboards.sh ## NOW LET'S SECURE GRAFANA # CHECKING OUT ORIGINAL FILE -#echo -e "checking out original docker-compose.yml" -#git checkout docker-compose.yml +echo -e "checking out original docker-compose.yml" +git checkout docker-compose.yml ## STOPPING and REMOVING GRAFANA CONTAINER echo -e "stopping & removing grafana container"