Skip to content
Permalink
Browse files

cleanup code

  • Loading branch information...
naviat committed Apr 23, 2019
0 parents commit 8d0c6734ac16a14c507a09d43b046ce5abf68fd2
Showing with 6,542 additions and 0 deletions.
  1. +9 −0 .dockerignore
  2. +75 −0 .gitignore
  3. +35 −0 .travis.yml
  4. +21 −0 LICENSE
  5. +18 −0 README.md
  6. +8 −0 dex/config/addresses.json
  7. +83 −0 dex/dex-stack..yml
  8. +130 −0 dex/docker-compose.testnet.backend.yml
  9. +44 −0 dex/docker-compose.testnet.frontend.yml
  10. +9 −0 docker/alertmanager/Dockerfile
  11. +14 −0 docker/alertmanager/conf/alertmanager.yml
  12. +12 −0 docker/alertmanager/conf/docker-entrypoint.sh
  13. +39 −0 docker/caddy/Caddyfile
  14. +8 −0 docker/dockerd-exporter/Caddyfile
  15. +13 −0 docker/fluentd/Dockerfile
  16. +63 −0 docker/fluentd/etc/fluent.conf
  17. +9 −0 docker/grafana/Dockerfile
  18. +11 −0 docker/grafana/dashboards.yml
  19. +2,063 −0 docker/grafana/dashboards/nodes-dash.json
  20. +1,248 −0 docker/grafana/dashboards/prometheus-dash.json
  21. +1,884 −0 docker/grafana/dashboards/services-dash.json
  22. +13 −0 docker/grafana/datasources/prometheus.yaml
  23. +12 −0 docker/graylog/Dockerfile
  24. +43 −0 docker/graylog/entrypoint.sh
  25. BIN docker/graylog/slack-3.1.0.jar
  26. +1 −0 docker/nginx/conf.d/default.conf
  27. +1 −0 docker/nginx/conf.d/gzip.mime.types
  28. 0 docker/nginx/conf.d/server.d/grafana.conf
  29. +30 −0 docker/nginx/conf.d/server.d/kibana.conf
  30. +31 −0 docker/nginx/nginx.conf
  31. +10 −0 docker/node-exporter/Dockerfile
  32. +8 −0 docker/node-exporter/conf/docker-entrypoint.sh
  33. +10 −0 docker/prometheus/Dockerfile
  34. +35 −0 docker/prometheus/conf/docker-entrypoint.sh
  35. +44 −0 docker/prometheus/conf/prometheus.yml
  36. +44 −0 docker/prometheus/rules/swarm_node.rules.yml
  37. +24 −0 docker/prometheus/rules/swarm_task.rules.yml
  38. +79 −0 docker/proxy_old/conf/nginx.conf
  39. +63 −0 monitoring/00_logging.yml
  40. +92 −0 monitoring/01_logging.yml
  41. +206 −0 monitoring/01_metrics.yml
@@ -0,0 +1,9 @@
# Created by .ignore support plugin (hsz.mobi)
### Example user template template
### Example user template

# IntelliJ project files
.idea
*.iml
out
gen
@@ -0,0 +1,75 @@
# Created by .ignore support plugin (hsz.mobi)
### VirtualEnv template
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/
cmake-build-release/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

.idea/dex-infrastructure.iml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml

*/.idea/**
.idea/
@@ -0,0 +1,35 @@
sudo: required

services:
- docker

before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
- sudo service docker restart

script:
- cd docker/prometheus && docker build -t naviat/prometheus:$TRAVIS_BUILD_NUMBER .
- cd .. && cd node-exporter && docker build -t naviat/node-exporter:$TRAVIS_BUILD_NUMBER .
- cd .. && cd alertmanager && docker build -t naviat/alertmanager:$TRAVIS_BUILD_NUMBER .
- cd .. && cd grafana && docker build -t naviat/grafana:$TRAVIS_BUILD_NUMBER .
- cd .. && cd fluentd && docker build -t naviat/fluentd:$TRAVIS_BUILD_NUMBER .

after_success:
- if [ -z "$DOCKER_USER" ]; then
echo "PR build, skipping Docker Hub push";
else
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
docker tag naviat/prometheus:$TRAVIS_BUILD_NUMBER naviat/prometheus:v2.8.0;
docker push naviat/prometheus:v2.8.0;
docker tag naviat/node-exporter:$TRAVIS_BUILD_NUMBER naviat/node-exporter:v0.16.0;
docker push naviat/node-exporter:v0.16.0;
docker tag naviat/alertmanager:$TRAVIS_BUILD_NUMBER naviat/alertmanager:v0.16.0;
docker push naviat/alertmanager:v0.16.0;
docker tag naviat/grafana:$TRAVIS_BUILD_NUMBER naviat/grafana:5.3.4;
docker push naviat/grafana:5.3.4;
docker tag naviat/fluentd:$TRAVIS_BUILD_NUMBER naviat/fluentd:1.3;
docker push naviat/fluentd:1.3;
fi
21 LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Hai V.Dam

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,18 @@
# DEX-INFRASTRUCTURE

[![Build Status](https://travis-ci.org/naviat/dex-infrastructure.svg?branch=master)](https://travis-ci.org/naviat/dex-infrastructure)

This is a starter kit for Docker Swarm monitoring with [Prometheus](https://prometheus.io/),
[Grafana](http://grafana.org/),
[cAdvisor](https://github.com/google/cadvisor),
[Node Exporter](https://github.com/prometheus/node_exporter),
[Alert Manager](https://github.com/prometheus/alertmanager)
and [Unsee](https://github.com/cloudflare/unsee).

[![naviat/grafana](http://dockeri.co/image/naviat/grafana)](https://hub.docker.com/r/naviat/grafana/)

[![naviat/alertmanager](http://dockeri.co/image/naviat/alertmanager)](https://hub.docker.com/r/naviat/alertmanager/)

[![naviat/node-exporter](http://dockeri.co/image/naviat/node-exporter)](https://hub.docker.com/r/naviat/node-exporter/)

[![naviat/prometheus](http://dockeri.co/image/naviat/prometheus)](https://hub.docker.com/r/naviat/prometheus/)
@@ -0,0 +1,8 @@
{
"89": {
"BTC": "0x7FaCB8CBE39D06a1831D362eE48a4fAE4c427D66",
"ETH": "0x442B992b42f050aD76336A76c4d02a74d2EbA24B",
"USDT": "0x5c3C15FE028569e2Ac3ff9F98f889aEE4e508E8D",
"TOMOS": "0x6C2cc338Cf9140b97559878fAC68AA4D56fC7390"
}
}
@@ -0,0 +1,83 @@
version: '3.4'
services:
mongo0:
hostname: mongo0
container_name: mongo0
image: mongo
ports:
- 27017:27017
volumes:
- ./datadir/datadir0:/data/db
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
mongo1:
hostname: mongo1
container_name: mongo1
image: mongo
ports:
- 27018:27017
volumes:
- ./datadir/datadir1:/data/db
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
mongo2:
hostname: mongo2
container_name: mongo2
image: mongo
ports:
- 27019:27017
volumes:
- ./datadir/datadir2:/data/db
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
mongo-rs0-setup:
container_name: "mongo-rs0-setup"
image: mongo
depends_on:
- "mongo0"
- "mongo1"
- "mongo2"
links:
- mongo0:mongo0
- mongo1:mongo1
- mongo2:mongo2
volumes:
- ./scripts:/scripts
environment:
- MONGO0=mongo0
- MONGO1=mongo1
- MONGO2=mongo2
- RS=rs0
entrypoint: [ "/scripts/setup_mongo.sh" ]

rabbitmq:
image: rabbitmq
container_name: 'rabbitmq'
ports:
- '5672:5672'
- '15672:15672'

server:
image: naviat/dex-server
container_name: 'server'
volumes:
- ./config/addresses.json:./src/dex-server/config/addresses.json
ports:
- '8080:8080'


client:
image: naviat/dex-client
container_name: 'client'
volumes:
- ./config/addresses.json:./src/dex-server/src/config/addresses.json
ports:
- '80:80'

proxy:
image: naviat/nginx-proxy
container_name: 'proxy'
ports:
- '80:80'
- '443:443'

@@ -0,0 +1,130 @@
version: '3.7'
services:
# Currently the username and password need to be set manually after deployment with the following commands:
# rabbitmqctl add_user ${username} ${password}
# rabbitmqctl set_user_tags ${username} administrator
# rabbitmqctl set_permissions ${username} ".*" ".*" ".*"
rabbitmq:
hostname: rabbitmq
image: rabbitmq
ports:
- '5672:5672'
- '5671:5671'
networks:
server-backend:
aliases:
- rabbitmq
volumes:
- "rabbitmq_staging_logs:/var/log/rabbitmq"
- "rabbitmq_staging_data:/var/lib/rabbitmq"
configs:
- source: rabbitmq-ca-cert
target: /etc/ssl/rabbitmq/ca_certificate.pem
- source: rabbitmq-server-cert
target: /etc/ssl/rabbitmq/server_certificate.pem
- source: rabbitmq-server-key
target: /etc/ssl/rabbitmq/server_key.pem
- source: rabbitmq-config
target: /etc/rabbitmq/rabbitmq.conf
deploy:
placement:
constraints:
- node.hostname == rabbitmq
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s

server:
hostname: server
image: naviat/server:staging
ports:
- '443:443'
- '80:80'
depends_on:
- rabbitmq
- mongodb
volumes:
- "engine_staging_certificates:/certs"
environment:
- TOMO_ETHEREUM_NODE_HTTP_URL=https://testnet.tomochain.com
- TOMO_ETHEREUM_NODE_WS_URL=wss://testnet.tomochain.com/ws
- TOMO_MONGODB_URL=mongodb
- TOMO_MONGODB_DBNAME=tomodex
- TOMO_MONGODB_USERNAME=${TOMO_STAGING_MONGODB_USERNAME}
- TOMO_MONGODB_PASSWORD=${TOMO_STAGING_MONGODB_PASSWORD}
- TOMO_MONGODB_SHARD_URL_1=tomocluster0-shard-00-00-qdjqg.mongodb.net:27017
- TOMO_MONGODB_SHARD_URL_2=tomocluster0-shard-00-01-qdjqg.mongodb.net:27017
- TOMO_MONGODB_SHARD_URL_3=tomocluster0-shard-00-02-qdjqg.mongodb.net:27017
- TOMO_ENABLE_TLS=true
- TOMO_RABBITMQ_URL=rabbitmq
- TOMO_RABBITMQ_USERNAME=${TOMO_STAGING_RABBITMQ_USERNAME}
- TOMO_RABBITMQ_PASSWORD=${TOMO_STAGING_RABBITMQ_PASSWORD}
- TOMO_SERVER_CA_CERT=/etc/ssl/server/ca_certificate.pem
- TOMO_SERVER_SERVER_CERT=/etc/ssl/server/server_certificate.pem
- TOMO_SERVER_SERVER_KEY=/etc/ssl/server/server_key.pem
- TOMO_RABBITMQ_CLIENT_KEY=/etc/ssl/rabbitmq/client_key.pem
- TOMO_RABBITMQ_CLIENT_CERT=/etc/ssl/rabbitmq/client_certificate.pem
configs:
- source: server-ca-cert
target: /etc/ssl/server/ca_certificate.pem
- source: server-server-cert
target: /etc/ssl/server/server_certificate.pem
- source: server-server-key
target: /etc/ssl/server/server_key.pem
- source: rabbitmq-client-cert
target: /etc/ssl/rabbitmq/client_certificate.pem
- source: rabbitmq-client-key
target: /etc/ssl/rabbitmq/client_key.pem

networks:
server-backend:
aliases:
- server
deploy:
placement:
constraints:
- node.hostname == server
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s

networks:
server-backend:
external: true

configs:
server-ca-cert:
name: server-ca-cert-${STAGING_CONFIG_VERSION:-0}
external: true
server-server-cert:
name: server-server-cert-${STAGING_CONFIG_VERSION:-0}
external: true
server-server-key:
name: server-server-key-${STAGING_CONFIG_VERSION:-0}
external: true
rabbitmq-client-cert:
name: rabbitmq-client-cert-${STAGING_CONFIG_VERSION:-0}
external: true
rabbitmq-client-key:
name: rabbitmq-client-key-${STAGING_CONFIG_VERSION:-0}
external: true
rabbitmq-ca-cert:
name: rabbitmq-ca-cert-${STAGING_CONFIG_VERSION:-0}
external: true
rabbitmq-server-cert:
name: rabbitmq-server-cert-${STAGING_CONFIG_VERSION:-0}
external: true
rabbitmq-server-key:
name: rabbitmq-server-key-${STAGING_CONFIG_VERSION:-0}
external: true
rabbitmq-config:
name: rabbitmq-config-${STAGING_CONFIG_VERSION:-0}
external: true

volumes:
rabbitmq_staging_logs:
rabbitmq_staging_data:
engine_staging_certificates:
client_staging_certificates:
Oops, something went wrong.

0 comments on commit 8d0c673

Please sign in to comment.
You can’t perform that action at this time.