diff --git a/.env.tmp b/.env.tmp index 6c524d4..36139e8 100644 --- a/.env.tmp +++ b/.env.tmp @@ -30,3 +30,9 @@ DISCORD_WEBHOOK_URL= # Slack Integration SLACK_WEBHOOK_URL= + +# Optional Extensions to Grafana +# Comma separated list of URLs to GitHub plugins to install. See grafana/entrypoint.sh for details +# GF_GITHUB_PLUGINS= +# Extended Grafana configuration file +# GRAFANA_ENV_FILE=.grafana.env diff --git a/.gitignore b/.gitignore index 2eea525..93b38be 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.env \ No newline at end of file +.env +.grafana.env +.DS_Store \ No newline at end of file diff --git a/.grafana.env.tmp b/.grafana.env.tmp new file mode 100644 index 0000000..0aa5144 --- /dev/null +++ b/.grafana.env.tmp @@ -0,0 +1,4 @@ +# Set custom parameters for Grafana +# https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#override-configuration-with-environment-variables +# GF_SERVER_ROOT_URL= +# GF_SERVER_SERVE_FROM_SUB_PATH= \ No newline at end of file diff --git a/README.md b/README.md index b7ea457..85e0d83 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,29 @@ DISCORD_WEBHOOK_URL= # Slack Integration SLACK_WEBHOOK_URL= + +# Optional Extensions to Grafana +# Comma separated list of URLs to GitHub plugins to install. See [grafana/entrypoint.sh](./grafana/entrypoint.sh) for details +# GF_GITHUB_PLUGINS= +# Extended Grafana configuration file +# GRAFANA_ENV_FILE=.grafana.env ``` > **Note:** If your targets (`WALRUS_NODE_TARGET`, `WALRUS_AGGREGATOR_TARGET`, `WALRUS_PUBLISHER_TARGET`) are HTTPS endpoints, make sure to include the `https://` protocol explicitly in the variable, e.g., `WALRUS_NODE_TARGET=https://node.example.com`. --- +#### (Optional) Grafana Customisation + +```bash +cp .grafana.env.tmp .grafana.env +``` + +In your `.env` file, set `GRAFANA_ENV_FILE=.grafana.env` so that Compose loads it. Then edit the `.grafana.env` file to configure additional Grafana settings. + +Refer to the [Grafana configuration documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#override-configuration-with-environment-variables) for details. + + ### **4. Start the Services** ```bash diff --git a/docker-compose.macos.yml b/docker-compose.macos.yml index fa1a09d..609fab5 100644 --- a/docker-compose.macos.yml +++ b/docker-compose.macos.yml @@ -11,13 +11,15 @@ services: GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER} GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD} GF_SERVER_HTTP_PORT: ${GF_PORT:-3000} - GF_GITHUB_PLUGINS: "https://github.com/grafana/grafana-infinity-datasource/releases/download/v2.11.4/yesoreyeram-infinity-datasource-2.11.4.zip" + GF_GITHUB_PLUGINS: ${GF_GITHUB_PLUGINS:-https://github.com/grafana/grafana-infinity-datasource/releases/download/v2.11.4/yesoreyeram-infinity-datasource-2.11.4.zip} PROMETHEUS_URL: "http://${PROMETHEUS_TARGET:-localhost:9090}" ALERTMANAGER_URL: "http://${ALERTMANAGER_TARGET:-localhost:9093}" WALRUS_NODE_TARGET: ${WALRUS_NODE_TARGET:-} WALRUS_AGGREGATOR_TARGET: ${WALRUS_AGGREGATOR_TARGET:-} WALRUS_PUBLISHER_TARGET: ${WALRUS_PUBLISHER_TARGET:-} WALRUS_NODE_URL: ${WALRUS_NODE_URL} + env_file: + - ${GRAFANA_ENV_FILE:-/dev/null} volumes: - ./grafana/dashboards:/tmp/dashboards - ./grafana/provisioning:/etc/grafana/provisioning diff --git a/docker-compose.yml b/docker-compose.yml index e70e49a..ee6b60e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,13 +10,15 @@ services: GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER} GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD} GF_SERVER_HTTP_PORT: ${GF_PORT:-3000} - GF_GITHUB_PLUGINS: "https://github.com/grafana/grafana-infinity-datasource/releases/download/v2.11.4/yesoreyeram-infinity-datasource-2.11.4.zip" + GF_GITHUB_PLUGINS: ${GF_GITHUB_PLUGINS:-https://github.com/grafana/grafana-infinity-datasource/releases/download/v2.11.4/yesoreyeram-infinity-datasource-2.11.4.zip} PROMETHEUS_URL: "http://${PROMETHEUS_TARGET:-localhost:9090}" ALERTMANAGER_URL: "http://${ALERTMANAGER_TARGET:-localhost:9093}" WALRUS_NODE_TARGET: ${WALRUS_NODE_TARGET:-} WALRUS_AGGREGATOR_TARGET: ${WALRUS_AGGREGATOR_TARGET:-} WALRUS_PUBLISHER_TARGET: ${WALRUS_PUBLISHER_TARGET:-} WALRUS_NODE_URL: ${WALRUS_NODE_URL} + env_file: + - ${GRAFANA_ENV_FILE:-/dev/null} volumes: - ./grafana/dashboards:/tmp/dashboards - ./grafana/provisioning:/etc/grafana/provisioning