Skip to content

Commit fb41d24

Browse files
khasselsdetweilKristjanESPERANTOrejasveeck
authored
Release 2.36.0 (#4127)
## Release Notes Thanks to: @cgillinger, @khassel, @KristjanESPERANTO, @sonnyb9 > ⚠️ This release needs nodejs version >=22.21.1 <23 || >=24 (no change to previous release) [Compare to previous Release v2.35.0](v2.35.0...v2.36.0) This release falls outside the quarterly schedule. We opted for an early release due to: - Security fix for the internal cors proxy - API change of the weather provider smi - Several bug fixes ### Breaking Changes The cors proxy is now disabled by default. If required, it must be explicitly enabled in the `config.js` file. See the [documentation](https://docs.magicmirror.builders/configuration/cors.html). ### ⚠️ Security You can find several publicly accessible MagicMirror² instances. This should never be done. Doing so makes your entire configuration, including secrets and API keys, publicly visible. Furthermore, it allows attackers to target the host; this is only prevented beginning with this release. Public MagicMirror² instances should always run behind a reverse proxy with authentication. ### [core] - Prepare Release 2.36.0 (#4126) - Allow HTTPFetcher to pass through 304 responses (#4120) - fix(http-fetcher): fall back to reloadInterval after retries exhausted (#4113) - config endpoint must handle functions in module configs (#4106) - fix replaceSecretPlaceholder (#4104) - restrict replaceSecretPlaceholder to cors with allowWhitelist (#4102) - fix: prevent crash when config is undefined in socket handler (#4096) - fix cors function for alpine linux (#4091) - fix(cors): prevent SSRF via DNS rebinding (#4090) - add option to disable or restrict cors endpoint (#4087) - fix: prevent SSRF via /cors endpoint by blocking private/reserved IPs (#4084) - chore: add permissions section to enforce pull-request rules workflow (#4079) - update version for develop ### [dependencies] - update dependencies (#4124) - chore: update dependencies (#4088) - refactor: enable ESLint rule "no-unused-vars" and handle related issues (#4080) ### [modules/newsfeed] - fix(newsfeed): prevent duplicate parse error callback when using pipeline (#4083) ### [modules/updatenotification] - fix(updatenotification): harden git command execution + simplify checkUpdates (#4115) - fix(tests): correct import path for git_helper module in updatenotification tests (#4078) ### [modules/weather] - fix(weather): use nearest openmeteo hourly data (#4123) - fix(weather): avoid loading state after reconnect (#4121) - weather: fix UV index display and add WeatherFlow precipitation (#4108) - fix(weather): restore OpenWeatherMap v2.5 support (#4101) - fix(weather): use stable instanceId to prevent duplicate fetchers (#4092) - SMHI: migrate to SNOW1gv1 API (replace deprecated PMP3gv2) (#4082) ### [testing] - ci(actions): set explicit token permissions (#4114) - fix(http_fetcher): use undici.fetch when dispatcher is present (#4097) - ci(codeql): also scan develop branch on push and PR (#4086) - refactor: replace implicit global config with explicit global.config (#4085) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: sam detweiler <sdetweil@gmail.com> Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Co-authored-by: Veeck <github@veeck.de> Co-authored-by: veeck <gitkraken@veeck.de> Co-authored-by: Magnus <34011212+MagMar94@users.noreply.github.com> Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DevIncomin <56730075+Developer-Incoming@users.noreply.github.com> Co-authored-by: Nathan <n8nyoung@gmail.com> Co-authored-by: mixasgr <mixasgr@users.noreply.github.com> Co-authored-by: Savvas Adamtziloglou <savvas-gr@greeklug.gr> Co-authored-by: Konstantinos <geraki@gmail.com> Co-authored-by: OWL4C <124401812+OWL4C@users.noreply.github.com> Co-authored-by: BugHaver <43462320+bughaver@users.noreply.github.com> Co-authored-by: BugHaver <43462320+lsaadeh@users.noreply.github.com> Co-authored-by: Bugsounet - Cédric <github@bugsounet.fr> Co-authored-by: Koen Konst <koenspero@gmail.com> Co-authored-by: Koen Konst <c.h.konst@avisi.nl> Co-authored-by: dathbe <github@beffa.us> Co-authored-by: Marcel <m-idler@users.noreply.github.com> Co-authored-by: Kevin G. <crazylegstoo@gmail.com> Co-authored-by: Jboucly <33218155+jboucly@users.noreply.github.com> Co-authored-by: Jboucly <contact@jboucly.fr> Co-authored-by: Jarno <54169345+jarnoml@users.noreply.github.com> Co-authored-by: Jordan Welch <JordanHWelch@gmail.com> Co-authored-by: Blackspirits <blackspirits@gmail.com> Co-authored-by: Samed Ozdemir <samed@xsor.io> Co-authored-by: in-voker <58696565+in-voker@users.noreply.github.com> Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com> Co-authored-by: cgillinger <christian.gillinger@gmail.com> Co-authored-by: Sonny B <43247590+sonnyb9@users.noreply.github.com> Co-authored-by: sonnyb9 <sonnyb9@users.noreply.github.com>
1 parent d05ea75 commit fb41d24

61 files changed

Lines changed: 4556 additions & 3137 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [develop, master]
6+
pull_request:
7+
branches: [develop]
8+
schedule:
9+
- cron: "0 4 * * 1"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [actions, javascript-typescript]
24+
25+
steps:
26+
- uses: actions/checkout@v6
27+
28+
- uses: github/codeql-action/init@v4
29+
with:
30+
languages: ${{ matrix.language }}
31+
queries: security-and-quality
32+
33+
- uses: github/codeql-action/autobuild@v4
34+
35+
- uses: github/codeql-action/analyze@v4
36+
with:
37+
category: "/language:${{ matrix.language }}"

.github/workflows/electron-rebuild.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: "Electron Rebuild Testing"
22

3+
permissions:
4+
contents: read
5+
36
on: [pull_request]
47

58
jobs:

.github/workflows/enforce-pullrequest-rules.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
name: "Enforce Pull-Request Rules"
55

6+
permissions:
7+
contents: read
8+
69
on:
710
pull_request:
811
push:

cspell.config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
"armv",
1414
"ashishtank",
1515
"autoplay",
16+
"avghumidity",
17+
"avgtemp",
1618
"Autorestart",
1719
"beada",
1820
"Behaviour",
21+
"Beschreibung",
1922
"Binney",
2023
"bluemanos",
2124
"bnitkin",
@@ -111,6 +114,7 @@
111114
"flopp",
112115
"fontawesome",
113116
"fontface",
117+
"forecastday",
114118
"forecastweather",
115119
"fortawesome",
116120
"frameguard",
@@ -186,14 +190,18 @@
186190
"luxon",
187191
"lxsession",
188192
"magicmirror",
193+
"mapbox",
189194
"martingron",
190195
"marvai",
191196
"mastermerge",
192197
"matchtype",
193198
"maxentries",
199+
"maxtemp",
200+
"maxwind",
194201
"Meteo",
195202
"michaelteeuw",
196203
"michmich",
204+
"mintemp",
197205
"Midori",
198206
"mirontoli",
199207
"MISSINGLANG",
@@ -212,7 +220,9 @@
212220
"NEWSFEED",
213221
"newsfeedfetcher",
214222
"newsfetcher",
223+
"newyear",
215224
"newsitems",
225+
"nextdaysrelative",
216226
"nfogal",
217227
"njwilliams",
218228
"nonrepeating",
@@ -239,8 +249,10 @@
239249
"pmin",
240250
"Português",
241251
"PRECIP",
252+
"precips",
242253
"Problema",
243254
"psieg",
255+
"ptype",
244256
"pubdate",
245257
"radokristof",
246258
"rajniszp",
@@ -255,12 +267,14 @@
255267
"Rosso",
256268
"Rothfusz",
257269
"rrule",
270+
"sameorigin",
258271
"savvadam",
259272
"sdetweil",
260273
"searchstr",
261274
"sendheaders",
262275
"serveronly",
263276
"sexualized",
277+
"showend",
264278
"Sitecode",
265279
"skpanagiotis",
266280
"SMHI",
@@ -295,8 +309,11 @@
295309
"timeformat",
296310
"titlereplacestr",
297311
"titlesearchstr",
312+
"TOCTOU",
298313
"todaytemp",
299314
"tomzt",
315+
"totalprecip",
316+
"totalsnow",
300317
"trunc",
301318
"ttlms",
302319
"ukmetoffice",
@@ -317,6 +334,7 @@
317334
"Vorberechnung",
318335
"vppencilsharpener",
319336
"Wallys",
337+
"weatherapi",
320338
"Weatherbit",
321339
"weathercode",
322340
"WEATHERDATA",
@@ -336,6 +354,7 @@
336354
"Woolridge",
337355
"worktree",
338356
"Wsymb",
357+
"xhvw",
339358
"xlarge",
340359
"xmark",
341360
"xrandr",

defaultmodules/calendar/calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Module.register("calendar", {
167167
this.selfUpdate();
168168
},
169169

170-
notificationReceived (notification, payload, sender) {
170+
notificationReceived (notification, payload) {
171171
if (notification === "FETCH_CALENDAR") {
172172
this.sendSocketNotification(notification, { url: payload.url, id: this.identifier });
173173
}

defaultmodules/calendar/calendarfetcher.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const ical = require("node-ical");
22
const Log = require("logger");
3-
const { Agent } = require("undici");
43
const CalendarFetcherUtils = require("./calendarfetcherutils");
54
const HTTPFetcher = require("#http_fetcher");
65

defaultmodules/calendar/calendarfetcherutils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const CalendarFetcherUtils = {
6262
// Subtract 1 second so that events that start on the middle of the night will not repeat.
6363
.subtract(1, "seconds");
6464

65-
Object.entries(data).forEach(([key, event]) => {
65+
Object.values(data).forEach((event) => {
6666
if (event.type !== "VEVENT") {
6767
return;
6868
}

defaultmodules/compliments/compliments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Module.register("compliments", {
308308
},
309309

310310
// Override notification handler.
311-
notificationReceived (notification, payload, sender) {
311+
notificationReceived (notification, payload) {
312312
if (notification === "CURRENTWEATHER_TYPE") {
313313
this.currentWeatherType = payload.type;
314314
}

defaultmodules/newsfeed/newsfeed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Module.register("newsfeed", {
411411
}
412412
},
413413

414-
notificationReceived (notification, payload, sender) {
414+
notificationReceived (notification) {
415415
const before = this.activeItem;
416416
if (notification === "MODULE_DOM_CREATED" && this.config.hideLoading) {
417417
this.hide();

defaultmodules/newsfeed/newsfeedfetcher.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class NewsfeedFetcher {
4040
});
4141

4242
// Wire up HTTPFetcher events
43-
this.httpFetcher.on("response", (response) => this.#handleResponse(response));
43+
this.httpFetcher.on("response", (response) => void this.#handleResponse(response));
4444
this.httpFetcher.on("error", (errorInfo) => this.fetchFailedCallback(this, errorInfo));
4545
}
4646

@@ -67,7 +67,7 @@ class NewsfeedFetcher {
6767
* Handles successful HTTP response
6868
* @param {Response} response - The fetch Response object
6969
*/
70-
#handleResponse (response) {
70+
async #handleResponse (response) {
7171
this.items = [];
7272
const parser = new FeedMe();
7373

@@ -106,11 +106,6 @@ class NewsfeedFetcher {
106106

107107
parser.on("end", () => this.broadcastItems());
108108

109-
parser.on("error", (error) => {
110-
Log.error(`${this.url} - Feed parsing failed: ${error.message}`);
111-
this.fetchFailedCallback(this, this.#createParseError(`Feed parsing failed: ${error.message}`, error));
112-
});
113-
114109
parser.on("ttl", (minutes) => {
115110
const ttlms = Math.min(minutes * 60 * 1000, 86400000);
116111
if (ttlms > this.httpFetcher.reloadInterval) {
@@ -123,7 +118,7 @@ class NewsfeedFetcher {
123118
const nodeStream = response.body instanceof stream.Readable
124119
? response.body
125120
: stream.Readable.fromWeb(response.body);
126-
nodeStream.pipe(iconv.decodeStream(this.encoding)).pipe(parser);
121+
await stream.promises.pipeline(nodeStream, iconv.decodeStream(this.encoding), parser);
127122
} catch (error) {
128123
Log.error(`${this.url} - Stream processing failed: ${error.message}`);
129124
this.fetchFailedCallback(this, this.#createParseError(`Stream processing failed: ${error.message}`, error));

0 commit comments

Comments
 (0)