Skip to content

Commit

Permalink
Merge pull request #6 from InfinityDevTech/master
Browse files Browse the repository at this point in the history
Fixed quite a few issues and removed quite a few un-needed containers.
  • Loading branch information
pieterbrandsen authored Jun 14, 2024
2 parents 243a8e1 + 49b0a07 commit b3d752a
Show file tree
Hide file tree
Showing 36 changed files with 1,150 additions and 3,490 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript"]
}
2 changes: 1 addition & 1 deletion LICENSE.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Pieter Brandsen
Copyright (c) 2023 Pieter Brandsen and Infinity Development

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,54 @@ A. MMO:

```json
{
"prefix": "a.b.c",
"username": "PandaMaster",
"type": "mmo",
"shards": ["shard0"],
"token": "TOKEN_FOR_THIS_USER!",
# Prefix is entirely optional
"prefix": "a.b.c",
"username": "PandaMaster",
"type": "mmo",
"shards": ["shard0"],
"token": "TOKEN_FOR_THIS_USER!",
}
```

B. Private:

```json
{
"prefix": "a.b.c",
"username": "W1N1",
"type": "private",
"shards": ["screeps"],
"password": "password",
# Prefix is entirely optional
"prefix": "a.b.c",
"username": "EMAIL",
# If your email has a period in it, grafana displays it incorrectly
# Its reccomended to change this to the username you set for MMO.
"replaceName": "USERNAME HERE",
"type": "private",
"shards": ["screeps"],
"password": "password",
}
```

If the private server is not hosted on localhost, add the host to the user:

```json
{
"username": "W1N1",
"type": "private",
"shards": ["screeps"],
"password": "password",
"host": "123.456.789",
"username": "EMAIL",
"replaceName": "USERNAME",
"type": "private",
"shards": ["screeps"],
"password": "password",
"host": "192.168.1.10",
}
```

If the segment of the stats is not memory, add it to the user:

```json
{
"username": "W1N1",
"type": "private",
"shards": ["screeps"],
"password": "password",
"host": "123.456.789",
"segment": 0,
"username": "W1N1",
"type": "private",
"shards": ["screeps"],
"password": "password",
"host": "123.456.789",
"segment": 0,
}
```

Expand All @@ -77,12 +83,9 @@ Update all .example files and/or folders to match your needs. This step is not r

* `--force`: force the non .example config files to be overwritten.
* `--debug`: listen to setup Docker logs
* `--traefik`: Add traefik labels to the docker-compose.yml file, reverse proxy for docker containers.
* `--username`: overwrite the username for the Grafana admin user
* `--password`: overwrite the password for the Grafana admin user
* `--defaultRetention`: overwrite the default retention for the default retention polic of all not regex'd retention paths.
* `--enableAnonymousAccess`: enable anonymous access to Grafana
* `--traefikHost`: use only traefik forwarding

#### Network

Expand All @@ -99,8 +102,7 @@ Update all .example files and/or folders to match your needs. This step is not r
## Usage

* `npm run setup`: to execute setup only
* `npm run start:standalone`: to configure and start it
* `npm run start:standalone-traefik` to confgiure with traefik and start it
* `npm run start`: to configure and start it
* For other run commands like eslint, check out package.json scripts object.

Go to [localhost:3000](http://localhost:3000) (if you used port 3000) and login with `admin` and `password` (or your custom set login info).
Expand Down
103 changes: 23 additions & 80 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ version: "3.5"

volumes:
grafana_data:
go-carbon_data:
graphite_data:

networks:
internal:
stats:
driver: bridge
external:
driver: bridge
#t#htraefik-net:
#t#h external: true

x-logging: &default-logging
driver: "local"
Expand All @@ -19,93 +15,40 @@ x-logging: &default-logging
max-file: "5"

services:
stats-getter:
build:
context: .
dockerfile: ./src/pushStats/Dockerfile
volumes:
- ./logs/statsGetter:/app/logs
depends_on:
- carbon-relay-ng
environment:
- PREFIX=
- SERVER_PORT=21025
- INCLUDE_PUSH_STATUS_API=false
carbon-relay-ng:
image: grafana/carbon-relay-ng
depends_on:
- go-carbon
volumes:
- ./grafanaConfig/carbon-relay-ng:/conf
ports:
- 127.0.0.1:2003:2003
networks:
- internal
logging: *default-logging
go-carbon:
image: ghcr.io/go-graphite/go-carbon
graphite:
image: graphiteapp/graphite-statsd
volumes:
- ./grafanaConfig/go-carbon/go-carbon.conf:/etc/go-carbon/go-carbon.conf
- ./grafanaConfig/go-carbon:/etc/go-carbon/
- ./go-carbon-storage:/var/lib/graphite/whisper
#- ./logs/goCarbon:/var/log/go-carbon
- ./logs/graphite:/var/log
- ./grafanaConfig/graphite:/opt/graphite/conf
- graphite_data:/opt/graphite/storage
networks:
- internal
logging: *default-logging
carbon-api:
image: pieterbrandsen/carbonapi-0.15.6
volumes:
- ./grafanaConfig/carbonapi/carbonapi.yml:/etc/carbonapi.yml
- ./grafanaConfig/carbonapi:/conf:ro
- ./logs/carbonApi:/log
depends_on:
- go-carbon
networks:
- internal
- external
logging: *default-logging
- stats
grafana:
#t container_name: grafana
image: grafana/grafana-oss:9.3.6-ubuntu
volumes:
- grafana_data:/var/lib/grafana
- ./grafanaConfig/grafana:/etc/grafana
- ./logs/grafana:/var/log/grafana
ports:
- 3000:3000
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: "curl -fsSL -o /dev/null http://localhost:3000/login"
interval: 10s
timeout: 5s
retries: 3
networks:
- external
#t#h- traefik-net
logging: *default-logging
#t labels:
#t - "traefik.enable=true"
#t - "traefik.http.routers.grafana.rule=Host(`grafana.localhost`)"
#t#h - "traefik.docker.network=traefik-net"
#t - "traefik.http.services.grafana.loadbalancer.server.port=3000"
#t#h - "traefik.http.routers.grafana.entrypoints=websecure"
#t#h - "traefik.http.routers.grafana.tls.certresolver=letsencrypt"
#ttraefik:
#t image: traefik:v2.5.4
#t container_name: traefik
#t command:
#t - "--log.level=DEBUG"
#t - "--api.insecure=true"
#t - "--api.dashboard=true"
#t - "--providers.docker=true"
#t - "--providers.docker.exposedbydefault=false"
#t - "--entrypoints.web.address=:80"
#t - "--entrypoints.websecure.address=:443"
#t volumes:
#t - /var/run/docker.sock:/var/run/docker.sock
#t ports:
#t - 80:80
#t - 443:443
#t - 8080:8080
#t logging: *default-logging
- stats
stats-getter:
build:
context: .
dockerfile: ./src/pushStats/Dockerfile
volumes:
- ./logs/statsGetter:/app/logs
depends_on:
- graphite
environment:
- PREFIX=
- SERVER_PORT=21025
- INCLUDE_PUSH_STATUS_API=false
networks:
- stats
143 changes: 0 additions & 143 deletions grafanaConfig.example/carbon-relay-ng/carbon-relay-ng.ini

This file was deleted.

Loading

0 comments on commit b3d752a

Please sign in to comment.