Skip to content

Grafana #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,34 @@ DEFAULT_HOST_SECRET=8201e33f60093f2ce49f1abe6be8*****
URL_LIST=[{"name":"localhost","url":"http://localhost","priority":4},{"name":"github.com","url":"https://github.com","priority":4}]
ZBX_CONFIG={"authentication_type":0,"ok_period":"1d"}
ZBX_ADMIN_USERS=[{"name":"user","password":"password"},{"name":"user1","password":"password"}]
GF_SECURITY_ADMIN_PASSWORD=grafana
GF_AUTH_LDAP_ENABLED=true
GF_AUTH_LDAP_CONFIG_FILE=/etc/grafana/ldap_custom.toml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если есть какой-то статический конфиг, не нужно его оглашать в общем конфиги, можно сделать это или в Dockerfile или же в docker-compose. В конфиг выносим, только все очень важное

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

понял, сделал

GF_AUTH_LDAP_ALLOW_SIGN_UP=true
#####Grafana`s LDAP Config Environments#####
#[[servers]]
LDAP_GF_HOST=172.17.0.1
LDAP_GF_PORT=389
LDAP_GF_USE_SSL=false
LDAP_GF_START_TLS=false
LDAP_GF_SKIP_VERIFY=false
LDAP_GF_BIND_DN=cn=admin,dc=example,dc=org
LDAP_GF_BIND_PASSWORD=admin
LDAP_GF_SEARCH_FILTER=(cn=%s)
LDAP_GF_SEARCH_BASE_DNS=dc=example,dc=org
#[servers.attributes]
LDAP_GF_NAME=giveName
LDAP_GF_SURNAME=sn
LDAP_GF_USERNAME=cn
LDAP_GF_MEMBER_OF=memberOf
LDAP_GF_EMAIL=email
#[[servers.group_mappings]]
LDAP_GF_GROUP_DN_ADMIN=cn=admins,dc=example,dc=org
LDAP_GF_ORG_ROLE_ADMIN=Admin
#[[servers.group_mappings]]
LDAP_GF_GROUP_DN_EDITOR=cn=users,dc=example,dc=org
LDAP_GF_ORG_ROLE_EDITOR=Editor
#[[servers.group_mappings]]
LDAP_GF_GROUP_DN_VIEWER=*
LDAP_GF_ORG_ROLE_VIEWER=Viewer

1 change: 1 addition & 0 deletions Dockerfile.configurator
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN apt-get update && \
libssl-dev \
python-pip && \
pip install \
jinja2 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Может есть вариант избежать установки jinja2, если не нужно обрабатывать сложные шаблоны?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Например .format()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да, как вариант

simplemysql \
pycurl \
pyzabbix && \
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile.grafana
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM grafana/grafana:latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всегда фиксируем версию базового образа, никогда не привязываемся к latest

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделал


USER root

ENV GF_INSTALL_PLUGINS=alexanderzobnin-zabbix-app

COPY ./scripts/run.sh /

RUN chmod +x /run.sh

ENTRYPOINT [ "/run.sh" ]
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "private_network", ip: "192.168.33.102"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
Expand Down Expand Up @@ -33,7 +34,7 @@ Vagrant.configure("2") do |config|
iotop \
htop \
mc
#

echo "Getting docker-compose from official repository..."
if [ ! -e "/usr/local/bin/docker-compose" ]; then
curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
Expand Down
Loading