Skip to content

Commit 85ffbb8

Browse files
authored
Rename default timezone env variables (#86)
Renames TZ env variables to GF_RENDERER_PLUGIN_TZ for plugin and BROWSER_TZ for service. Fallbacks to TZ env variable.
1 parent c284d18 commit 85ffbb8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ You can override certain settings by using environment variables and making sure
4040

4141
**Default timezone:**
4242

43-
Instruct headless Chrome to use a default timezone when not provided by Grafana, .e.g. when rendering panel image of alert. See [ICU’s metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.
43+
Instruct headless Chrome to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert. See [ICU’s metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs. Fallbacks to `TZ` environment variable if not set.
4444

4545
```bash
46-
TZ=Europe/Stockholm
46+
GF_RENDERER_PLUGIN_TZ=Europe/Stockholm
4747
```
4848

4949
**Ignore HTTPS errors:**

docs/remote_rendering_using_docker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ export HTTP_PORT=0
2626

2727
**Default timezone:**
2828

29-
Instruct headless Chrome to use a default timezone when not provided by Grafana, .e.g. when rendering panel image of alert. See [ICU’s metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.
29+
Instruct headless Chrome to use a default timezone when not provided by Grafana, .e.g. when rendering panel image of alert. See [ICU’s metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs. Fallbacks to `TZ` environment variable if not set.
3030

3131
```bash
32-
export TZ=Europe/Stockholm
32+
export BROWSER_TZ=Europe/Stockholm
3333
```
3434

3535
**Ignore HTTPS errors:**

src/app.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ main().catch(err => {
6767
});
6868

6969
function populatePluginConfigFromEnv(config: PluginConfig, env: NodeJS.ProcessEnv) {
70-
if (env['TZ']) {
70+
if (env['GF_RENDERER_PLUGIN_TZ']) {
71+
config.rendering.timezone = env['GF_RENDERER_PLUGIN_TZ'];
72+
} else {
7173
config.rendering.timezone = env['TZ'];
7274
}
7375

@@ -81,7 +83,9 @@ function populatePluginConfigFromEnv(config: PluginConfig, env: NodeJS.ProcessEn
8183
}
8284

8385
function populateServiceConfigFromEnv(config: ServiceConfig, env: NodeJS.ProcessEnv) {
84-
if (env['TZ']) {
86+
if (env['BROWSER_TZ']) {
87+
config.rendering.timezone = env['BROWSER_TZ'];
88+
} else {
8589
config.rendering.timezone = env['TZ'];
8690
}
8791

0 commit comments

Comments
 (0)