feat: [#415] add GF_SERVER_ROOT_URL to Grafana service in generated docker-compose#418
Merged
josecelano merged 2 commits intomainfrom Apr 6, 2026
Merged
Conversation
Member
Author
|
ACK 8a269d1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #415
When the deployer generates a
docker-compose.yml, the Grafana service now includesGF_SERVER_ROOT_URLso that public dashboard share links use the correct external URL instead ofhttp://localhost:3000.Changes
The implementation follows the existing env-var injection pattern (value in
.env, reference indocker-compose.yml):templates/docker-compose/.env.tera— emitsGF_SERVER_ROOT_URL='<url>'conditionally when a Grafana domain is configuredtemplates/docker-compose/docker-compose.yml.tera— adds- GF_SERVER_ROOT_URL=${GF_SERVER_ROOT_URL}to the Grafanaenvironment:block, conditionallyGrafanaServiceContext(infrastructurelayer) — computesserver_root_urlfromdomain+use_tls_proxyflag:https://<domain>when TLS is enabled,http://<domain>otherwise,Nonewhen no domain is setGrafanaServiceConfig/EnvContext(infrastructurelayer) — carriesserver_root_urlthrough to the.envtemplateapply_grafana_env_context(applicationlayer) — derives and passesserver_root_urlwhen building the env contextBehaviour
GF_SERVER_ROOT_URLemitteddomainsetdomainset,use_tls_proxy=falsehttp://<domain>domainset,use_tls_proxy=truehttps://<domain>Testing
All existing tests pass (
cargo test— 416 tests). Pre-commit checks pass (TORRUST_TD_SKIP_SLOW_TESTS=true ./scripts/pre-commit.sh).