From c46df89aee4b046516f8a2502b5bdf499627927f Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:52:19 +0100 Subject: [PATCH] docs: follow up on recent core PRs --- configuration/secrets.md | 20 ++++++++++++++++++++ module-development/weather-provider.md | 9 ++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/configuration/secrets.md b/configuration/secrets.md index 60419451..08e00856 100644 --- a/configuration/secrets.md +++ b/configuration/secrets.md @@ -107,6 +107,9 @@ const config = { ... cors: "allowWhitelist", corsDomainWhitelist: ["api.mapbox.com"], + corsSecretWhitelist: { + "api.mapbox.com": ["SECRET_MAPBOX_ID", "SECRET_MAPBOX_TOKEN"] + }, ... modules: [ { @@ -142,6 +145,23 @@ above, we need to set ```js cors: "allowWhitelist", corsDomainWhitelist: ["api.mapbox.com"], + corsSecretWhitelist: { + "api.mapbox.com": ["SECRET_MAPBOX_ID", "SECRET_MAPBOX_TOKEN"] + }, ``` +Only secrets listed for the target hostname are substituted, all other +placeholders stay unchanged. With `cors: "allowAll"` no secrets are substituted. + +Requests with secrets must use HTTPS on port 443, must not contain URL +credentials, and secrets must not change the host. They are never redirected. + +If you already use secrets in proxy URLs, add a `corsSecretWhitelist` entry like +the one above. The modules themselves need no changes. + +Only list secrets the target service really needs, with minimal permissions. The +whitelist does not restrict paths or query parameters, and the service's +response is returned to the browser. A service that echoes the secret back can +still expose it. + ::: diff --git a/module-development/weather-provider.md b/module-development/weather-provider.md index 66ded24b..e62d9d87 100644 --- a/module-development/weather-provider.md +++ b/module-development/weather-provider.md @@ -62,7 +62,8 @@ class YourProvider { } initialize() { - this.fetcher = new HTTPFetcher("https://your.api/endpoint", { + this.fetcher = new HTTPFetcher({ + url: "https://your.api/endpoint", reloadInterval: this.config.updateInterval, logContext: "weatherprovider.yourprovider", }); @@ -170,8 +171,9 @@ or unexpected API response shapes can be reported through `onErrorCallback` instead of failing silently. `HTTPFetcher` (`require("#http_fetcher")`) handles periodic fetching with retry -and backoff. See -[`js/http_fetcher.js`](https://github.com/MagicMirrorOrg/MagicMirror/blob/master/js/http_fetcher.js) +and backoff. Pass `url` for a static address or `urlFactory` for an address that +changes between requests. See +[`js/http_fetcher.mjs`](https://github.com/MagicMirrorOrg/MagicMirror/blob/master/js/http_fetcher.mjs) for all options. Common `translationKey` values: `MODULE_ERROR_UNAUTHORIZED`, `MODULE_ERROR_RATE_LIMITED`, `MODULE_ERROR_SERVER_ERROR`, `MODULE_ERROR_NO_CONNECTION`, `MODULE_ERROR_UNSPECIFIED`. @@ -205,6 +207,7 @@ server-side provider returns plain objects; the weather module converts them to | temperature | `number` | Current temperature in metric `celsius degree`. | | minTemperature | `number` | Lowest temperature of the day in metric `celsius degree`. | | maxTemperature | `number` | Highest temperature of the day in metric `celsius degree`. | +| feelsLikeTemp | `number` | Optional apparent temperature in metric `celsius degree`. Calculated if omitted. | | weatherType | `string` | Icon name of the weather type.
Possible values: [WeatherIcons](https://www.npmjs.com/package/weathericons) | | humidity | `number` | Percentage of humidity | | precipitationAmount | `number` | Metric: `millimeters` |