From c2d7a46ebd53fbd59b241a659931fa56aa897494 Mon Sep 17 00:00:00 2001 From: Type-Style Date: Mon, 2 Sep 2024 10:41:58 +0200 Subject: [PATCH] Release 1_5 (#130) * [Task] #6 provide fallback index.html * [Task] #6 production ready code (m) move httpdocs folder to dist have compile without sourcemaps for faster speed * [Task] #6 create github action for upload when main is updated (#21) * [change] #6 new ftp upload action * [Fix] #6 replace host with server in ftp action * [Task] #6 basic log (#26) * [CHANGE] #6 revert back to require output for production * [Task] #6 add ability to manually upload to prod * [Task] #9 enable manual start of codechecks * 10 webhook for writing (#36) * [Change] #3 clean up npm scripts, to have clean folder before build * [Task] #10 created data types in typescript * [Temp] #10 created subroute for writing, and folder structure * [Change] #3 include to use relative paths from src folder in ts and node https://stackoverflow.com/questions/43281741/how-can-i-use-paths-in-tsconfig-json See comment from Remo H. Hansen with at least 100 upvoted * [Change] Update VSCode to keep files open * [Task] #18 setup dotenv for secret variables * [Temp, Task] #10 Validate inputs using express-validator and custom functions * [Task] #18 prevent parameter pollution * [Task] #10 validating incoming parameter and logging errors * [Task] #7 add basic cache to express * [Changes] #7 Error Handling, to include basic custom Error Handling * [Task] #10 enhanced validation to only allow known parameters * [Change] #35 added Jest, tests for helper functions when writing * [Task] #10 better error Handling * [Task] #35 add tests for writing webhook validation * [TASK] #18 protect Webhook using KEY * [Fix] #35 test know import path structure now * [Task] #35 add test for protected webhook * [Task] #35 refactor build to run jest tests * [Task] #10 switched to crypto instead of bcrypt for dependency issue see synk inflight * [Fix] #36 PRQ Feedback * [Task] #3 improve error handling, logger and added chalk to colorize console output. Had to use chalk version 4 because of typescript converting to require, and chalk5 do want import syntax. * [Change] #3 nodemon to clear console when in dev mode * [!Task] #32 webhook creates folder and file based on date * [Change] #35 relocated tests and refactor write, also added file check * [Task] #18, installed helmet, configured self as CSP origin * [Fix] moved chalk out of dev dependency * [Task] #32 error logging and text output improvement, log string instead of "object" * [Task] #18 CSP Update to allow localhost for testing * [Fix] #3 debugging setup improvments * [FIX] #10 Error Handling * [Task] #10 writing basic non calculated data to file * [Fix] #10 avoid Header Modification after sending the request * [Task] #10 JSON Data pretty output * [Task] #32 update types to reflect subobjects of entry * [Task] #10 write time * [Task] #32 added logging for time edgecases * [Task] #10 output seconds * [Task] #10 calculate distance based on lat and lon * [Task] #32 writing tests for time and distance * [Task] #32 change distance calculation to use pythagoras * [Task] #38 add favicon * [Task] #32 time converted to seconds * [Taskk] #32 speed calculation and output and tests * [Task] #32 speed tests * [Task] #33 add ignore * [Task] #32 test finetuning * [Task] #32 add angle between entries * [Task] #32 test for angle, extracted getData function * [change] #32 test to include optional leading 0 for days * [!!!Task] #18 add uncaughtExeption handler as last resort * [Task] #7 enhance static options to include common filetypes; index file start is used as index file to avoid collisions with host provider * [change] #32 validation to be used more explictly * [change] #32 add index to log while writing * [Task] #32 test if 1000 calls can be made with randomized data * [!!! Task] #32 limit JSON Data to be 1000 lines: replace last line with most recent entry * [Change, Task] #32 if 1000 entries exceeded, only replace last if hdop is good * [Change] build action enable button to on manually * [temp] test y tests fail * Create node.js.yml * Create main.yml * [!!!Fix] Created new workflow to build / test node, commented tests back in. Increased time between server calls in test, to check difference time more accurately * [Task] #33 moved ignore to its own file since it creates data rather than validating it * 42 output json (#44) * [Task] #42, created route to output json * [Task] #42 added tests for read json * 41 add rate limiter (#45) * [Task] #18, limit request size for security reasons * [Task] #43, introduce gzip to transfer data * [Task] #34 improve error handling, log server shutdowns * [Task] #34 installed and integrated tooBusy to send 503 when load is high * [Task] #34 improved tooBusy, improved formatting * [Task, Temp] #41 installed ratelimiter and slowDown * [Task] #42 cleanup ipv6 addresses * [Change] #10 error handling for better gitBash and txt output, also reduced stack in case of validation errors * [Task] #41 prepare Log for RateLImit errors * [Temp] #41 write route rateLImited temp: see Todos * [Task] #34 colorize prefix in console * [Task] #42 extract middlewares and move to folder * [Task] #41 ratelimiter cleaning up periodicly * [Task] #41 skip tests in rateLimiting * Bump follow-redirects from 1.15.5 to 1.15.6 (#47) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 43 secure output route (#46) * [Task] #43 create color pallette via atmos * [Task] #43 create color pallette via atmos * [Task] #43 cleanup colors and svg * [Task] #41 remove test code * [CHANGE] #3 reconfigured nodemon to copy static files * [Task] #18 replaced getRawBody with builtIn express urlEncoded * [Temp, Task] #43 basic login page, not yet used as middleware * [Temp] #43, create and validate json web token * [Task] #43, add slowDown and RateLimit for failed login attempts * [Task] #43, ratelimit for login page * [Task] #43, add global ratelimiter * [fix] #7, improve error handeling for express errors * [Task] #43 rework body limitations to be checked only appropiate methods * [Task] #43 added check for data before using it * [Task] #43 check that body is ignored for GET in request * [Task] #43 login test * [Task] #43 create tests for login * [Task] #43 fine tune error handling * [Task] #43, finished login and jwt related tests * [Change] #34, no further need for test logging * [Task] #43, fine tune jwt, middleware process improved * [CHANGE] #43 created new esLint to have clientside js without ts * [Temp] #43 test to see new linter configuration * [Change] #43 switched to bcrypt for passwords * [Task] #43 read return json in all cases * [Task] #43 introduced color classes * [Task] #43, prq feedback * [Temp} #43 figuring out why tests dont run on github * [Task] #43 code cleanup * 48 move login to seperate controller (#49) * [Task] #43, add label to form * [Task] #48 login controller * 50 integrate csrf protection for login form (#53) * [Task] #50, create CSRF Validation for login form * [Task] #43, added icon to repository for later use * [Task] #50, cleanup cetntralized; rename token functions * [Task] #50, reduced token length and improved error handling * [Task] #50 csrf tests added to login * [Task] #50, added test case for csrf, repaired integration * fix: upgrade express-rate-limit from 7.1.5 to 7.2.0 (#52) Snyk has created this PR to upgrade express-rate-limit from 7.1.5 to 7.2.0. See this package in npm: https://www.npmjs.com/package/express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: package.json & package-lock.json to reduce vulnerabilities (#54) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-EXPRESS-6474509 Co-authored-by: snyk-bot * [Snyk] Upgrade express from 4.18.2 to 4.18.3 (#51) * fix: upgrade express from 4.18.2 to 4.18.3 Snyk has created this PR to upgrade express from 4.18.2 to 4.18.3. See this package in npm: https://www.npmjs.com/package/express See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr * 50 integrate csrf protection for login form (#53) * [Task] #50, create CSRF Validation for login form * [Task] #43, added icon to repository for later use * [Task] #50, cleanup cetntralized; rename token functions * [Task] #50, reduced token length and improved error handling * [Task] #50 csrf tests added to login * [Task] #50, added test case for csrf, repaired integration * fix: upgrade express-rate-limit from 7.1.5 to 7.2.0 (#52) Snyk has created this PR to upgrade express-rate-limit from 7.1.5 to 7.2.0. See this package in npm: https://www.npmjs.com/package/express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot --------- Co-authored-by: snyk-bot * [Task] update dev after main merge * [Task] npm upgrade * 58 react setup (#59) * [Task] #58 install react via npm, incl. types and eslint plugins * [Task] #58, tsconfig for react folder * [Task] #58 esLint config * [Task] #58, webpack and react setup * [Task] #58, render welcome from express instead of static * [Task] #58 eslint scripts * [Task] #58, eslint react setup * [TASK] #58 integrate webpack in build and dev npm scripts * [Temp] Test csp * [FIX] Add views to be deployed to prod * [Task] disable csp for local development * [Task] #58 base css including colors, deleted color classes in favor of variables * [Task] #58 typescript setup for react * [Task] #58 webpack setup for react and typescript * [Task] #58 app setup react * [Temp] #58 conctact module css * [Task] #58 remove learning files * [Task] #61, create font * Revert "[Task] #58 remove learning files" This reverts commit b63bb97045a9443e11ca9d8658f1e7faecf96e3b. * [Task] #61, adjust for darkmode * [Task] #61 apply base style to login * [Task] #58, dev tesing rule to disable * [Task] #58, adjust styles for headline * [Task] #58, create Contacts wrapper Component * [Task] #58 apply wrapper component * [Task] #58 adjust contact component to expect object * [Task] #58, toggle state * [Task] #58 learn context api provider and consumer * [Task] #58 add delete via dispatch * [Task] #58, react-router, move contacts to new url * [Task] #58 fetch more contacts * fix: package.json & package-lock.json to reduce vulnerabilities (#62) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-EJS-6689533 Co-authored-by: snyk-bot * Bump tar and npm (#60) Bumps [tar](https://github.com/isaacs/node-tar) to 6.2.1 and updates ancestor dependency [npm](https://github.com/npm/cli). These dependencies need to be updated together. Updates `tar` from 6.2.0 to 6.2.1 - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v6.2.0...v6.2.1) Updates `npm` from 10.5.0 to 10.5.2 - [Release notes](https://github.com/npm/cli/releases) - [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md) - [Commits](https://github.com/npm/cli/compare/v10.5.0...v10.5.2) --- updated-dependencies: - dependency-name: tar dependency-type: indirect - dependency-name: npm dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump ejs from 3.1.9 to 3.1.10 (#63) Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10. - [Release notes](https://github.com/mde/ejs/releases) - [Commits](https://github.com/mde/ejs/compare/v3.1.9...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [Task] #58, webpack configuriation to allow regular css files as well as modules * [Task] #58, clean up react learn files * [Task] #58, setup react router * [Task] #61 install Material UI * [Task] #61, test mui * [CHANGE, MultiLine] #61 color variables levels removed, MUI Overwrites introduced color variables levels are replaced by color-mix. MUI Experimental API with Variables is used and to overwrite theme colors in css (since I want CSS to be single source of truth for colors) * [Temp] #61 introduce darkmode to MUI * [Task] #61, create new start module so that App can act as root * [Task] #61, naming update * [Task] #61, move router to root App * [Task] #61, add font to preload * [Task] #61, dim colors in dark mode * [Task] #61, introduce modeswitcher * [Change] #64, refactoring splitting pages and components * [Task] #61, mobile Theme Swticher placed on top right * [Task] #61, mobile theme switcher icon only on mobile * [Task] #61, button color and background improvement * [Task] #63, login page first draft * [Temp] #61, login controller commented out unused route, TO BE REFACTORED * [Task] #63, login validation * [Task] #63, add error icon * [Task] #61, cut design update * [Task] #53, apply cut, rename FormData to FormInfo to avoid confusion with reserved name * [Task] #63, send login request * [Task] #61, loading icon * [Task] #63, get csrfToken, fullfill login request * [Fix] #63, fail gracefully when too many tokens * [Task] #63, error Handling in login form * [Task] #81, remove password log * [Task] #80, cleanup todo token * fix: upgrade multiple dependencies with Snyk (#68) Snyk has created this PR to upgrade: - react from 18.2.0 to 18.3.1. See this package in npm: https://www.npmjs.com/package/react - react-dom from 18.2.0 to 18.3.1. See this package in npm: https://www.npmjs.com/package/react-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [Fix] #64, disable express header * [Task] #64, protect csrf token page with custom http header * [FIx] #64, fix csrf test * [Task] #64, repair test cases * fix: upgrade express-slow-down from 2.0.1 to 2.0.2 (#69) Snyk has created this PR to upgrade express-slow-down from 2.0.1 to 2.0.2. See this package in npm: express-slow-down See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [fix] #64, linter fixes * [Task] Editor Config * [Task] #61, convert background line to svg and animate * [Task] #61, main headline style * [Task] #61, fine tune background pattern * [Task] #61, font-weight reduced in darkmode * [Task] #64, login design improvements * [Task] #61, update design with minor ripples and edges * [Task] #70, store token after login * Bump braces from 3.0.2 to 3.0.3 (#76) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: upgrade @mui/icons-material from 5.15.16 to 5.15.18 (#75) Snyk has created this PR to upgrade @mui/icons-material from 5.15.16 to 5.15.18. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.23.0 to 6.23.1 (#74) Snyk has created this PR to upgrade react-router-dom from 6.23.0 to 6.23.1. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-slow-down from 2.0.2 to 2.0.3 (#73) Snyk has created this PR to upgrade express-slow-down from 2.0.2 to 2.0.3. See this package in npm: express-slow-down See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-rate-limit from 7.2.0 to 7.3.0 (#82) Snyk has created this PR to upgrade express-rate-limit from 7.2.0 to 7.3.0. See this package in npm: express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-validator from 7.0.1 to 7.1.0 (#81) Snyk has created this PR to upgrade express-validator from 7.0.1 to 7.1.0. See this package in npm: express-validator See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade axios from 1.7.1 to 1.7.2 (#80) Snyk has created this PR to upgrade axios from 1.7.1 to 1.7.2. See this package in npm: axios See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.15.18 to 5.15.19 (#79) Snyk has created this PR to upgrade @mui/icons-material from 5.15.18 to 5.15.19. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.15.19 to 5.15.20 (#88) Snyk has created this PR to upgrade @mui/icons-material from 5.15.19 to 5.15.20. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.23.1 to 6.24.0 (#91) Snyk has created this PR to upgrade react-router-dom from 6.23.1 to 6.24.0. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 77 design base layout (#85) * [Task] #77 1st draft layout * [Change] #70 update token expire date * [Temp] #77, log out data on valid request, temp: error handling and display * [Temp] * [Task] #77, login Button functionality, default state * [Task] #77, removed outdated comments * [Task] #77, introduced linearBuffer Bar for login * [Task] #77, added modeSwticher to start page * [Task] #77, display last entry on map demo * [Task] #77, enhance login, show pastUser if availabe, show user on mainpage * [!!!Task] #77 first draft of functionality * [Task] #77 move map to new location * [Task] #77 create testData * [Fix] #77 codeFactor complains * [Task] #77, draft of status content * [FIX] #77 change data accumulation * [Task] #77 improve test example data * fix: upgrade @mui/material from 5.15.16 to 5.15.20 (#92) Snyk has created this PR to upgrade @mui/material from 5.15.16 to 5.15.20. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [Fix] #94, refactor-ignore logic (multiline) (#95) Serverside: When writing entry, the most recent previous entry is checked wether to be ignored. Also if more than 2 items already exist meaning writing is preparing at least the 3rd entry, we recalculate distances and timing if previousItems are ignored. Frontend: In order to benefit and get the recent information that a previous item is being ignored, frontEnd askes for the current item again and merges it and following items. Remember the most recent item can never be ignored due to policy. Maybe there is no further writing, so I want to have the latest datapoint. * [Task] #94, add logging if logical error with ignore * [Task] #94, cleanup console.logs * [Fix] #93, offline message improvement (#96) * fix: package.json & package-lock.json to reduce vulnerabilities (#101) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-7361793 Co-authored-by: snyk-bot * fix: upgrade @mui/material from 5.15.20 to 5.16.5 (#102) Snyk has created this PR to upgrade @mui/material from 5.15.20 to 5.16.5. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 93 fix error message when server not available (#103) * [Fix] #93, offline message improvement * [Task] #93, removed background in status module when no data is present * [Task] #61, add cut class to map for styling * [Fix] #93 fix tests, be more specific on url, and let test fail non silently when csrf is not found * [Fix] #94, repair overwriting the last data point * fix: upgrade @emotion/react from 11.11.4 to 11.13.0 (#104) Snyk has created this PR to upgrade @emotion/react from 11.11.4 to 11.13.0. See this package in npm: @emotion/react See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @emotion/styled from 11.11.5 to 11.13.0 (#105) Snyk has created this PR to upgrade @emotion/styled from 11.11.5 to 11.13.0. See this package in npm: @emotion/styled See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.25.0 to 6.25.1 (#106) Snyk has created this PR to upgrade react-router-dom from 6.25.0 to 6.25.1. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.16.4 to 5.16.5 (#107) Snyk has created this PR to upgrade @mui/icons-material from 5.16.4 to 5.16.5. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-rate-limit from 7.3.1 to 7.4.0 (#108) Snyk has created this PR to upgrade express-rate-limit from 7.3.1 to 7.4.0. See this package in npm: express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 109 marker and line design (#110) * [Task] #109, start polyline * [Task] #94, marker * [Task] #109, gradient color polyline color based on speed * [Task] #109 linter fixes * fix: upgrade react-router-dom from 6.25.1 to 6.26.0 (#113) Snyk has created this PR to upgrade react-router-dom from 6.25.1 to 6.26.0. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/material from 5.16.5 to 5.16.6 (#112) Snyk has created this PR to upgrade @mui/material from 5.16.5 to 5.16.6. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * Switch polyline (#114) * [Revert] #109 remove polyColor Plugin * [Fix, MultiLine] #109, refactor coloring lines; while fetchinng new data vs reloading MaxSpeed might change the more entries are fetched. Example Testcase and after 6 entries are there, reload and see colors change ... well not with this fix. * [Task] #109, improve polyline display, remove unused code * [Task] #77, change timing to round up, so it "feels" more accurate * [Task] #115, remove SVG Animation on startup based on media Query * [Task] #77 improve test example data * [Task] #77, calculate more Status data * [Task] #77, improve example test data * [Task] #109, line dashed when diff is high, marker start icon when diff is higher * [Task] #77, status design * [Task] #83, forced scheme for map * [Task] #83, change context, mode globally available * [Task] #83, react update, cluster install * [Task, multiline] #83, map tilelayer Introduced new map TileLayers using layers control, and styled it Introduced markerClusterGroup from @changey, since others had issues like broken marker images, or lack for typescript support Refined dashed array styles Addapted context changes, to fetch mode globally, for seperate map theme Markers have none style if neither end or start, to be targeted Introduced Layer array for tilelayers When Layers are changed theme for map is set/updated * [Task] #77 improve responsive design, hide images, status overlays map * [Task] #77, adjust coloring and opacity, used for status * [Task] #83, adjust imports * [Task] #77, changed responsive design for mobile * [Task] #83, extracted to own module, added fly option * [Task] #83, layers extracted, clickable minimap, corrected for mapbox tileSize * Bump webpack from 5.91.0 to 5.94.0 (#117) Bumps [webpack](https://github.com/webpack/webpack) from 5.91.0 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [Task] #83, code cleanup * [Fix] #83, mime type setting * [fix] #123, run pre and post build for production too * [Change] #123, to see real user ip instead of localhost proxy (#126) * Main (#128) * Release 1_3 (#124) * [Task] #6 provide fallback index.html * [Task] #6 production ready code (m) move httpdocs folder to dist have compile without sourcemaps for faster speed * [Task] #6 create github action for upload when main is updated (#21) * [change] #6 new ftp upload action * [Fix] #6 replace host with server in ftp action * [Task] #6 basic log (#26) * [CHANGE] #6 revert back to require output for production * [Task] #6 add ability to manually upload to prod * [Task] #9 enable manual start of codechecks * 10 webhook for writing (#36) * [Change] #3 clean up npm scripts, to have clean folder before build * [Task] #10 created data types in typescript * [Temp] #10 created subroute for writing, and folder structure * [Change] #3 include to use relative paths from src folder in ts and node https://stackoverflow.com/questions/43281741/how-can-i-use-paths-in-tsconfig-json See comment from Remo H. Hansen with at least 100 upvoted * [Change] Update VSCode to keep files open * [Task] #18 setup dotenv for secret variables * [Temp, Task] #10 Validate inputs using express-validator and custom functions * [Task] #18 prevent parameter pollution * [Task] #10 validating incoming parameter and logging errors * [Task] #7 add basic cache to express * [Changes] #7 Error Handling, to include basic custom Error Handling * [Task] #10 enhanced validation to only allow known parameters * [Change] #35 added Jest, tests for helper functions when writing * [Task] #10 better error Handling * [Task] #35 add tests for writing webhook validation * [TASK] #18 protect Webhook using KEY * [Fix] #35 test know import path structure now * [Task] #35 add test for protected webhook * [Task] #35 refactor build to run jest tests * [Task] #10 switched to crypto instead of bcrypt for dependency issue see synk inflight * [Fix] #36 PRQ Feedback * [Task] #3 improve error handling, logger and added chalk to colorize console output. Had to use chalk version 4 because of typescript converting to require, and chalk5 do want import syntax. * [Change] #3 nodemon to clear console when in dev mode * [!Task] #32 webhook creates folder and file based on date * [Change] #35 relocated tests and refactor write, also added file check * [Task] #18, installed helmet, configured self as CSP origin * [Fix] moved chalk out of dev dependency * [Task] #32 error logging and text output improvement, log string instead of "object" * [Task] #18 CSP Update to allow localhost for testing * [Fix] #3 debugging setup improvments * [FIX] #10 Error Handling * [Task] #10 writing basic non calculated data to file * [Fix] #10 avoid Header Modification after sending the request * [Task] #10 JSON Data pretty output * [Task] #32 update types to reflect subobjects of entry * [Task] #10 write time * [Task] #32 added logging for time edgecases * [Task] #10 output seconds * [Task] #10 calculate distance based on lat and lon * [Task] #32 writing tests for time and distance * [Task] #32 change distance calculation to use pythagoras * [Task] #38 add favicon * [Task] #32 time converted to seconds * [Taskk] #32 speed calculation and output and tests * [Task] #32 speed tests * [Task] #33 add ignore * [Task] #32 test finetuning * [Task] #32 add angle between entries * [Task] #32 test for angle, extracted getData function * [change] #32 test to include optional leading 0 for days * [!!!Task] #18 add uncaughtExeption handler as last resort * [Task] #7 enhance static options to include common filetypes; index file start is used as index file to avoid collisions with host provider * [change] #32 validation to be used more explictly * [change] #32 add index to log while writing * [Task] #32 test if 1000 calls can be made with randomized data * [!!! Task] #32 limit JSON Data to be 1000 lines: replace last line with most recent entry * [Change, Task] #32 if 1000 entries exceeded, only replace last if hdop is good * [Change] build action enable button to on manually * [temp] test y tests fail * Create node.js.yml * Create main.yml * [!!!Fix] Created new workflow to build / test node, commented tests back in. Increased time between server calls in test, to check difference time more accurately * [Task] #33 moved ignore to its own file since it creates data rather than validating it * 42 output json (#44) * [Task] #42, created route to output json * [Task] #42 added tests for read json * 41 add rate limiter (#45) * [Task] #18, limit request size for security reasons * [Task] #43, introduce gzip to transfer data * [Task] #34 improve error handling, log server shutdowns * [Task] #34 installed and integrated tooBusy to send 503 when load is high * [Task] #34 improved tooBusy, improved formatting * [Task, Temp] #41 installed ratelimiter and slowDown * [Task] #42 cleanup ipv6 addresses * [Change] #10 error handling for better gitBash and txt output, also reduced stack in case of validation errors * [Task] #41 prepare Log for RateLImit errors * [Temp] #41 write route rateLImited temp: see Todos * [Task] #34 colorize prefix in console * [Task] #42 extract middlewares and move to folder * [Task] #41 ratelimiter cleaning up periodicly * [Task] #41 skip tests in rateLimiting * Bump follow-redirects from 1.15.5 to 1.15.6 (#47) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 43 secure output route (#46) * [Task] #43 create color pallette via atmos * [Task] #43 create color pallette via atmos * [Task] #43 cleanup colors and svg * [Task] #41 remove test code * [CHANGE] #3 reconfigured nodemon to copy static files * [Task] #18 replaced getRawBody with builtIn express urlEncoded * [Temp, Task] #43 basic login page, not yet used as middleware * [Temp] #43, create and validate json web token * [Task] #43, add slowDown and RateLimit for failed login attempts * [Task] #43, ratelimit for login page * [Task] #43, add global ratelimiter * [fix] #7, improve error handeling for express errors * [Task] #43 rework body limitations to be checked only appropiate methods * [Task] #43 added check for data before using it * [Task] #43 check that body is ignored for GET in request * [Task] #43 login test * [Task] #43 create tests for login * [Task] #43 fine tune error handling * [Task] #43, finished login and jwt related tests * [Change] #34, no further need for test logging * [Task] #43, fine tune jwt, middleware process improved * [CHANGE] #43 created new esLint to have clientside js without ts * [Temp] #43 test to see new linter configuration * [Change] #43 switched to bcrypt for passwords * [Task] #43 read return json in all cases * [Task] #43 introduced color classes * [Task] #43, prq feedback * [Temp} #43 figuring out why tests dont run on github * [Task] #43 code cleanup * 48 move login to seperate controller (#49) * [Task] #43, add label to form * [Task] #48 login controller * 50 integrate csrf protection for login form (#53) * [Task] #50, create CSRF Validation for login form * [Task] #43, added icon to repository for later use * [Task] #50, cleanup cetntralized; rename token functions * [Task] #50, reduced token length and improved error handling * [Task] #50 csrf tests added to login * [Task] #50, added test case for csrf, repaired integration * fix: upgrade express-rate-limit from 7.1.5 to 7.2.0 (#52) Snyk has created this PR to upgrade express-rate-limit from 7.1.5 to 7.2.0. See this package in npm: https://www.npmjs.com/package/express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: package.json & package-lock.json to reduce vulnerabilities (#54) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-EXPRESS-6474509 Co-authored-by: snyk-bot * [Snyk] Upgrade express from 4.18.2 to 4.18.3 (#51) * fix: upgrade express from 4.18.2 to 4.18.3 Snyk has created this PR to upgrade express from 4.18.2 to 4.18.3. See this package in npm: https://www.npmjs.com/package/express See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr * 50 integrate csrf protection for login form (#53) * [Task] #50, create CSRF Validation for login form * [Task] #43, added icon to repository for later use * [Task] #50, cleanup cetntralized; rename token functions * [Task] #50, reduced token length and improved error handling * [Task] #50 csrf tests added to login * [Task] #50, added test case for csrf, repaired integration * fix: upgrade express-rate-limit from 7.1.5 to 7.2.0 (#52) Snyk has created this PR to upgrade express-rate-limit from 7.1.5 to 7.2.0. See this package in npm: https://www.npmjs.com/package/express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot --------- Co-authored-by: snyk-bot * [Task] update dev after main merge * [Task] npm upgrade * 58 react setup (#59) * [Task] #58 install react via npm, incl. types and eslint plugins * [Task] #58, tsconfig for react folder * [Task] #58 esLint config * [Task] #58, webpack and react setup * [Task] #58, render welcome from express instead of static * [Task] #58 eslint scripts * [Task] #58, eslint react setup * [TASK] #58 integrate webpack in build and dev npm scripts * [Temp] Test csp * [FIX] Add views to be deployed to prod * [Task] disable csp for local development * [Task] #58 base css including colors, deleted color classes in favor of variables * [Task] #58 typescript setup for react * [Task] #58 webpack setup for react and typescript * [Task] #58 app setup react * [Temp] #58 conctact module css * [Task] #58 remove learning files * [Task] #61, create font * Revert "[Task] #58 remove learning files" This reverts commit b63bb97045a9443e11ca9d8658f1e7faecf96e3b. * [Task] #61, adjust for darkmode * [Task] #61 apply base style to login * [Task] #58, dev tesing rule to disable * [Task] #58, adjust styles for headline * [Task] #58, create Contacts wrapper Component * [Task] #58 apply wrapper component * [Task] #58 adjust contact component to expect object * [Task] #58, toggle state * [Task] #58 learn context api provider and consumer * [Task] #58 add delete via dispatch * [Task] #58, react-router, move contacts to new url * [Task] #58 fetch more contacts * fix: package.json & package-lock.json to reduce vulnerabilities (#62) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-EJS-6689533 Co-authored-by: snyk-bot * Bump tar and npm (#60) Bumps [tar](https://github.com/isaacs/node-tar) to 6.2.1 and updates ancestor dependency [npm](https://github.com/npm/cli). These dependencies need to be updated together. Updates `tar` from 6.2.0 to 6.2.1 - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v6.2.0...v6.2.1) Updates `npm` from 10.5.0 to 10.5.2 - [Release notes](https://github.com/npm/cli/releases) - [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md) - [Commits](https://github.com/npm/cli/compare/v10.5.0...v10.5.2) --- updated-dependencies: - dependency-name: tar dependency-type: indirect - dependency-name: npm dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump ejs from 3.1.9 to 3.1.10 (#63) Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10. - [Release notes](https://github.com/mde/ejs/releases) - [Commits](https://github.com/mde/ejs/compare/v3.1.9...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [Task] #58, webpack configuriation to allow regular css files as well as modules * [Task] #58, clean up react learn files * [Task] #58, setup react router * [Task] #61 install Material UI * [Task] #61, test mui * [CHANGE, MultiLine] #61 color variables levels removed, MUI Overwrites introduced color variables levels are replaced by color-mix. MUI Experimental API with Variables is used and to overwrite theme colors in css (since I want CSS to be single source of truth for colors) * [Temp] #61 introduce darkmode to MUI * [Task] #61, create new start module so that App can act as root * [Task] #61, naming update * [Task] #61, move router to root App * [Task] #61, add font to preload * [Task] #61, dim colors in dark mode * [Task] #61, introduce modeswitcher * [Change] #64, refactoring splitting pages and components * [Task] #61, mobile Theme Swticher placed on top right * [Task] #61, mobile theme switcher icon only on mobile * [Task] #61, button color and background improvement * [Task] #63, login page first draft * [Temp] #61, login controller commented out unused route, TO BE REFACTORED * [Task] #63, login validation * [Task] #63, add error icon * [Task] #61, cut design update * [Task] #53, apply cut, rename FormData to FormInfo to avoid confusion with reserved name * [Task] #63, send login request * [Task] #61, loading icon * [Task] #63, get csrfToken, fullfill login request * [Fix] #63, fail gracefully when too many tokens * [Task] #63, error Handling in login form * [Task] #81, remove password log * [Task] #80, cleanup todo token * fix: upgrade multiple dependencies with Snyk (#68) Snyk has created this PR to upgrade: - react from 18.2.0 to 18.3.1. See this package in npm: https://www.npmjs.com/package/react - react-dom from 18.2.0 to 18.3.1. See this package in npm: https://www.npmjs.com/package/react-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [Fix] #64, disable express header * [Task] #64, protect csrf token page with custom http header * [FIx] #64, fix csrf test * [Task] #64, repair test cases * fix: upgrade express-slow-down from 2.0.1 to 2.0.2 (#69) Snyk has created this PR to upgrade express-slow-down from 2.0.1 to 2.0.2. See this package in npm: express-slow-down See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [fix] #64, linter fixes * [Task] Editor Config * [Task] #61, convert background line to svg and animate * [Task] #61, main headline style * [Task] #61, fine tune background pattern * [Task] #61, font-weight reduced in darkmode * [Task] #64, login design improvements * [Task] #61, update design with minor ripples and edges * [Task] #70, store token after login * Bump braces from 3.0.2 to 3.0.3 (#76) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: upgrade @mui/icons-material from 5.15.16 to 5.15.18 (#75) Snyk has created this PR to upgrade @mui/icons-material from 5.15.16 to 5.15.18. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.23.0 to 6.23.1 (#74) Snyk has created this PR to upgrade react-router-dom from 6.23.0 to 6.23.1. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-slow-down from 2.0.2 to 2.0.3 (#73) Snyk has created this PR to upgrade express-slow-down from 2.0.2 to 2.0.3. See this package in npm: express-slow-down See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-rate-limit from 7.2.0 to 7.3.0 (#82) Snyk has created this PR to upgrade express-rate-limit from 7.2.0 to 7.3.0. See this package in npm: express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-validator from 7.0.1 to 7.1.0 (#81) Snyk has created this PR to upgrade express-validator from 7.0.1 to 7.1.0. See this package in npm: express-validator See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade axios from 1.7.1 to 1.7.2 (#80) Snyk has created this PR to upgrade axios from 1.7.1 to 1.7.2. See this package in npm: axios See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.15.18 to 5.15.19 (#79) Snyk has created this PR to upgrade @mui/icons-material from 5.15.18 to 5.15.19. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.15.19 to 5.15.20 (#88) Snyk has created this PR to upgrade @mui/icons-material from 5.15.19 to 5.15.20. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.23.1 to 6.24.0 (#91) Snyk has created this PR to upgrade react-router-dom from 6.23.1 to 6.24.0. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 77 design base layout (#85) * [Task] #77 1st draft layout * [Change] #70 update token expire date * [Temp] #77, log out data on valid request, temp: error handling and display * [Temp] * [Task] #77, login Button functionality, default state * [Task] #77, removed outdated comments * [Task] #77, introduced linearBuffer Bar for login * [Task] #77, added modeSwticher to start page * [Task] #77, display last entry on map demo * [Task] #77, enhance login, show pastUser if availabe, show user on mainpage * [!!!Task] #77 first draft of functionality * [Task] #77 move map to new location * [Task] #77 create testData * [Fix] #77 codeFactor complains * [Task] #77, draft of status content * [FIX] #77 change data accumulation * [Task] #77 improve test example data * fix: upgrade @mui/material from 5.15.16 to 5.15.20 (#92) Snyk has created this PR to upgrade @mui/material from 5.15.16 to 5.15.20. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [Fix] #94, refactor-ignore logic (multiline) (#95) Serverside: When writing entry, the most recent previous entry is checked wether to be ignored. Also if more than 2 items already exist meaning writing is preparing at least the 3rd entry, we recalculate distances and timing if previousItems are ignored. Frontend: In order to benefit and get the recent information that a previous item is being ignored, frontEnd askes for the current item again and merges it and following items. Remember the most recent item can never be ignored due to policy. Maybe there is no further writing, so I want to have the latest datapoint. * [Task] #94, add logging if logical error with ignore * [Task] #94, cleanup console.logs * [Fix] #93, offline message improvement (#96) * fix: package.json & package-lock.json to reduce vulnerabilities (#101) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-7361793 Co-authored-by: snyk-bot * fix: upgrade @mui/material from 5.15.20 to 5.16.5 (#102) Snyk has created this PR to upgrade @mui/material from 5.15.20 to 5.16.5. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 93 fix error message when server not available (#103) * [Fix] #93, offline message improvement * [Task] #93, removed background in status module when no data is present * [Task] #61, add cut class to map for styling * [Fix] #93 fix tests, be more specific on url, and let test fail non silently when csrf is not found * [Fix] #94, repair overwriting the last data point * fix: upgrade @emotion/react from 11.11.4 to 11.13.0 (#104) Snyk has created this PR to upgrade @emotion/react from 11.11.4 to 11.13.0. See this package in npm: @emotion/react See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @emotion/styled from 11.11.5 to 11.13.0 (#105) Snyk has created this PR to upgrade @emotion/styled from 11.11.5 to 11.13.0. See this package in npm: @emotion/styled See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.25.0 to 6.25.1 (#106) Snyk has created this PR to upgrade react-router-dom from 6.25.0 to 6.25.1. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.16.4 to 5.16.5 (#107) Snyk has created this PR to upgrade @mui/icons-material from 5.16.4 to 5.16.5. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-rate-limit from 7.3.1 to 7.4.0 (#108) Snyk has created this PR to upgrade express-rate-limit from 7.3.1 to 7.4.0. See this package in npm: express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 109 marker and line design (#110) * [Task] #109, start polyline * [Task] #94, marker * [Task] #109, gradient color polyline color based on speed * [Task] #109 linter fixes * fix: upgrade react-router-dom from 6.25.1 to 6.26.0 (#113) Snyk has created this PR to upgrade react-router-dom from 6.25.1 to 6.26.0. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/material from 5.16.5 to 5.16.6 (#112) Snyk has created this PR to upgrade @mui/material from 5.16.5 to 5.16.6. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * Switch polyline (#114) * [Revert] #109 remove polyColor Plugin * [Fix, MultiLine] #109, refactor coloring lines; while fetchinng new data vs reloading MaxSpeed might change the more entries are fetched. Example Testcase and after 6 entries are there, reload and see colors change ... well not with this fix. * [Task] #109, improve polyline display, remove unused code * [Task] #77, change timing to round up, so it "feels" more accurate * [Task] #115, remove SVG Animation on startup based on media Query * [Task] #77 improve test example data * [Task] #77, calculate more Status data * [Task] #77, improve example test data * [Task] #109, line dashed when diff is high, marker start icon when diff is higher * [Task] #77, status design * [Task] #83, forced scheme for map * [Task] #83, change context, mode globally available * [Task] #83, react update, cluster install * [Task, multiline] #83, map tilelayer Introduced new map TileLayers using layers control, and styled it Introduced markerClusterGroup from @changey, since others had issues like broken marker images, or lack for typescript support Refined dashed array styles Addapted context changes, to fetch mode globally, for seperate map theme Markers have none style if neither end or start, to be targeted Introduced Layer array for tilelayers When Layers are changed theme for map is set/updated * [Task] #77 improve responsive design, hide images, status overlays map * [Task] #77, adjust coloring and opacity, used for status * [Task] #83, adjust imports * [Task] #77, changed responsive design for mobile * [Task] #83, extracted to own module, added fly option * [Task] #83, layers extracted, clickable minimap, corrected for mapbox tileSize * Bump webpack from 5.91.0 to 5.94.0 (#117) Bumps [webpack](https://github.com/webpack/webpack) from 5.91.0 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [Task] #83, code cleanup * [Fix] #83, mime type setting * [fix] #123, run pre and post build for production too --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: snyk-bot * Release 1_4 (#127) * [Task] #6 provide fallback index.html * [Task] #6 production ready code (m) move httpdocs folder to dist have compile without sourcemaps for faster speed * [Task] #6 create github action for upload when main is updated (#21) * [change] #6 new ftp upload action * [Fix] #6 replace host with server in ftp action * [Task] #6 basic log (#26) * [CHANGE] #6 revert back to require output for production * [Task] #6 add ability to manually upload to prod * [Task] #9 enable manual start of codechecks * 10 webhook for writing (#36) * [Change] #3 clean up npm scripts, to have clean folder before build * [Task] #10 created data types in typescript * [Temp] #10 created subroute for writing, and folder structure * [Change] #3 include to use relative paths from src folder in ts and node https://stackoverflow.com/questions/43281741/how-can-i-use-paths-in-tsconfig-json See comment from Remo H. Hansen with at least 100 upvoted * [Change] Update VSCode to keep files open * [Task] #18 setup dotenv for secret variables * [Temp, Task] #10 Validate inputs using express-validator and custom functions * [Task] #18 prevent parameter pollution * [Task] #10 validating incoming parameter and logging errors * [Task] #7 add basic cache to express * [Changes] #7 Error Handling, to include basic custom Error Handling * [Task] #10 enhanced validation to only allow known parameters * [Change] #35 added Jest, tests for helper functions when writing * [Task] #10 better error Handling * [Task] #35 add tests for writing webhook validation * [TASK] #18 protect Webhook using KEY * [Fix] #35 test know import path structure now * [Task] #35 add test for protected webhook * [Task] #35 refactor build to run jest tests * [Task] #10 switched to crypto instead of bcrypt for dependency issue see synk inflight * [Fix] #36 PRQ Feedback * [Task] #3 improve error handling, logger and added chalk to colorize console output. Had to use chalk version 4 because of typescript converting to require, and chalk5 do want import syntax. * [Change] #3 nodemon to clear console when in dev mode * [!Task] #32 webhook creates folder and file based on date * [Change] #35 relocated tests and refactor write, also added file check * [Task] #18, installed helmet, configured self as CSP origin * [Fix] moved chalk out of dev dependency * [Task] #32 error logging and text output improvement, log string instead of "object" * [Task] #18 CSP Update to allow localhost for testing * [Fix] #3 debugging setup improvments * [FIX] #10 Error Handling * [Task] #10 writing basic non calculated data to file * [Fix] #10 avoid Header Modification after sending the request * [Task] #10 JSON Data pretty output * [Task] #32 update types to reflect subobjects of entry * [Task] #10 write time * [Task] #32 added logging for time edgecases * [Task] #10 output seconds * [Task] #10 calculate distance based on lat and lon * [Task] #32 writing tests for time and distance * [Task] #32 change distance calculation to use pythagoras * [Task] #38 add favicon * [Task] #32 time converted to seconds * [Taskk] #32 speed calculation and output and tests * [Task] #32 speed tests * [Task] #33 add ignore * [Task] #32 test finetuning * [Task] #32 add angle between entries * [Task] #32 test for angle, extracted getData function * [change] #32 test to include optional leading 0 for days * [!!!Task] #18 add uncaughtExeption handler as last resort * [Task] #7 enhance static options to include common filetypes; index file start is used as index file to avoid collisions with host provider * [change] #32 validation to be used more explictly * [change] #32 add index to log while writing * [Task] #32 test if 1000 calls can be made with randomized data * [!!! Task] #32 limit JSON Data to be 1000 lines: replace last line with most recent entry * [Change, Task] #32 if 1000 entries exceeded, only replace last if hdop is good * [Change] build action enable button to on manually * [temp] test y tests fail * Create node.js.yml * Create main.yml * [!!!Fix] Created new workflow to build / test node, commented tests back in. Increased time between server calls in test, to check difference time more accurately * [Task] #33 moved ignore to its own file since it creates data rather than validating it * 42 output json (#44) * [Task] #42, created route to output json * [Task] #42 added tests for read json * 41 add rate limiter (#45) * [Task] #18, limit request size for security reasons * [Task] #43, introduce gzip to transfer data * [Task] #34 improve error handling, log server shutdowns * [Task] #34 installed and integrated tooBusy to send 503 when load is high * [Task] #34 improved tooBusy, improved formatting * [Task, Temp] #41 installed ratelimiter and slowDown * [Task] #42 cleanup ipv6 addresses * [Change] #10 error handling for better gitBash and txt output, also reduced stack in case of validation errors * [Task] #41 prepare Log for RateLImit errors * [Temp] #41 write route rateLImited temp: see Todos * [Task] #34 colorize prefix in console * [Task] #42 extract middlewares and move to folder * [Task] #41 ratelimiter cleaning up periodicly * [Task] #41 skip tests in rateLimiting * Bump follow-redirects from 1.15.5 to 1.15.6 (#47) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 43 secure output route (#46) * [Task] #43 create color pallette via atmos * [Task] #43 create color pallette via atmos * [Task] #43 cleanup colors and svg * [Task] #41 remove test code * [CHANGE] #3 reconfigured nodemon to copy static files * [Task] #18 replaced getRawBody with builtIn express urlEncoded * [Temp, Task] #43 basic login page, not yet used as middleware * [Temp] #43, create and validate json web token * [Task] #43, add slowDown and RateLimit for failed login attempts * [Task] #43, ratelimit for login page * [Task] #43, add global ratelimiter * [fix] #7, improve error handeling for express errors * [Task] #43 rework body limitations to be checked only appropiate methods * [Task] #43 added check for data before using it * [Task] #43 check that body is ignored for GET in request * [Task] #43 login test * [Task] #43 create tests for login * [Task] #43 fine tune error handling * [Task] #43, finished login and jwt related tests * [Change] #34, no further need for test logging * [Task] #43, fine tune jwt, middleware process improved * [CHANGE] #43 created new esLint to have clientside js without ts * [Temp] #43 test to see new linter configuration * [Change] #43 switched to bcrypt for passwords * [Task] #43 read return json in all cases * [Task] #43 introduced color classes * [Task] #43, prq feedback * [Temp} #43 figuring out why tests dont run on github * [Task] #43 code cleanup * 48 move login to seperate controller (#49) * [Task] #43, add label to form * [Task] #48 login controller * 50 integrate csrf protection for login form (#53) * [Task] #50, create CSRF Validation for login form * [Task] #43, added icon to repository for later use * [Task] #50, cleanup cetntralized; rename token functions * [Task] #50, reduced token length and improved error handling * [Task] #50 csrf tests added to login * [Task] #50, added test case for csrf, repaired integration * fix: upgrade express-rate-limit from 7.1.5 to 7.2.0 (#52) Snyk has created this PR to upgrade express-rate-limit from 7.1.5 to 7.2.0. See this package in npm: https://www.npmjs.com/package/express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: package.json & package-lock.json to reduce vulnerabilities (#54) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-EXPRESS-6474509 Co-authored-by: snyk-bot * [Snyk] Upgrade express from 4.18.2 to 4.18.3 (#51) * fix: upgrade express from 4.18.2 to 4.18.3 Snyk has created this PR to upgrade express from 4.18.2 to 4.18.3. See this package in npm: https://www.npmjs.com/package/express See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr * 50 integrate csrf protection for login form (#53) * [Task] #50, create CSRF Validation for login form * [Task] #43, added icon to repository for later use * [Task] #50, cleanup cetntralized; rename token functions * [Task] #50, reduced token length and improved error handling * [Task] #50 csrf tests added to login * [Task] #50, added test case for csrf, repaired integration * fix: upgrade express-rate-limit from 7.1.5 to 7.2.0 (#52) Snyk has created this PR to upgrade express-rate-limit from 7.1.5 to 7.2.0. See this package in npm: https://www.npmjs.com/package/express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot --------- Co-authored-by: snyk-bot * [Task] update dev after main merge * [Task] npm upgrade * 58 react setup (#59) * [Task] #58 install react via npm, incl. types and eslint plugins * [Task] #58, tsconfig for react folder * [Task] #58 esLint config * [Task] #58, webpack and react setup * [Task] #58, render welcome from express instead of static * [Task] #58 eslint scripts * [Task] #58, eslint react setup * [TASK] #58 integrate webpack in build and dev npm scripts * [Temp] Test csp * [FIX] Add views to be deployed to prod * [Task] disable csp for local development * [Task] #58 base css including colors, deleted color classes in favor of variables * [Task] #58 typescript setup for react * [Task] #58 webpack setup for react and typescript * [Task] #58 app setup react * [Temp] #58 conctact module css * [Task] #58 remove learning files * [Task] #61, create font * Revert "[Task] #58 remove learning files" This reverts commit b63bb97045a9443e11ca9d8658f1e7faecf96e3b. * [Task] #61, adjust for darkmode * [Task] #61 apply base style to login * [Task] #58, dev tesing rule to disable * [Task] #58, adjust styles for headline * [Task] #58, create Contacts wrapper Component * [Task] #58 apply wrapper component * [Task] #58 adjust contact component to expect object * [Task] #58, toggle state * [Task] #58 learn context api provider and consumer * [Task] #58 add delete via dispatch * [Task] #58, react-router, move contacts to new url * [Task] #58 fetch more contacts * fix: package.json & package-lock.json to reduce vulnerabilities (#62) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-EJS-6689533 Co-authored-by: snyk-bot * Bump tar and npm (#60) Bumps [tar](https://github.com/isaacs/node-tar) to 6.2.1 and updates ancestor dependency [npm](https://github.com/npm/cli). These dependencies need to be updated together. Updates `tar` from 6.2.0 to 6.2.1 - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v6.2.0...v6.2.1) Updates `npm` from 10.5.0 to 10.5.2 - [Release notes](https://github.com/npm/cli/releases) - [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md) - [Commits](https://github.com/npm/cli/compare/v10.5.0...v10.5.2) --- updated-dependencies: - dependency-name: tar dependency-type: indirect - dependency-name: npm dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump ejs from 3.1.9 to 3.1.10 (#63) Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10. - [Release notes](https://github.com/mde/ejs/releases) - [Commits](https://github.com/mde/ejs/compare/v3.1.9...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [Task] #58, webpack configuriation to allow regular css files as well as modules * [Task] #58, clean up react learn files * [Task] #58, setup react router * [Task] #61 install Material UI * [Task] #61, test mui * [CHANGE, MultiLine] #61 color variables levels removed, MUI Overwrites introduced color variables levels are replaced by color-mix. MUI Experimental API with Variables is used and to overwrite theme colors in css (since I want CSS to be single source of truth for colors) * [Temp] #61 introduce darkmode to MUI * [Task] #61, create new start module so that App can act as root * [Task] #61, naming update * [Task] #61, move router to root App * [Task] #61, add font to preload * [Task] #61, dim colors in dark mode * [Task] #61, introduce modeswitcher * [Change] #64, refactoring splitting pages and components * [Task] #61, mobile Theme Swticher placed on top right * [Task] #61, mobile theme switcher icon only on mobile * [Task] #61, button color and background improvement * [Task] #63, login page first draft * [Temp] #61, login controller commented out unused route, TO BE REFACTORED * [Task] #63, login validation * [Task] #63, add error icon * [Task] #61, cut design update * [Task] #53, apply cut, rename FormData to FormInfo to avoid confusion with reserved name * [Task] #63, send login request * [Task] #61, loading icon * [Task] #63, get csrfToken, fullfill login request * [Fix] #63, fail gracefully when too many tokens * [Task] #63, error Handling in login form * [Task] #81, remove password log * [Task] #80, cleanup todo token * fix: upgrade multiple dependencies with Snyk (#68) Snyk has created this PR to upgrade: - react from 18.2.0 to 18.3.1. See this package in npm: https://www.npmjs.com/package/react - react-dom from 18.2.0 to 18.3.1. See this package in npm: https://www.npmjs.com/package/react-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [Fix] #64, disable express header * [Task] #64, protect csrf token page with custom http header * [FIx] #64, fix csrf test * [Task] #64, repair test cases * fix: upgrade express-slow-down from 2.0.1 to 2.0.2 (#69) Snyk has created this PR to upgrade express-slow-down from 2.0.1 to 2.0.2. See this package in npm: express-slow-down See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [fix] #64, linter fixes * [Task] Editor Config * [Task] #61, convert background line to svg and animate * [Task] #61, main headline style * [Task] #61, fine tune background pattern * [Task] #61, font-weight reduced in darkmode * [Task] #64, login design improvements * [Task] #61, update design with minor ripples and edges * [Task] #70, store token after login * Bump braces from 3.0.2 to 3.0.3 (#76) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: upgrade @mui/icons-material from 5.15.16 to 5.15.18 (#75) Snyk has created this PR to upgrade @mui/icons-material from 5.15.16 to 5.15.18. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.23.0 to 6.23.1 (#74) Snyk has created this PR to upgrade react-router-dom from 6.23.0 to 6.23.1. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-slow-down from 2.0.2 to 2.0.3 (#73) Snyk has created this PR to upgrade express-slow-down from 2.0.2 to 2.0.3. See this package in npm: express-slow-down See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-rate-limit from 7.2.0 to 7.3.0 (#82) Snyk has created this PR to upgrade express-rate-limit from 7.2.0 to 7.3.0. See this package in npm: express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-validator from 7.0.1 to 7.1.0 (#81) Snyk has created this PR to upgrade express-validator from 7.0.1 to 7.1.0. See this package in npm: express-validator See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade axios from 1.7.1 to 1.7.2 (#80) Snyk has created this PR to upgrade axios from 1.7.1 to 1.7.2. See this package in npm: axios See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.15.18 to 5.15.19 (#79) Snyk has created this PR to upgrade @mui/icons-material from 5.15.18 to 5.15.19. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.15.19 to 5.15.20 (#88) Snyk has created this PR to upgrade @mui/icons-material from 5.15.19 to 5.15.20. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.23.1 to 6.24.0 (#91) Snyk has created this PR to upgrade react-router-dom from 6.23.1 to 6.24.0. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 77 design base layout (#85) * [Task] #77 1st draft layout * [Change] #70 update token expire date * [Temp] #77, log out data on valid request, temp: error handling and display * [Temp] * [Task] #77, login Button functionality, default state * [Task] #77, removed outdated comments * [Task] #77, introduced linearBuffer Bar for login * [Task] #77, added modeSwticher to start page * [Task] #77, display last entry on map demo * [Task] #77, enhance login, show pastUser if availabe, show user on mainpage * [!!!Task] #77 first draft of functionality * [Task] #77 move map to new location * [Task] #77 create testData * [Fix] #77 codeFactor complains * [Task] #77, draft of status content * [FIX] #77 change data accumulation * [Task] #77 improve test example data * fix: upgrade @mui/material from 5.15.16 to 5.15.20 (#92) Snyk has created this PR to upgrade @mui/material from 5.15.16 to 5.15.20. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * [Fix] #94, refactor-ignore logic (multiline) (#95) Serverside: When writing entry, the most recent previous entry is checked wether to be ignored. Also if more than 2 items already exist meaning writing is preparing at least the 3rd entry, we recalculate distances and timing if previousItems are ignored. Frontend: In order to benefit and get the recent information that a previous item is being ignored, frontEnd askes for the current item again and merges it and following items. Remember the most recent item can never be ignored due to policy. Maybe there is no further writing, so I want to have the latest datapoint. * [Task] #94, add logging if logical error with ignore * [Task] #94, cleanup console.logs * [Fix] #93, offline message improvement (#96) * fix: package.json & package-lock.json to reduce vulnerabilities (#101) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-7361793 Co-authored-by: snyk-bot * fix: upgrade @mui/material from 5.15.20 to 5.16.5 (#102) Snyk has created this PR to upgrade @mui/material from 5.15.20 to 5.16.5. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 93 fix error message when server not available (#103) * [Fix] #93, offline message improvement * [Task] #93, removed background in status module when no data is present * [Task] #61, add cut class to map for styling * [Fix] #93 fix tests, be more specific on url, and let test fail non silently when csrf is not found * [Fix] #94, repair overwriting the last data point * fix: upgrade @emotion/react from 11.11.4 to 11.13.0 (#104) Snyk has created this PR to upgrade @emotion/react from 11.11.4 to 11.13.0. See this package in npm: @emotion/react See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @emotion/styled from 11.11.5 to 11.13.0 (#105) Snyk has created this PR to upgrade @emotion/styled from 11.11.5 to 11.13.0. See this package in npm: @emotion/styled See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade react-router-dom from 6.25.0 to 6.25.1 (#106) Snyk has created this PR to upgrade react-router-dom from 6.25.0 to 6.25.1. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/icons-material from 5.16.4 to 5.16.5 (#107) Snyk has created this PR to upgrade @mui/icons-material from 5.16.4 to 5.16.5. See this package in npm: @mui/icons-material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade express-rate-limit from 7.3.1 to 7.4.0 (#108) Snyk has created this PR to upgrade express-rate-limit from 7.3.1 to 7.4.0. See this package in npm: express-rate-limit See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * 109 marker and line design (#110) * [Task] #109, start polyline * [Task] #94, marker * [Task] #109, gradient color polyline color based on speed * [Task] #109 linter fixes * fix: upgrade react-router-dom from 6.25.1 to 6.26.0 (#113) Snyk has created this PR to upgrade react-router-dom from 6.25.1 to 6.26.0. See this package in npm: react-router-dom See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @mui/material from 5.16.5 to 5.16.6 (#112) Snyk has created this PR to upgrade @mui/material from 5.16.5 to 5.16.6. See this package in npm: @mui/material See this project in Snyk: https://app.snyk.io/org/type-style/project/e2bcd002-cb74-409c-ba55-fb6349df1cbc?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * Switch polyline (#114) * [Revert] #109 remove polyColor Plugin * [Fix, MultiLine] #109, refactor coloring lines; while fetchinng new data vs reloading MaxSpeed might change the more entries are fetched. Example Testcase and after 6 entries are there, reload and see colors change ... well not with this fix. * [Task] #109, improve polyline display, remove unused code * [Task] #77, change timing to round up, so it "feels" more accurate * [Task] #115, remove SVG Animation on startup based on media Query * [Task] #77 improve test example data * [Task] #77, calculate more Status data * [Task] #77, improve example test data * [Task] #109, line dashed when diff is high, marker start icon when diff is higher * [Task] #77, status design * [Task] #83, forced scheme for map * [Task] #83, change context, mode globally available * [Task] #83, react update, cluster install * [Task, multiline] #83, map tilelayer Introduced new map TileLayers using layers control, and styled it Introduced markerClusterGroup from @changey, since others had issues like broken marker images, or lack for typescript support Refined dashed array styles Addapted context changes, to fetch mode globally, for seperate map theme Markers have none style if neither end or start, to be targeted Introduced Layer array for tilelayers When Layers are changed theme for map is set/updated * [Task] #77 improve responsive design, hide images, status overlays map * [Task] #77, adjust coloring and opacity, used for status * [Task] #83, adjust imports * [Task] #77, changed responsive design for mobile * [Task] #83, extracted to own module, added fly option * [Task] #83, layers extracted, clickable minimap, corrected for mapbox tileSize * Bump webpack from 5.91.0 to 5.94.0 (#117) Bumps [webpack](https://github.com/webpack/webpack) from 5.91.0 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [Task] #83, code cleanup * [Fix] #83, mime type setting * [fix] #123, run pre and post build for production too * [Change] #123, to see real user ip instead of localhost proxy (#126) --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: snyk-bot --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: snyk-bot * 125 show old data from yesterday (#129) * [Change] #123, to see real user ip instead of localhost proxy * [Task] #125, show old data * [fix] #77, update marker cluster design --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: snyk-bot --- src/client/css/map.css | 2 +- src/controller/read.ts | 5 ++- src/models/entry.ts | 9 +++-- src/scripts/file.ts | 69 ++++++++++++++++++++++++++++------- src/tests/integration.test.ts | 2 +- types.d.ts | 4 +- 6 files changed, 69 insertions(+), 22 deletions(-) diff --git a/src/client/css/map.css b/src/client/css/map.css index b2646a7..264d09a 100644 --- a/src/client/css/map.css +++ b/src/client/css/map.css @@ -28,7 +28,7 @@ filter: drop-shadow(0px 0px 3px var(--neutral)); } -.marker-cluster-small[class] { /* overwrite default cluster style */ +.marker-cluster[class] { /* overwrite default cluster style */ background: none; div { background-color: var(--semiContrastBackground); diff --git a/src/controller/read.ts b/src/controller/read.ts index bd4b88c..4106251 100644 --- a/src/controller/read.ts +++ b/src/controller/read.ts @@ -17,7 +17,10 @@ router.get('/', return createError(res, 400, JSON.stringify({ errors: errors.array() }), next) } - const fileObj: File.Obj = file.getFile(res, next); + const fileObj: File.Obj = file.getFile(res, next, "read"); + // no content and no file found show empty data and exit + if (fileObj.content == false) { res.json(JSON.parse('{"entries": []}')); return } + fileObj.content = await file.readAsJson(res, fileObj.path, next) if (!fileObj.content || !Array.isArray(fileObj.content.entries)) { return createError(res, undefined, `File corrupt: ${fileObj.path}`, next); diff --git a/src/models/entry.ts b/src/models/entry.ts index 34dbb75..799177b 100644 --- a/src/models/entry.ts +++ b/src/models/entry.ts @@ -13,12 +13,13 @@ import logger from '@src/scripts/logger'; export const entry = { create: async (req: Request, res: Response, next: NextFunction) => { - const fileObj: File.Obj = file.getFile(res, next); + const fileObj: File.Obj = file.getFile(res, next, "write"); + if (!fileObj.content) { return createError(res, 500, "File does not exist: " + fileObj.path, next); } + fileObj.content = await file.readAsJson(res, fileObj.path, next); - if (!fileObj.content?.entries) { - return createError(res, 500, "File Content unavailable: " + fileObj.path, next); - } + if (!fileObj.content?.entries) {return createError(res, 500, "File Content unavailable: " + fileObj.path, next); } + const entries = fileObj.content.entries; const lastEntry = fileObj.content.entries.at(-1); let previousEntry = fileObj.content.entries.at(-1); // potentially overwritten if entry is set to ignore diff --git a/src/scripts/file.ts b/src/scripts/file.ts index a8b693b..fc8d013 100644 --- a/src/scripts/file.ts +++ b/src/scripts/file.ts @@ -5,11 +5,11 @@ import { create as createError } from '@src/middleware/error'; import { NextFunction, Response } from 'express'; import logger from '@src/scripts/logger'; -export const getFile = (res: Response, next: NextFunction): File.Obj => { +export const getFile = (res: Response, next: NextFunction, method: File.method): File.Obj => { const date = new Date(); const formattedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`; const dirPath = path.resolve(__dirname, '../data'); - const filePath = path.resolve(dirPath, `data-${formattedDate}.json`); + let filePath = path.resolve(dirPath, `data-${formattedDate}.json`); if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, { recursive: true }); @@ -17,17 +17,24 @@ export const getFile = (res: Response, next: NextFunction): File.Obj => { } let fileExisted = true; - if (!fs.existsSync(filePath)) { // check if file exist + let olderFile = false; + if (!fs.existsSync(filePath)) { // if file does not exist fileExisted = false; - try { - fs.writeFileSync(filePath, '{"entries": []}'); - logger.log(`file: ${filePath} did not exist, but created now`); - } catch (err) { - createError(res, 500, "File cannot be written to", next); + const mostRecentFile = findMostRecentFile(dirPath); + if (method == "read" && mostRecentFile) { // when reading check old files + olderFile = true; + filePath = mostRecentFile; + } else if (method == "write") { + try { + fs.writeFileSync(filePath, '{"entries": []}'); + logger.log(`file: ${filePath} did not exist, but created now`); + } catch (err) { + createError(res, 500, "File cannot be written to", next); + } } } - return { path: filePath, content: fileExisted ? undefined : JSON.parse('{"entries": []}') }; // if the file did not exist before, the content is emptyString + return { path: filePath, content: method == "read" ? (fileExisted || olderFile) : JSON.parse('{"entries": []}') }; }; @@ -39,24 +46,58 @@ export async function readAsJson(res: Response, filePath: string, next: NextFunc try { return JSON.parse(data); } catch (err) { - createError(res, 500, "File contains wrong content: " + filePath, next); + createError(res, 500, "File contains wrong content: " + path.basename(filePath), next); } } -export const write = (res:Response, fileObj:File.Obj, next: NextFunction) => { +export const write = (res: Response, fileObj: File.Obj, next: NextFunction) => { if (!fs.existsSync(fileObj.path)) { // check if file exist createError(res, 500, "Can not write to file that does not exist: " + fileObj.path, next); } + + if (typeof fileObj.content == "boolean") { + createError(res, 500, `File (${fileObj.path}) cannot be written to, contents are not correct type`, next); + } + try { const content = JSON.stringify(fileObj.content, undefined, 2); fs.writeFileSync(fileObj.path, content); fileObj.content = JSON.parse(content); - logger.log(`written to file: ${fileObj.path} ${fileObj.content ? fileObj.content?.entries.length - 1 : ''}`); + if (typeof fileObj.content != "boolean") { + logger.log(`written to file: ${fileObj.path} ${fileObj.content?.entries ? fileObj.content.entries.length - 1 : ''}`); + } } catch (err) { createError(res, 500, `File (${fileObj.path}) cannot be written to`, next); - } + } + - return fileObj; // if the file did not exist before, the content is emptyString + return fileObj; }; + +const findMostRecentFile = (directoryPath: string) => { + // read all files from the directory + const files = fs.readdirSync(directoryPath); + + // initialize variables to keep track of the most recent file + let mostRecentFile = null; + let mostRecentTime = 0; + + files.forEach((file) => { + const filePath = path.join(directoryPath, file); + + // get file stats (including modified time) + const stats = fs.statSync(filePath); + + // check if it is a file (and not a directory) and most recent + if (stats.isFile() && stats.mtimeMs > mostRecentTime) { + if (stats.mtimeMs > mostRecentTime) { + mostRecentTime &&= stats.mtimeMs; + mostRecentFile = filePath; + } + } + }); + + return mostRecentFile; +} diff --git a/src/tests/integration.test.ts b/src/tests/integration.test.ts index e79be6f..9cad2b5 100644 --- a/src/tests/integration.test.ts +++ b/src/tests/integration.test.ts @@ -223,7 +223,7 @@ describe('API calls', () => { const response = await axios.get(url); expect(response.status).toBe(200); } - }, 20000); // adjust this to to fit your setup + }, 22000); // adjust this to to fit your setup test(`length of json should not exceed 1000`, async () => { const date = new Date(); diff --git a/types.d.ts b/types.d.ts index 0bab5de..f246bc4 100644 --- a/types.d.ts +++ b/types.d.ts @@ -24,8 +24,10 @@ namespace Response { namespace File { interface Obj { path: string, - content?: Models.IEntries; + content?: Models.IEntries | boolean; } + + type method = 'read' | 'write'; } namespace Models {