Skip to content

Commit f9754a2

Browse files
committed
env: MAPTILER_STYLE_KEY -> MAPTILER_API_KEY
1 parent 2bdfe40 commit f9754a2

6 files changed

Lines changed: 10 additions & 9 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ NEXTAUTH_URL=123
77
NEXTAUTH_SECRET=123
88

99
# Maptile configuration
10-
MAPTILER_STYLE_KEY=123
10+
MAPTILER_API_KEY=123
1111

1212
# SEO
1313
PREVENT_SEARCH_BOTS=false

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ You can also check the
1414
- Features
1515
- Add SPARQL endpoints in the OpenTelemetry traces
1616
- Maintenance
17-
- Set Maptiler API key from environment variable at runtime, to avoid having
18-
to rebuild the application when the key is rotated
17+
- Set Maptiler API key from `MAPTILER_API_KEY` environment variable at
18+
runtime, to avoid having to rebuild the application when the key is rotated
1919

2020
### 6.4.0 – 2026-03-13
2121

app/.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ SPARQL_GEO_ENDPOINT=https://geo.ld.admin.ch/query
44
GRAPHQL_ENDPOINT=/api/graphql
55
WHITELISTED_DATA_SOURCES=["Prod", "Prod-uncached", "Int", "Int-uncached", "Test", "Test-uncached", "LINDASold-Prod", "LINDASold-Prod-uncached", "LINDASold-Int", "LINDASold-Int-uncached", "LINDASold-Test", "LINDASold-Test-uncached"]
66
NEXT_PUBLIC_VECTOR_TILE_URL=https://world.vectortiles.geo.admin.ch
7-
MAPTILER_STYLE_KEY=123
7+
MAPTILER_API_KEY=123
88
ADFS_PROFILE_URL=https://www.myaccount-r.eiam.admin.ch/
99
NEXTAUTH_URL=https://localhost:3000

app/charts/map/get-base-layer-style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import merge from "lodash/merge";
22
import { useMemo } from "react";
33
import { MapboxStyle } from "react-map-gl";
44

5-
import { BASE_VECTOR_TILE_URL, MAPTILER_STYLE_KEY } from "@/domain/env";
5+
import { BASE_VECTOR_TILE_URL, MAPTILER_API_KEY } from "@/domain/env";
66

77
import { Locale } from "../../locales/locales";
88

99
import greyStyleBase from "./grey.json";
1010
import { hasLayout, mapLayers, replaceStyleTokens } from "./style-helpers";
1111

1212
const tokens = {
13-
"{key}": MAPTILER_STYLE_KEY,
13+
"{key}": MAPTILER_API_KEY,
1414
"<BASE_VECTOR_TILE>": BASE_VECTOR_TILE_URL,
1515
};
1616

app/domain/env.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export const GA_TRACKING_ID =
4848
export const ADFS_PROFILE_URL =
4949
clientEnv?.ADFS_PROFILE_URL ?? process.env.ADFS_PROFILE_URL;
5050

51+
export const MAPTILER_API_KEY =
52+
clientEnv?.MAPTILER_API_KEY ?? process.env.MAPTILER_API_KEY ?? "";
53+
5154
/**
5255
* Server-side-only **RUNTIME** variables (not exposed through window)
5356
*/
@@ -66,5 +69,3 @@ export const BUILD_GITHUB_REPO = (
6669
).replace(/^git\+https/, "https"); // Don't use git+https for the link, need to check with Abraxas
6770
export const BASE_VECTOR_TILE_URL =
6871
process.env.NEXT_PUBLIC_BASE_VECTOR_TILE_URL ?? "";
69-
export const MAPTILER_STYLE_KEY =
70-
clientEnv?.MAPTILER_STYLE_KEY ?? process.env.MAPTILER_STYLE_KEY ?? "";

app/pages/api/client-env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default async function clientEnvApi(
2424
PUBLIC_URL: process.env.PUBLIC_URL,
2525
GRAPHQL_ENDPOINT: process.env.GRAPHQL_ENDPOINT,
2626
ADFS_PROFILE_URL: process.env.ADFS_PROFILE_URL,
27-
MAPTILER_STYLE_KEY: process.env.MAPTILER_STYLE_KEY,
27+
MAPTILER_API_KEY: process.env.MAPTILER_API_KEY,
2828
})}`;
2929

3030
if (result) {

0 commit comments

Comments
 (0)