mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 20:22:53 +00:00
Merge branch 'develop' into develop
This commit is contained in:
commit
f311ba3f7c
@ -18,6 +18,7 @@ _This release is scheduled to be released on 2021-01-01._
|
|||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
- Weather module - forecast now show TODAY and TOMORROW instead of weekday, to make it easier to understand.
|
- Weather module - forecast now show TODAY and TOMORROW instead of weekday, to make it easier to understand.
|
||||||
|
- Update dependencies to latest versions.
|
||||||
|
|
||||||
### Deleted
|
### Deleted
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ var Server = function (config, callback) {
|
|||||||
res.status(403).send("This device is not allowed to access your mirror. <br> Please check your config.js or config.js.sample to change this.");
|
res.status(403).send("This device is not allowed to access your mirror. <br> Please check your config.js or config.js.sample to change this.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
app.use(helmet());
|
app.use(helmet({ contentSecurityPolicy: false }));
|
||||||
|
|
||||||
app.use("/js", express.static(__dirname));
|
app.use("/js", express.static(__dirname));
|
||||||
var directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests/configs"];
|
var directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests/configs"];
|
||||||
|
5654
package-lock.json
generated
5654
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@ -44,46 +44,47 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"chai-as-promised": "^7.1.1",
|
"chai-as-promised": "^7.1.1",
|
||||||
"danger": "^3.1.3",
|
"danger": "^10.5.1",
|
||||||
"eslint-config-prettier": "^6.11.0",
|
"eslint-config-prettier": "^6.15.0",
|
||||||
"eslint-plugin-jsdoc": "^30.5.1",
|
"eslint-plugin-jsdoc": "^30.7.7",
|
||||||
"eslint-plugin-prettier": "^3.1.4",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"http-auth": "^3.2.3",
|
"express-basic-auth": "^1.2.0",
|
||||||
"husky": "^4.3.0",
|
"husky": "^4.3.0",
|
||||||
"jsdom": "^11.6.2",
|
"jsdom": "^16.4.0",
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"mocha": "^7.1.2",
|
"mocha": "^8.2.1",
|
||||||
"mocha-each": "^2.0.1",
|
"mocha-each": "^2.0.1",
|
||||||
"mocha-logger": "^1.0.6",
|
"mocha-logger": "^1.0.7",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.1.2",
|
||||||
"pretty-quick": "^3.0.2",
|
"pretty-quick": "^3.1.0",
|
||||||
"spectron": "^8.0.0",
|
"spectron": "^10.0.1",
|
||||||
"stylelint": "^13.7.1",
|
"stylelint": "^13.7.2",
|
||||||
"stylelint-config-prettier": "^8.0.2",
|
"stylelint-config-prettier": "^8.0.2",
|
||||||
"stylelint-config-standard": "^20.0.0",
|
"stylelint-config-standard": "^20.0.0",
|
||||||
"stylelint-prettier": "^1.1.2"
|
"stylelint-prettier": "^1.1.2"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"electron": "^6.1.7"
|
"electron": "^8.5.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"console-stamp": "^0.2.9",
|
"console-stamp": "^0.2.9",
|
||||||
"eslint": "^7.9.0",
|
"electron": "^8.5.3",
|
||||||
|
"eslint": "^7.13.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-ipfilter": "^1.1.2",
|
"express-ipfilter": "^1.1.2",
|
||||||
"feedme": "^1.2.0",
|
"feedme": "^1.2.0",
|
||||||
"helmet": "^3.23.3",
|
"helmet": "^4.2.0",
|
||||||
"ical": "^0.8.0",
|
"ical": "^0.8.0",
|
||||||
"iconv-lite": "^0.6.2",
|
"iconv-lite": "^0.6.2",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"moment": "^2.28.0",
|
"moment": "^2.29.1",
|
||||||
"node-ical": "^0.12.3",
|
"node-ical": "^0.12.3",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"rrule": "^2.6.6",
|
"rrule": "^2.6.6",
|
||||||
"rrule-alt": "^2.2.8",
|
"rrule-alt": "^2.2.8",
|
||||||
"simple-git": "^1.85.0",
|
"simple-git": "^2.21.0",
|
||||||
"socket.io": "^2.3.0",
|
"socket.io": "^2.3.0",
|
||||||
"valid-url": "^1.0.9"
|
"valid-url": "^1.0.9"
|
||||||
},
|
},
|
||||||
|
@ -46,7 +46,7 @@ describe("Translations", function () {
|
|||||||
it(`should parse ${language}`, function (done) {
|
it(`should parse ${language}`, function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var translations = ${JSON.stringify(translations)}; var Log = {log: function(){}};</script>\
|
`<script>var translations = ${JSON.stringify(translations)}; var Log = {log: function(){}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "js", "translator.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "js", "translator.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
@ -68,7 +68,7 @@ describe("Translations", function () {
|
|||||||
before(function (done) {
|
before(function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var translations = ${JSON.stringify(translations)}; var Log = {log: function(){}};</script>\
|
`<script>var translations = ${JSON.stringify(translations)}; var Log = {log: function(){}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "js", "translator.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "js", "translator.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
@ -92,7 +92,7 @@ describe("Translations", function () {
|
|||||||
before(function (done) {
|
before(function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var translations = ${JSON.stringify(translations)}; var Log = {log: function(){}};</script>\
|
`<script>var translations = ${JSON.stringify(translations)}; var Log = {log: function(){}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "js", "translator.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "js", "translator.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const auth = require("http-auth");
|
const auth = require("express-basic-auth");
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
var server;
|
var server;
|
||||||
|
|
||||||
var basic = auth.basic(
|
var basicAuth = auth({
|
||||||
{
|
realm: "MagicMirror Area restricted.",
|
||||||
realm: "MagicMirror Area restricted."
|
users: { MagicMirror: "CallMeADog" }
|
||||||
},
|
});
|
||||||
(username, password, callback) => {
|
|
||||||
callback(username === "MagicMirror" && password === "CallMeADog");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
app.use(auth.connect(basic));
|
app.use(basicAuth);
|
||||||
|
|
||||||
// Set available directories
|
// Set available directories
|
||||||
var directories = ["/tests/configs"];
|
var directories = ["/tests/configs"];
|
||||||
|
@ -10,7 +10,7 @@ describe("File js/class", function () {
|
|||||||
before(function (done) {
|
before(function (done) {
|
||||||
dom = new JSDOM(
|
dom = new JSDOM(
|
||||||
`<script>var Log = {log: function() {}};</script>\
|
`<script>var Log = {log: function() {}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "..", "js", "class.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "..", "js", "class.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
|
@ -65,7 +65,7 @@ describe("Translator", function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
it("should return custom module translation", function (done) {
|
it("should return custom module translation", function (done) {
|
||||||
const dom = new JSDOM(`<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
setTranslations(Translator);
|
setTranslations(Translator);
|
||||||
@ -78,7 +78,7 @@ describe("Translator", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return core translation", function (done) {
|
it("should return core translation", function (done) {
|
||||||
const dom = new JSDOM(`<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
setTranslations(Translator);
|
setTranslations(Translator);
|
||||||
@ -91,7 +91,7 @@ describe("Translator", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return custom module translation fallback", function (done) {
|
it("should return custom module translation fallback", function (done) {
|
||||||
const dom = new JSDOM(`<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
setTranslations(Translator);
|
setTranslations(Translator);
|
||||||
@ -102,7 +102,7 @@ describe("Translator", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return core translation fallback", function (done) {
|
it("should return core translation fallback", function (done) {
|
||||||
const dom = new JSDOM(`<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
setTranslations(Translator);
|
setTranslations(Translator);
|
||||||
@ -113,7 +113,7 @@ describe("Translator", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return translation with placeholder for missing variables", function (done) {
|
it("should return translation with placeholder for missing variables", function (done) {
|
||||||
const dom = new JSDOM(`<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
setTranslations(Translator);
|
setTranslations(Translator);
|
||||||
@ -124,7 +124,7 @@ describe("Translator", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return key if no translation was found", function (done) {
|
it("should return key if no translation was found", function (done) {
|
||||||
const dom = new JSDOM(`<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
setTranslations(Translator);
|
setTranslations(Translator);
|
||||||
@ -144,7 +144,7 @@ describe("Translator", function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
it("should load translations", function (done) {
|
it("should load translations", function (done) {
|
||||||
const dom = new JSDOM(`<script>var Log = {log: function(){}};</script><script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script>var Log = {log: function(){}};</script><script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
const file = "TranslationTest.json";
|
const file = "TranslationTest.json";
|
||||||
@ -158,7 +158,7 @@ describe("Translator", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should load translation fallbacks", function (done) {
|
it("should load translation fallbacks", function (done) {
|
||||||
const dom = new JSDOM(`<script>var Log = {log: function(){}};</script><script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script>var Log = {log: function(){}};</script><script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator } = dom.window;
|
const { Translator } = dom.window;
|
||||||
const file = "TranslationTest.json";
|
const file = "TranslationTest.json";
|
||||||
@ -172,7 +172,7 @@ describe("Translator", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not load translations, if module fallback exists", function (done) {
|
it("should not load translations, if module fallback exists", function (done) {
|
||||||
const dom = new JSDOM(`<script>var Log = {log: function(){}};</script><script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
const dom = new JSDOM(`<script>var Log = {log: function(){}};</script><script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`, { runScripts: "dangerously", resources: "usable" });
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
const { Translator, XMLHttpRequest } = dom.window;
|
const { Translator, XMLHttpRequest } = dom.window;
|
||||||
const file = "TranslationTest.json";
|
const file = "TranslationTest.json";
|
||||||
@ -200,7 +200,7 @@ describe("Translator", function () {
|
|||||||
it("should load core translations and fallback", function (done) {
|
it("should load core translations and fallback", function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var translations = {en: "http://localhost:3000/translations/en.json"}; var Log = {log: function(){}};</script>\
|
`<script>var translations = {en: "http://localhost:3000/translations/en.json"}; var Log = {log: function(){}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
@ -219,7 +219,7 @@ describe("Translator", function () {
|
|||||||
it("should load core fallback if language cannot be found", function (done) {
|
it("should load core fallback if language cannot be found", function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var translations = {en: "http://localhost:3000/translations/en.json"}; var Log = {log: function(){}};</script>\
|
`<script>var translations = {en: "http://localhost:3000/translations/en.json"}; var Log = {log: function(){}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
@ -240,7 +240,7 @@ describe("Translator", function () {
|
|||||||
it("should load core translations fallback", function (done) {
|
it("should load core translations fallback", function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var translations = {en: "http://localhost:3000/translations/en.json"}; var Log = {log: function(){}};</script>\
|
`<script>var translations = {en: "http://localhost:3000/translations/en.json"}; var Log = {log: function(){}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
@ -258,7 +258,7 @@ describe("Translator", function () {
|
|||||||
it("should load core fallback if language cannot be found", function (done) {
|
it("should load core fallback if language cannot be found", function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var translations = {}; var Log = {log: function(){}};</script>\
|
`<script>var translations = {}; var Log = {log: function(){}};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "..", "js", "translator.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
|
@ -8,7 +8,7 @@ describe("Test function cmpVersions in js/module.js", function () {
|
|||||||
before(function (done) {
|
before(function (done) {
|
||||||
const dom = new JSDOM(
|
const dom = new JSDOM(
|
||||||
`<script>var Class = {extend: function() { return {}; }};</script>\
|
`<script>var Class = {extend: function() { return {}; }};</script>\
|
||||||
<script src="${path.join(__dirname, "..", "..", "..", "js", "module.js")}">`,
|
<script src="file://${path.join(__dirname, "..", "..", "..", "js", "module.js")}">`,
|
||||||
{ runScripts: "dangerously", resources: "usable" }
|
{ runScripts: "dangerously", resources: "usable" }
|
||||||
);
|
);
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user