Skip to content

Commit

Permalink
Merge pull request #6 from dbrennand/update
Browse files Browse the repository at this point in the history
Update - v1.0.0
  • Loading branch information
dbrennand authored Aug 7, 2023
2 parents 304a6bc + 1e6b8cc commit f93cb19
Show file tree
Hide file tree
Showing 9 changed files with 533 additions and 426 deletions.
11 changes: 4 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
SPEEDTEST_INTERVAL=300
SPEEDTEST_SERVER_ID=
# InfluxDB container environment variables
# If you are running on a Raspberry Pi, use 1.8.3
INFLUXDB_IMAGE_TAG=1.8-alpine
INFLUXDB_GRAPHITE_ENABLED=false
INFLUXDB_REPORTING_DISABLED=true
INFLUXDB_IMAGE_TAG=2.7.1
# You SHOULD change these!
# Make sure you also edit these in /grafana-config/datasources/datasource.yml
INFLUXDB_USER=root
INFLUXDB_USER_PASSWORD=root
DOCKER_INFLUXDB_INIT_USERNAME=root
DOCKER_INFLUXDB_INIT_PASSWORD=root
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=root
# Grafana container environment variables
# You SHOULD change these!
GF_SECURITY_ADMIN_USER=admin
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 dbrennand
Copyright (c) 2023 dbrennand

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
46 changes: 18 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,38 @@ Use [Grafana](https://grafana.com/), [InfluxDB](https://www.influxdata.com/produ

1. Docker

2. docker-compose
2. Docker Compose

## Usage

> [!NOTE]
>
> Make sure you run the commands below from the project directory.
1. Build the speedtest-grafana container image:

1. Build the speedtest-grafana container image using the command: `docker-compose build`
```bash
docker compose build
```

2. Set the `SPEEDTEST_SERVER_ID` environment variable located in the [.env](.env) file to the server ID to perform speedtests against.

> [!NOTE]
> **Note**
>
> If you don't know any server IDs, run the following command and they will be shown: `docker run --rm -it speedtest-grafana:0.0.2 /librespeed --list`
3. Modify any other environment variables located in the [.env](.env) file.

> [!WARNING]
>
> It is **highly** recommended that you change the default usernames and passwords!
>
> When modifying the `INFLUXDB_USER` and `INFLUXDB_USER_PASSWORD` environment variables. Make sure you also modify them in [datasource.yml](/grafana-config/datasources/datasource.yml):
>
> ```yaml
> # You SHOULD change these!
> user: root
> secureJsonData:
> password: root
> If you don't know any server IDs, run the following command to list them:
> ```bash
> docker run --rm -it speedtest-grafana:1.0.0 /librespeed --list
> ```
> [!NOTE]
>
> If you intend to run this project on a Raspberry Pi, make sure you alter the `INFLUXDB_IMAGE_TAG` to `1.8.3`.
3. Set the `DOCKER_INFLUXDB_INIT_PASSWORD`, `DOCKER_INFLUXDB_INIT_ADMIN_TOKEN` and `GF_SECURITY_ADMIN_PASSWORD` environment variables located in the [.env](.env) file.
4. Start the containers:
4. Start the containers using the command: `docker-compose up -d`
```bash
docker compose up -d
```
5. Access Grafana at [`http://localhost:3000`](http://localhost:3000)
> [!NOTE]
> **Note**
>
> You should also be able to access Grafana from your host's IP address.
> Grafana will also be available from your host's IP address.

## Disclaimer

Expand All @@ -57,7 +47,7 @@ If you like this project then please give their repositories a star! ⭐

## Authors -- Contributors

* [**dbrennand**](https://github.com/dbrennand) - *Author*
[**Daniel Brennand**](https://github.com/dbrennand) - *Author*

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) for details.
35 changes: 24 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,35 @@ services:
expose:
- 8086
volumes:
- influxdb:/var/lib/influxdb
- influxdb:/var/lib/influxdb2
restart: always
networks:
- speedtest-grafana
environment:
- "INFLUXDB_GRAPHITE_ENABLED=${INFLUXDB_GRAPHITE_ENABLED}"
- "INFLUXDB_REPORTING_DISABLED=${INFLUXDB_REPORTING_DISABLED}"
- "INFLUXDB_DB=internet_speed"
- "INFLUXDB_USER=${INFLUXDB_USER}"
- "INFLUXDB_USER_PASSWORD=${INFLUXDB_USER_PASSWORD}"
- "DOCKER_INFLUXDB_INIT_MODE=setup"
- "DOCKER_INFLUXDB_INIT_USERNAME=${DOCKER_INFLUXDB_INIT_USERNAME}"
- "DOCKER_INFLUXDB_INIT_PASSWORD=${DOCKER_INFLUXDB_INIT_PASSWORD}"
- "DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN}"
- "DOCKER_INFLUXDB_INIT_ORG=internet_speed"
- "DOCKER_INFLUXDB_INIT_BUCKET=internet_speed"
speedtest-grafana:
build: .
image: speedtest-grafana:0.0.2
image: speedtest-grafana:1.0.0
container_name: speedtest-grafana
depends_on:
- influxdb
networks:
- speedtest-grafana
environment:
- "SPEEDTEST_INTERVAL=${SPEEDTEST_INTERVAL}"
- "SPEEDTEST_SERVER_ID=${SPEEDTEST_SERVER_ID}"
- "INFLUXDB_HOST=influxdb"
- "INFLUXDB_PORT=8086"
- "INFLUXDB_DB=internet_speed"
- "INFLUXDB_USER=${INFLUXDB_USER}"
- "INFLUXDB_USER_PASSWORD=${INFLUXDB_USER_PASSWORD}"
- "INFLUXDB_ORG=internet_speed"
- "INFLUXDB_BUCKET=internet_speed"
- "INFLUXDB_TOKEN=${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN}"
grafana:
image: grafana/grafana:7.3.7
image: grafana/grafana:10.0.3
container_name: grafana
ports:
- 3000:3000
Expand All @@ -39,10 +44,18 @@ services:
depends_on:
- influxdb
- speedtest-grafana
networks:
- speedtest-grafana
environment:
- "GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}"
- "GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}"
- "INFLUXDB_ORG=internet_speed"
- "INFLUXDB_BUCKET=internet_speed"
- "INFLUXDB_TOKEN=${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN}"

volumes:
influxdb:
grafana-storage:

networks:
speedtest-grafana:
Loading

0 comments on commit f93cb19

Please sign in to comment.