feat: Major updates to backend structure and security enhancements
- Removed `COMMON_ERRORS.md` file to streamline documentation. - Added `Flask-Limiter` for rate limiting and `redis` for session management in `requirements.txt`. - Expanded `ROADMAP.md` to include completed security features and planned enhancements for version 2.2. - Enhanced `setup_myp.sh` for ultra-secure kiosk installation, including system hardening and security configurations. - Updated `app.py` to integrate CSRF protection and improved logging setup. - Refactored user model to include username and active status for better user management. - Improved job scheduler with uptime tracking and task management features. - Updated various templates for a more cohesive user interface and experience.
This commit is contained in:
63
backend/app/node_modules/package-json-from-dist/LICENSE.md
generated
vendored
Normal file
63
backend/app/node_modules/package-json-from-dist/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
All packages under `src/` are licensed according to the terms in
|
||||
their respective `LICENSE` or `LICENSE.md` files.
|
||||
|
||||
The remainder of this project is licensed under the Blue Oak
|
||||
Model License, as follows:
|
||||
|
||||
-----
|
||||
|
||||
# Blue Oak Model License
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
## Purpose
|
||||
|
||||
This license gives everyone as much permission to work with
|
||||
this software as possible, while protecting contributors
|
||||
from liability.
|
||||
|
||||
## Acceptance
|
||||
|
||||
In order to receive this license, you must agree to its
|
||||
rules. The rules of this license are both obligations
|
||||
under that agreement and conditions to your license.
|
||||
You must not do anything with this software that triggers
|
||||
a rule that you cannot or will not follow.
|
||||
|
||||
## Copyright
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe that contributor's
|
||||
copyright in it.
|
||||
|
||||
## Notices
|
||||
|
||||
You must ensure that everyone who gets a copy of
|
||||
any part of this software from you, with or without
|
||||
changes, also gets the text of this license or a link to
|
||||
<https://blueoakcouncil.org/license/1.0.0>.
|
||||
|
||||
## Excuse
|
||||
|
||||
If anyone notifies you in writing that you have not
|
||||
complied with [Notices](#notices), you can keep your
|
||||
license by taking all practical steps to comply within 30
|
||||
days after the notice. If you do not do so, your license
|
||||
ends immediately.
|
||||
|
||||
## Patent
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe any patent claims
|
||||
they can license or become able to license.
|
||||
|
||||
## Reliability
|
||||
|
||||
No contributor can revoke this license.
|
||||
|
||||
## No Liability
|
||||
|
||||
***As far as the law allows, this software comes as is,
|
||||
without any warranty or condition, and no contributor
|
||||
will be liable to anyone for any damages related to this
|
||||
software or this license, under any kind of legal claim.***
|
110
backend/app/node_modules/package-json-from-dist/README.md
generated
vendored
Normal file
110
backend/app/node_modules/package-json-from-dist/README.md
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
# package-json-from-dist
|
||||
|
||||
Sometimes you want to load the `package.json` into your
|
||||
TypeScript program, and it's tempting to just `import
|
||||
'../package.json'`, since that seems to work.
|
||||
|
||||
However, this requires `tsc` to make an entire copy of your
|
||||
`package.json` file into the `dist` folder, which is a problem if
|
||||
you're using something like
|
||||
[tshy](https://github.com/isaacs/tshy), which uses the
|
||||
`package.json` file in dist for another purpose. Even when that
|
||||
does work, it's asking the module system to do a bunch of extra
|
||||
fs system calls, just to load a version number or something. (See
|
||||
[this issue](https://github.com/isaacs/tshy/issues/61).)
|
||||
|
||||
This module helps by just finding the package.json file
|
||||
appropriately, and reading and parsing it in the most normal
|
||||
fashion.
|
||||
|
||||
## Caveats
|
||||
|
||||
This _only_ works if your code builds into a target folder called
|
||||
`dist`, which is in the root of the package. It also requires
|
||||
that you do not have a folder named `node_modules` anywhere
|
||||
within your dev environment, or else it'll get the wrong answers
|
||||
there. (But, at least, that'll be in dev, so you're pretty likely
|
||||
to notice.)
|
||||
|
||||
If you build to some other location, then you'll need a different
|
||||
approach. (Feel free to fork this module and make it your own, or
|
||||
just put the code right inline, there's not much of it.)
|
||||
|
||||
## USAGE
|
||||
|
||||
```js
|
||||
// src/index.ts
|
||||
import {
|
||||
findPackageJson,
|
||||
loadPackageJson,
|
||||
} from 'package-json-from-dist'
|
||||
|
||||
const pj = findPackageJson(import.meta.url)
|
||||
console.log(`package.json found at ${pj}`)
|
||||
|
||||
const pkg = loadPackageJson(import.meta.url)
|
||||
console.log(`Hello from ${pkg.name}@${pkg.version}`)
|
||||
```
|
||||
|
||||
If your module is not directly in the `./src` folder, then you need
|
||||
to specify the path that you would expect to find the
|
||||
`package.json` when it's _not_ built to the `dist` folder.
|
||||
|
||||
```js
|
||||
// src/components/something.ts
|
||||
import {
|
||||
findPackageJson,
|
||||
loadPackageJson,
|
||||
} from 'package-json-from-dist'
|
||||
|
||||
const pj = findPackageJson(import.meta.url, '../../package.json')
|
||||
console.log(`package.json found at ${pj}`)
|
||||
|
||||
const pkg = loadPackageJson(import.meta.url, '../../package.json')
|
||||
console.log(`Hello from ${pkg.name}@${pkg.version}`)
|
||||
```
|
||||
|
||||
When running from CommmonJS, use `__filename` instead of
|
||||
`import.meta.url`.
|
||||
|
||||
```js
|
||||
// src/index.cts
|
||||
import {
|
||||
findPackageJson,
|
||||
loadPackageJson,
|
||||
} from 'package-json-from-dist'
|
||||
|
||||
const pj = findPackageJson(__filename)
|
||||
console.log(`package.json found at ${pj}`)
|
||||
|
||||
const pkg = loadPackageJson(__filename)
|
||||
console.log(`Hello from ${pkg.name}@${pkg.version}`)
|
||||
```
|
||||
|
||||
Since [tshy](https://github.com/isaacs/tshy) builds _both_
|
||||
CommonJS and ESM by default, you may find that you need a
|
||||
CommonJS override and some `//@ts-ignore` magic to make it work.
|
||||
|
||||
`src/pkg.ts`:
|
||||
|
||||
```js
|
||||
import {
|
||||
findPackageJson,
|
||||
loadPackageJson,
|
||||
} from 'package-json-from-dist'
|
||||
//@ts-ignore
|
||||
export const pkg = loadPackageJson(import.meta.url)
|
||||
//@ts-ignore
|
||||
export const pj = findPackageJson(import.meta.url)
|
||||
```
|
||||
|
||||
`src/pkg-cjs.cts`:
|
||||
|
||||
```js
|
||||
import {
|
||||
findPackageJson,
|
||||
loadPackageJson,
|
||||
} from 'package-json-from-dist'
|
||||
export const pkg = loadPackageJson(__filename)
|
||||
export const pj = findPackageJson(__filename)
|
||||
```
|
68
backend/app/node_modules/package-json-from-dist/package.json
generated
vendored
Normal file
68
backend/app/node_modules/package-json-from-dist/package.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "package-json-from-dist",
|
||||
"version": "1.0.1",
|
||||
"description": "Load the local package.json from either src or dist folder",
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"prepare": "tshy",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"format": "prettier --write . --log-level warn",
|
||||
"typedoc": "typedoc"
|
||||
},
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/isaacs/package-json-from-dist.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.12.12",
|
||||
"prettier": "^3.2.5",
|
||||
"tap": "^18.5.3",
|
||||
"typedoc": "^0.24.8",
|
||||
"typescript": "^5.1.6",
|
||||
"tshy": "^1.14.0"
|
||||
},
|
||||
"prettier": {
|
||||
"semi": false,
|
||||
"printWidth": 70,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": false,
|
||||
"bracketSameLine": true,
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "lf",
|
||||
"experimentalTernaries": true
|
||||
},
|
||||
"tshy": {
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./src/index.ts"
|
||||
}
|
||||
},
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"type": "module"
|
||||
}
|
Reference in New Issue
Block a user