69 Commits

Author SHA1 Message Date
Karsten Hassel
a41aa48dd1
add .gitattributes and fix prettier/js warnings (#3094)
see title, as discussed in
https://github.com/MichMich/MagicMirror/pull/3093
2023-04-22 09:29:51 +02:00
Kristjan ESPERANTO
5f38c53260
Revise require imports (#3071)
- order (external first)
- remove superfluous file extensions
- new line after imports
- deconstruct (only one time (in `check_config.js`))
- fix path (only one time (in `global-setup.js`))
2023-03-22 23:53:10 +01:00
Veeck
1b2785cc56
Cleanup more callback things (#3051)
Looks quite stable on my computers, so maybe we give it a try?

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-26 18:36:47 +01:00
Magnus
4d47c0837f
Support HTTP headers with CORS-method (#2957)
Adds support for sending and receiving HTTP-headers when using the
CORS-method.

This change is required for the Yr weather-provider introduced in
https://github.com/MichMich/MagicMirror/pull/2948.

To make it easier to add unit tests I moved the server-functions into a
separate file.
2022-10-30 18:14:02 +01:00
buxxi
f25abfd2f8
Make the e2e tests wait for the app to start and close before running next test (#2952)
When trying to debug why the tests broke for
https://github.com/MichMich/MagicMirror/pull/2946 I found that the tests
does not wait for the app to start and close. So if the startup isn't
blocking that would fail.

So I added a callback for `close()` too and converted them to promises
for the `startApplication()` and `stopApplication()` and updated all the
e2e tests to await both. Will try to refactor all these callbacks to
promises in a later PR.
2022-10-29 22:34:17 +02:00
Veeck
64ed5a54cb
Add error handling to node_helper startup sequence (#2945)
Fixes https://github.com/MichMich/MagicMirror/issues/2944

Also splits the Server js into a constrcutor and an open call to remove
one callback parameter :-)

Co-authored-by: veeck <michael@veeck.de>
2022-10-19 21:40:43 +02:00
Veeck
a328ce537f
Cleanup test directory (#2937)
Moves files around and renames some so that the structure is cleaner and
more consistent
2022-10-07 12:16:37 -05:00
Karsten Hassel
0023c64d59 use internal fetch function of node instead external node-fetch library if node version >= v18 2022-05-27 19:46:28 +02:00
Karsten Hassel
3b55886c45 added a new config option httpHeaders used by helmet 2022-05-13 22:29:43 +02:00
Michael Teeuw
da90412cea
Merge pull request #2798 from khassel/cors 2022-01-28 11:22:43 +01:00
Kristjan SCHMIDT
a5668b1b99 Magic Mirror -> MagicMirror²
Consistent spelling
2022-01-26 23:09:26 +01:00
Karsten Hassel
c622db918b working version, use corsUrl in weather providers 2022-01-25 23:42:42 +01:00
Karsten Hassel
7cfc7b9d74 first cors approach 2022-01-25 00:43:57 +01:00
Karsten Hassel
480c10b239 fix helmet, use defaults from v4 2022-01-14 00:05:08 +01:00
Karsten Hassel
9604c3a187 helmet upgrade to v5 2022-01-11 21:51:09 +01:00
Karsten Hassel
0ef6f89d44 fix server.close() issue 2021-09-24 00:30:00 +02:00
Karsten Hassel
9969fede35 refactor e2e 2021-09-16 23:02:17 +02:00
Karsten Hassel
c15b31b374 close server 2021-09-15 21:23:43 +02:00
Felix Wiedenbach
b18d98f5ea exposed logger as node module 2021-02-18 19:14:53 +01:00
veeck
8c83dc9494 Cleanup jsdoc 2021-02-06 22:20:49 +01:00
Karsten Hassel
5116a2fc82 fix socket.io backward compatibility with socket v2 clients 2021-01-27 20:52:50 +01:00
Karsten Hassel
2deab31187 fix socket.io cors errors, see breaking change since socket.io v3 https://socket.io/docs/v3/handling-cors/ 2021-01-09 23:20:36 +01:00
Felix Wiedenbach
ac141a4316 clean up server 2021-01-05 18:37:16 +01:00
rejas
7a4eddc592 Adjust some log levels 2020-12-29 18:50:27 +01:00
Jake Mulley
a6386bd60e
Update npm packages and resolve package changes 2020-11-08 21:18:19 +00:00
rejas
f2d03a511e User logger in node files 2020-06-02 15:03:59 +02:00
Veeck
abb5dc5739 Run prettier over ALL files once
No other changes done in this commit
2020-05-11 22:22:32 +02:00
rejas
b9d19cfcb4 First round of undef fixes 2020-05-03 12:40:48 +02:00
rejas
e7fc4ef1e7 Replace unsecure links with https ones 2020-04-28 23:05:28 +02:00
rejas
941d5d7cd9 Fix mixed tabs and whitespace errors 2020-04-21 12:23:50 +02:00
rejas
5517a913d4 Run linter manually 2020-03-08 16:20:54 +01:00
karenorman
c8c327b6ab Add HTTPS support 2020-02-01 20:46:26 +08:00
Sam Detweiler
ed61ac624d http default if no address is 0.0.0.0, not localhost, hard code localhost as per readme 2019-12-10 12:15:30 -06:00
rejas
835668d96d Add eslint semi rule 2019-06-05 10:23:58 +02:00
rejas
ea1715384e Revert "Revert "Fix some == with ===""
This reverts commit d9a4ee4f658171e4a7854ef856adba5f904fbfbe.
2019-06-05 08:48:22 +02:00
rejas
d9a4ee4f65 Revert "Fix some == with ==="
This reverts commit 5d39d8521575c30b203380d977a71e7590a524ba.
2019-06-04 11:04:47 +02:00
rejas
5d39d85215 Fix some == with === 2019-06-04 09:51:51 +02:00
Rodrigo Ramírez Norambuena
765b03c868 Add warning color when are using full ip whitelist 2017-07-25 11:26:01 -04:00
Unknown
a7297d2685 Fix for issue #950
Changed 'server.js' to allow an empty ipwhitelist to allow any and all hosts instead of none as mentioned in the documentation
2017-07-18 14:07:18 +02:00
Unknown
1590693547 New server route to fetch config
Added a new route to the Express server to supply client with config. Removed the original 'cookie' hack
2017-07-02 12:10:16 +02:00
Unknown
66f93ee541 Added clientonly script
Added clientonly script to have server and client run at different locations
2017-07-02 12:10:16 +02:00
Veeck
96c338859b More lazy sunday cleanups of missing semicolons, unused vars and other small thins 2017-06-11 11:53:55 +02:00
Rodrigo Ramírez Norambuena
c1830aa37c Fix message port starting server 2017-04-18 22:21:55 -03:00
Rodrigo Ramírez Norambuena
19b9d3737e Merge branch 'develop' into test-set-MM_PORT 2017-03-30 16:12:08 -03:00
Johan Hammar
cc9a429689 Corrected minor typo 2017-03-28 22:44:47 +02:00
Rodrigo Ramírez Norambuena
1ea50ea917 Merge branch 'develop' into test-set-MM_PORT 2017-03-28 13:16:56 -03:00
Rodrigo Ramírez Norambuena
c282bb2fe1 Fix if MM_PORT enviroment variable is set 2017-03-10 18:20:11 -03:00
Rodrigo Ramírez Norambuena
1bdc46969c Add information message when the ipWhitelist is configurate with [] 2017-03-10 16:36:17 -03:00
Rodrigo Ramírez Norambuena
ab226d16c8 refactor code for include multiples routes on js/server.js 2017-02-21 10:33:54 -03:00
Sergey Morozov
86fdd91597 Restructured Test Suite
- separated tests into e2e and unit directories
- created configs directory structure to support test framework
- added/modified `npm run test`, `npm run test:unit` and `npm run test:e2e` to target all, unit and e2e tests respectively
- modified some of the test names to be more descriptive

New structure of the Test Suite has following directory tree:

```
tests
├── configs
│   ├── env.js
│   └── modules
│       ├── clock
│       │   ├── clock_12hr.js
│       │   ├── clock_24hr.js
│       │   └── clock_showPeriodUpper.js
│       └── helloworld
│           └── helloworld.js
├── e2e
│   ├── env_spec.js
│   └── modules
│       ├── clock_spec.js
│       └── helloworld_spec.js
└── unit
    ├── functions
    │   └── cmp_versions_spec.js
    └── global_vars
        └── root_path_spec.js
```
2017-01-31 11:08:53 -08:00