@fdm-monster/server 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.template +0 -3
- package/.yarn/install-state.gz +0 -0
- package/.yarn/releases/{yarn-4.5.1.cjs → yarn-4.5.3.cjs} +307 -307
- package/.yarnrc.yml +1 -1
- package/README.md +3 -2
- package/RELEASE_NOTES.MD +19 -0
- package/dist/constants/server-settings.constants.js +0 -9
- package/dist/constants/server-settings.constants.js.map +1 -1
- package/dist/container.js +4 -4
- package/dist/controllers/auth.controller.js +1 -1
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/camera-stream.controller.js +79 -15
- package/dist/controllers/camera-stream.controller.js.map +1 -1
- package/dist/controllers/settings.controller.js +1 -20
- package/dist/controllers/settings.controller.js.map +1 -1
- package/dist/entities/settings.entity.js.map +1 -1
- package/dist/middleware/global.middleware.js +1 -25
- package/dist/middleware/global.middleware.js.map +1 -1
- package/dist/models/Settings.js +0 -10
- package/dist/models/Settings.js.map +1 -1
- package/dist/server.constants.js +1 -2
- package/dist/server.constants.js.map +1 -1
- package/dist/server.core.js +1 -1
- package/dist/server.core.js.map +1 -1
- package/dist/services/interfaces/settings.dto.js +3 -15
- package/dist/services/interfaces/settings.dto.js.map +1 -1
- package/dist/services/mongoose/permission.service.js.map +1 -0
- package/dist/services/mongoose/refresh-token.service.js.map +1 -0
- package/dist/services/mongoose/role.service.js.map +1 -0
- package/dist/services/mongoose/settings.service.js +10 -30
- package/dist/services/mongoose/settings.service.js.map +1 -1
- package/dist/services/{authentication → mongoose}/user.service.js +2 -2
- package/dist/services/mongoose/user.service.js.map +1 -0
- package/dist/services/octoprint/octoprint-websocket.adapter.js +2 -1
- package/dist/services/octoprint/octoprint-websocket.adapter.js.map +1 -1
- package/dist/services/orm/settings.service.js +9 -27
- package/dist/services/orm/settings.service.js.map +1 -1
- package/dist/services/orm/user.service.js +38 -3
- package/dist/services/orm/user.service.js.map +1 -1
- package/dist/services/validators/settings-service.validation.js +8 -19
- package/dist/services/validators/settings-service.validation.js.map +1 -1
- package/dist/services/validators/yaml-service.validation.js +1 -1
- package/dist/services/validators/yaml-service.validation.js.map +1 -1
- package/dist/state/settings.store.js +0 -9
- package/dist/state/settings.store.js.map +1 -1
- package/package.json +14 -15
- package/dist/services/authentication/permission.service.js.map +0 -1
- package/dist/services/authentication/refresh-token.service.js.map +0 -1
- package/dist/services/authentication/role.service.js.map +0 -1
- package/dist/services/authentication/user.service.js.map +0 -1
- /package/dist/services/{authentication → mongoose}/permission.service.js +0 -0
- /package/dist/services/{authentication → mongoose}/refresh-token.service.js +0 -0
- /package/dist/services/{authentication → mongoose}/role.service.js +0 -0
package/.yarnrc.yml
CHANGED
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ Please join the discord, but stay professional and proactive!
|
|
|
76
76
|
These are the people involved in the project. Find the meaning of the emoji keys [here](https://allcontributors.org/docs/en/emoji-key).
|
|
77
77
|
|
|
78
78
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
79
|
-
[](#contributors-)
|
|
80
80
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
81
81
|
|
|
82
82
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
@@ -87,7 +87,7 @@ These are the people involved in the project. Find the meaning of the emoji keys
|
|
|
87
87
|
<tr>
|
|
88
88
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/davidzwa"><img src="https://avatars.githubusercontent.com/u/6005355?v=4?s=80" width="80px;" alt="David Zwart"/><br /><sub><b>David Zwart</b></sub></a><br /><a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3Adavidzwa" title="Bug reports">🐛</a> <a href="https://github.com/fdm-monster/fdm-monster/commits?author=davidzwa" title="Code">💻</a> <a href="#maintenance-davidzwa" title="Maintenance">🚧</a> <a href="#userTesting-davidzwa" title="User Testing">📓</a></td>
|
|
89
89
|
<td align="center" valign="top" width="14.28%"><a href="https://kevenaar.name"><img src="https://avatars.githubusercontent.com/u/834643?v=4?s=80" width="80px;" alt="Maurice Kevenaar"/><br /><sub><b>Maurice Kevenaar</b></sub></a><br /><a href="#security-mkevenaar" title="Security">🛡️</a> <a href="#maintenance-mkevenaar" title="Maintenance">🚧</a> <a href="#ideas-mkevenaar" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3Amkevenaar" title="Bug reports">🐛</a> <a href="https://github.com/fdm-monster/fdm-monster/pulls?q=is%3Apr+reviewed-by%3Amkevenaar" title="Reviewed Pull Requests">👀</a> <a href="#infra-mkevenaar" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
90
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Tobikisss"><img src="https://avatars.githubusercontent.com/u/45754890?v=4?s=80" width="80px;" alt="Tobias"/><br /><sub><b>Tobias</b></sub></a><br /><a href="#ideas-Tobikisss" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-Tobikisss" title="Maintenance">🚧</a></td>
|
|
90
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Tobikisss"><img src="https://avatars.githubusercontent.com/u/45754890?v=4?s=80" width="80px;" alt="Tobias"/><br /><sub><b>Tobias</b></sub></a><br /><a href="#ideas-Tobikisss" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-Tobikisss" title="Maintenance">🚧</a> <a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3ATobikisss" title="Bug reports">🐛</a></td>
|
|
91
91
|
<td align="center" valign="top" width="14.28%"><a href="https://tideline3d.com"><img src="https://avatars.githubusercontent.com/u/12903320?v=4?s=80" width="80px;" alt="tideline3d"/><br /><sub><b>tideline3d</b></sub></a><br /><a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3Atideline3d" title="Bug reports">🐛</a> <a href="#ideas-tideline3d" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
92
92
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/windarrow3d"><img src="https://avatars.githubusercontent.com/u/91099282?v=4?s=80" width="80px;" alt="WindArrow3d"/><br /><sub><b>WindArrow3d</b></sub></a><br /><a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3Awindarrow3d" title="Bug reports">🐛</a> <a href="#financial-windarrow3d" title="Financial">💵</a> <a href="#ideas-windarrow3d" title="Ideas, Planning, & Feedback">🤔</a> <a href="#userTesting-windarrow3d" title="User Testing">📓</a> <a href="#platform-windarrow3d" title="Packaging/porting to new platform">📦</a></td>
|
|
93
93
|
<td align="center" valign="top" width="14.28%"><a href="http://lucianchapar.com"><img src="https://avatars.githubusercontent.com/u/33263520?v=4?s=80" width="80px;" alt="Lucian Chapar"/><br /><sub><b>Lucian Chapar</b></sub></a><br /><a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3Alucian151" title="Bug reports">🐛</a></td>
|
|
@@ -107,6 +107,7 @@ These are the people involved in the project. Find the meaning of the emoji keys
|
|
|
107
107
|
<td align="center" valign="top" width="14.28%"><a href="http://insanityautomation.com/"><img src="https://avatars.githubusercontent.com/u/38436470?v=4?s=80" width="80px;" alt="InsanityAutomation"/><br /><sub><b>InsanityAutomation</b></sub></a><br /><a href="#ideas-InsanityAutomation" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3AInsanityAutomation" title="Bug reports">🐛</a></td>
|
|
108
108
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/LyfeOnEdge"><img src="https://avatars.githubusercontent.com/u/26140376?v=4?s=80" width="80px;" alt="Andrew (LyfeOnEdge) (ArcticGentoo)"/><br /><sub><b>Andrew (LyfeOnEdge) (ArcticGentoo)</b></sub></a><br /><a href="#ideas-LyfeOnEdge" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
109
109
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/callanova"><img src="https://avatars.githubusercontent.com/u/175639705?v=4?s=80" width="80px;" alt="callanova"/><br /><sub><b>callanova</b></sub></a><br /><a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3Acallanova" title="Bug reports">🐛</a></td>
|
|
110
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/thatguymendel"><img src="https://avatars.githubusercontent.com/u/67444998?v=4?s=80" width="80px;" alt="thatguymendel"/><br /><sub><b>thatguymendel</b></sub></a><br /><a href="#ideas-thatguymendel" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
110
111
|
</tr>
|
|
111
112
|
</tbody>
|
|
112
113
|
</table>
|
package/RELEASE_NOTES.MD
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Develop
|
|
2
2
|
|
|
3
|
+
# FDM Monster 25/11/2024 1.7.6
|
|
4
|
+
|
|
5
|
+
## Fixes
|
|
6
|
+
|
|
7
|
+
- UserService: MongoDB had incorrect root user checks and SQLite user service missed the check altogether. Now root user checks are robust.
|
|
8
|
+
- Camera API: GUEST should not have access to change cameras
|
|
9
|
+
- YAML import validation: new API keys are not accepted by outdated YAML validation
|
|
10
|
+
|
|
11
|
+
# FDM Monster 23/11/2024 1.7.5
|
|
12
|
+
|
|
13
|
+
## Fixes
|
|
14
|
+
|
|
15
|
+
- Demo mode should never show first-time-setup. It would always return "first time setup completed: false". Now this will return true.
|
|
16
|
+
- Incorrect UI state "No USB" shown, when OctoPrint USB is disconnected.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- Remove whitelist settings from database, API, validation and remove IP package (CVE)
|
|
21
|
+
|
|
3
22
|
# FDM Monster 13/11/2024 1.7.4
|
|
4
23
|
|
|
5
24
|
## Features:
|
|
@@ -33,9 +33,6 @@ _export(exports, {
|
|
|
33
33
|
getDefaultTimeout: function() {
|
|
34
34
|
return getDefaultTimeout;
|
|
35
35
|
},
|
|
36
|
-
getDefaultWhitelistIpAddresses: function() {
|
|
37
|
-
return getDefaultWhitelistIpAddresses;
|
|
38
|
-
},
|
|
39
36
|
getDefaultWizardSettings: function() {
|
|
40
37
|
return getDefaultWizardSettings;
|
|
41
38
|
},
|
|
@@ -54,10 +51,6 @@ _export(exports, {
|
|
|
54
51
|
});
|
|
55
52
|
const _serverconstants = require("../server.constants");
|
|
56
53
|
const _uuid = require("uuid");
|
|
57
|
-
const getDefaultWhitelistIpAddresses = ()=>[
|
|
58
|
-
"::12",
|
|
59
|
-
"127.0.0.1"
|
|
60
|
-
];
|
|
61
54
|
const wizardSettingKey = "wizard";
|
|
62
55
|
const getDefaultWizardSettings = ()=>({
|
|
63
56
|
wizardCompleted: false,
|
|
@@ -77,8 +70,6 @@ const getDefaultServerSettings = ()=>({
|
|
|
77
70
|
sentryDiagnosticsEnabled: false,
|
|
78
71
|
loginRequired: true,
|
|
79
72
|
registration: false,
|
|
80
|
-
whitelistEnabled: false,
|
|
81
|
-
whitelistedIpAddresses: getDefaultWhitelistIpAddresses(),
|
|
82
73
|
experimentalMoonrakerSupport: false,
|
|
83
74
|
experimentalTypeormSupport: false,
|
|
84
75
|
experimentalClientSupport: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/server-settings.constants.ts"],"names":["credentialSettingsKey","frontendSettingKey","getDefaultCredentialSettings","getDefaultFileCleanSettings","getDefaultFrontendSettings","getDefaultServerSettings","getDefaultSettings","getDefaultTimeout","
|
|
1
|
+
{"version":3,"sources":["../../src/constants/server-settings.constants.ts"],"names":["credentialSettingsKey","frontendSettingKey","getDefaultCredentialSettings","getDefaultFileCleanSettings","getDefaultFrontendSettings","getDefaultServerSettings","getDefaultSettings","getDefaultTimeout","getDefaultWizardSettings","printerFileCleanSettingKey","serverSettingsKey","timeoutSettingKey","wizardSettingKey","wizardCompleted","wizardCompletedAt","wizardVersion","debugSettings","debugSocketIoEvents","debugSocketReconnect","debugSocketRetries","debugSocketSetup","debugSocketMessages","debugSocketIoBandwidth","sentryDiagnosticsEnabled","loginRequired","registration","experimentalMoonrakerSupport","experimentalTypeormSupport","experimentalClientSupport","jwtSecret","uuidv4","jwtExpiresIn","AppConstants","DEFAULT_JWT_EXPIRES_IN","refreshTokenAttempts","DEFAULT_REFRESH_TOKEN_ATTEMPTS","refreshTokenExpiry","DEFAULT_REFRESH_TOKEN_EXPIRY","gridCols","gridRows","largeTiles","apiTimeout","autoRemoveOldFilesBeforeUpload","autoRemoveOldFilesAtBoot","autoRemoveOldFilesCriteriumDays"],"mappings":";;;;;;;;;;;IAoCaA,qBAAqB;eAArBA;;IAYAC,kBAAkB;eAAlBA;;IAXAC,4BAA4B;eAA5BA;;IAwBAC,2BAA2B;eAA3BA;;IAZAC,0BAA0B;eAA1BA;;IA9BAC,wBAAwB;eAAxBA;;IAgDAC,kBAAkB;eAAlBA;;IAXAC,iBAAiB;eAAjBA;;IA5CAC,wBAAwB;eAAxBA;;IAgDAC,0BAA0B;eAA1BA;;IA1CAC,iBAAiB;eAAjBA;;IAqCAC,iBAAiB;eAAjBA;;IA5CAC,gBAAgB;eAAhBA;;;iCAXgB;sBACA;AAUtB,MAAMA,mBAAmB;AACzB,MAAMJ,2BAA2B,IAA0B,CAAA;QAChEK,iBAAiB;QACjBC,mBAAmB;QACnBC,eAAe;IACjB,CAAA;AAEO,MAAML,oBAAoB;AAC1B,MAAML,2BAA2B,IAA0B,CAAA;QAChEW,eAAe;YACbC,qBAAqB;YACrBC,sBAAsB;YACtBC,oBAAoB;YACpBC,kBAAkB;YAClBC,qBAAqB;YACrBC,wBAAwB;QAC1B;QACAC,0BAA0B;QAC1BC,eAAe;QACfC,cAAc;QACdC,8BAA8B;QAC9BC,4BAA4B;QAC5BC,2BAA2B;IAC7B,CAAA;AAEO,MAAM5B,wBAAwB;AAC9B,MAAME,+BAA+B,IAA8B,CAAA;QAExE2B,WAAWC,IAAAA,QAAM;QAEjBC,cAAcC,6BAAY,CAACC,sBAAsB;QAEjDC,sBAAsBF,6BAAY,CAACG,8BAA8B;QAEjEC,oBAAoBJ,6BAAY,CAACK,4BAA4B;IAC/D,CAAA;AAEO,MAAMpC,qBAAqB;AAC3B,MAAMG,6BAA6B,IAA4B,CAAA;QACpEkC,UAAU;QACVC,UAAU;QACVC,YAAY;IACd,CAAA;AAEO,MAAM7B,oBAAoB;AAC1B,MAAMJ,oBAAoB,IAA2B,CAAA;QAC1DkC,YAAY;IACd,CAAA;AAEO,MAAMhC,6BAA6B;AACnC,MAAMN,8BAA8B,IAA6B,CAAA;QACtEuC,gCAAgC;QAChCC,0BAA0B;QAC1BC,iCAAiC;IACnC,CAAA;AAEO,MAAMtC,qBAAqB,IAAO,CAAA;QACvC,CAACI,kBAAkB,EAAEL;QACrB,CAACO,iBAAiB,EAAEJ;QACpB,CAACR,sBAAsB,EAAEE;QACzB,CAACO,2BAA2B,EAAEN;QAC9B,CAACF,mBAAmB,EAAEG;QACtB,CAACO,kBAAkB,EAAEJ;IACvB,CAAA"}
|
package/dist/container.js
CHANGED
|
@@ -43,12 +43,12 @@ const _multerservice = require("./services/core/multer.service");
|
|
|
43
43
|
const _fileuploadtrackercache = require("./state/file-upload-tracker.cache");
|
|
44
44
|
const _serverhost = require("./server.host");
|
|
45
45
|
const _boottask = require("./tasks/boot.task");
|
|
46
|
-
const _userservice = require("./services/
|
|
46
|
+
const _userservice = require("./services/mongoose/user.service");
|
|
47
47
|
const _userservice1 = require("./services/orm/user.service");
|
|
48
|
-
const _roleservice = require("./services/
|
|
48
|
+
const _roleservice = require("./services/mongoose/role.service");
|
|
49
49
|
const _roleservice1 = require("./services/orm/role.service");
|
|
50
50
|
const _tasks = require("./tasks");
|
|
51
|
-
const _permissionservice = require("./services/
|
|
51
|
+
const _permissionservice = require("./services/mongoose/permission.service");
|
|
52
52
|
const _permissionservice1 = require("./services/orm/permission.service");
|
|
53
53
|
const _printerfilecleantask = require("./tasks/printer-file-clean.task");
|
|
54
54
|
const _authorizationconstants = require("./constants/authorization.constants");
|
|
@@ -81,7 +81,7 @@ const _camerastreamservice = require("./services/mongoose/camera-stream.service"
|
|
|
81
81
|
const _camerastreamservice1 = require("./services/orm/camera-stream.service");
|
|
82
82
|
const _jwtservice = require("./services/authentication/jwt.service");
|
|
83
83
|
const _authservice = require("./services/authentication/auth.service");
|
|
84
|
-
const _refreshtokenservice = require("./services/
|
|
84
|
+
const _refreshtokenservice = require("./services/mongoose/refresh-token.service");
|
|
85
85
|
const _pluginthrottling = require("@octokit/plugin-throttling");
|
|
86
86
|
const _refreshtokenservice1 = require("./services/orm/refresh-token.service");
|
|
87
87
|
const _settingsservice1 = require("./services/orm/settings.service");
|
|
@@ -51,7 +51,7 @@ class AuthController {
|
|
|
51
51
|
const isDemoMode = this.configService.isDemoMode();
|
|
52
52
|
wizardState = {
|
|
53
53
|
...wizardState,
|
|
54
|
-
wizardCompleted: isDemoMode ?
|
|
54
|
+
wizardCompleted: isDemoMode ? true : wizardState.wizardCompleted
|
|
55
55
|
};
|
|
56
56
|
res.send({
|
|
57
57
|
loginRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/controllers/auth.controller.ts"],"names":["AuthController","authService","settingsStore","userService","roleService","logger","configService","constructor","loggerFactory","name","login","req","res","debug","ip","headers","tokens","loginUser","body","username","password","send","getLoginRequired","loginRequired","registration","isRegistrationEnabled","wizardState","getWizardState","isDemoMode","wizardCompleted","verifyLogin","success","needsPasswordChange","isLoginRequired","authenticated","isAuthenticated","user","refreshLogin","refreshToken","validateMiddleware","refreshTokenRules","idToken","renewLoginByRefreshToken","token","logout","end","jwtToken","authorization","replace","undefined","userId","id","logoutUserId","register","registrationEnabled","BadRequestException","registerUserRules","toLowerCase","includes","roles","getAppDefaultRoleIds","result","isDemoUser","isRootUser","isVerified","userDto","toDto","createController","prefix","AppConstants","apiRoute","post","demoUserNotAllowedInterceptor","get","before","authenticate"],"mappings":";;;;;;;;;;;IAiBaA,cAAc;eAAdA;;
|
|
1
|
+
{"version":3,"sources":["../../src/controllers/auth.controller.ts"],"names":["AuthController","authService","settingsStore","userService","roleService","logger","configService","constructor","loggerFactory","name","login","req","res","debug","ip","headers","tokens","loginUser","body","username","password","send","getLoginRequired","loginRequired","registration","isRegistrationEnabled","wizardState","getWizardState","isDemoMode","wizardCompleted","verifyLogin","success","needsPasswordChange","isLoginRequired","authenticated","isAuthenticated","user","refreshLogin","refreshToken","validateMiddleware","refreshTokenRules","idToken","renewLoginByRefreshToken","token","logout","end","jwtToken","authorization","replace","undefined","userId","id","logoutUserId","register","registrationEnabled","BadRequestException","registerUserRules","toLowerCase","includes","roles","getAppDefaultRoleIds","result","isDemoUser","isRootUser","isVerified","userDto","toDto","createController","prefix","AppConstants","apiRoute","post","demoUserNotAllowedInterceptor","get","before","authenticate"],"mappings":";;;;;;;;;;;IAiBaA,cAAc;eAAdA;;IA2Hb,OAYK;eAZL;;;+BA5IiC;mCACG;iCACP;4BACM;0CACD;0CACA;8BACL;gCAQiB;AAGvC,MAAMA;IACXC,YAA0B;IAC1BC,cAA6B;IAC7BC,YAA0B;IAC1BC,YAA0B;IAC1BC,OAAsB;IACtBC,cAA8B;IAE9BC,YAAY,EACVN,WAAW,EACXC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXI,aAAa,EACbF,aAAa,EAQd,CAAE;QACD,IAAI,CAACL,WAAW,GAAGA;QACnB,IAAI,CAACC,aAAa,GAAGA;QACrB,IAAI,CAACC,WAAW,GAAGA;QACnB,IAAI,CAACC,WAAW,GAAGA;QACnB,IAAI,CAACE,aAAa,GAAGA;QACrB,IAAI,CAACD,MAAM,GAAGG,cAAcR,eAAeS,IAAI;IACjD;IAEA,MAAMC,MAAMC,GAAY,EAAEC,GAAa,EAAE;QACvC,IAAI,CAACP,MAAM,CAACQ,KAAK,CAAC,CAAC,sBAAsB,EAAEF,IAAIG,EAAE,CAAC,gBAAgB,EAAEH,IAAII,OAAO,CAAC,aAAa,EAAE;QAC/F,MAAMC,SAAS,MAAM,IAAI,CAACf,WAAW,CAACgB,SAAS,CAACN,IAAIO,IAAI,CAACC,QAAQ,EAA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,CAACkD,QAAQ,CAAC;YAC7ClC;YACAC;YACAuC;YACA3B,qBAAqB;YACrB8B,YAAY;YACZC,YAAY;YAEZC,YAAY;QACd;QACA,MAAMC,UAAU,IAAI,CAAC9D,WAAW,CAAC+D,KAAK,CAACL;QACvCjD,IAAIS,IAAI,CAAC4C;IACX;AACF;MAEA,WAAeE,IAAAA,+BAAgB,EAACnE,gBAC7BoE,MAAM,CAACC,6BAAY,CAACC,QAAQ,GAAG,SAC/BC,IAAI,CAAC,aAAa,YAAYC,6CAA6B,EAC3DD,IAAI,CAAC,UAAU,SACfE,GAAG,CAAC,mBAAmB,oBACvBF,IAAI,CAAC,0BAA0B,uBAC/BA,IAAI,CAAC,YAAY,gBACjBA,IAAI,CAAC,WAAW,eAAe;IAC9BG,QAAQ;QAACC,IAAAA,0BAAY;KAAG;AAC1B,GACCJ,IAAI,CAAC,WAAW,UAAU;IACzBG,QAAQ;QAACC,IAAAA,0BAAY;KAAG;AAC1B"}
|
|
@@ -2,25 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
CameraStreamController: function() {
|
|
5
|
+
Object.defineProperty(exports, "CameraStreamController", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
13
8
|
return CameraStreamController;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
9
|
}
|
|
18
10
|
});
|
|
19
|
-
const
|
|
11
|
+
const _awilixroutercore = require("awilix-router-core");
|
|
20
12
|
const _serverconstants = require("../server.constants");
|
|
21
13
|
const _validators = require("../handlers/validators");
|
|
22
14
|
const _genericvalidation = require("./validation/generic.validation");
|
|
23
15
|
const _authenticate = require("../middleware/authenticate");
|
|
16
|
+
const _express = require("express");
|
|
17
|
+
const _authorizationconstants = require("../constants/authorization.constants");
|
|
18
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
}
|
|
24
|
+
function _ts_metadata(k, v) {
|
|
25
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
26
|
+
}
|
|
24
27
|
class CameraStreamController {
|
|
25
28
|
cameraStreamService;
|
|
26
29
|
isTypeormMode;
|
|
@@ -52,8 +55,69 @@ class CameraStreamController {
|
|
|
52
55
|
res.send();
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
|
|
56
|
-
(0,
|
|
57
|
-
|
|
58
|
+
_ts_decorate([
|
|
59
|
+
(0, _awilixroutercore.GET)(),
|
|
60
|
+
(0, _awilixroutercore.route)("/"),
|
|
61
|
+
_ts_metadata("design:type", Function),
|
|
62
|
+
_ts_metadata("design:paramtypes", [
|
|
63
|
+
typeof _express.Request === "undefined" ? Object : _express.Request,
|
|
64
|
+
typeof _express.Response === "undefined" ? Object : _express.Response
|
|
65
|
+
]),
|
|
66
|
+
_ts_metadata("design:returntype", Promise)
|
|
67
|
+
], CameraStreamController.prototype, "list", null);
|
|
68
|
+
_ts_decorate([
|
|
69
|
+
(0, _awilixroutercore.GET)(),
|
|
70
|
+
(0, _awilixroutercore.route)("/:id"),
|
|
71
|
+
_ts_metadata("design:type", Function),
|
|
72
|
+
_ts_metadata("design:paramtypes", [
|
|
73
|
+
typeof _express.Request === "undefined" ? Object : _express.Request,
|
|
74
|
+
typeof _express.Response === "undefined" ? Object : _express.Response
|
|
75
|
+
]),
|
|
76
|
+
_ts_metadata("design:returntype", Promise)
|
|
77
|
+
], CameraStreamController.prototype, "get", null);
|
|
78
|
+
_ts_decorate([
|
|
79
|
+
(0, _awilixroutercore.POST)(),
|
|
80
|
+
(0, _awilixroutercore.route)("/"),
|
|
81
|
+
_ts_metadata("design:type", Function),
|
|
82
|
+
_ts_metadata("design:paramtypes", [
|
|
83
|
+
typeof _express.Request === "undefined" ? Object : _express.Request,
|
|
84
|
+
typeof _express.Response === "undefined" ? Object : _express.Response
|
|
85
|
+
]),
|
|
86
|
+
_ts_metadata("design:returntype", Promise)
|
|
87
|
+
], CameraStreamController.prototype, "create", null);
|
|
88
|
+
_ts_decorate([
|
|
89
|
+
(0, _awilixroutercore.PUT)(),
|
|
90
|
+
(0, _awilixroutercore.route)("/:id"),
|
|
91
|
+
_ts_metadata("design:type", Function),
|
|
92
|
+
_ts_metadata("design:paramtypes", [
|
|
93
|
+
typeof _express.Request === "undefined" ? Object : _express.Request,
|
|
94
|
+
typeof _express.Response === "undefined" ? Object : _express.Response
|
|
95
|
+
]),
|
|
96
|
+
_ts_metadata("design:returntype", Promise)
|
|
97
|
+
], CameraStreamController.prototype, "update", null);
|
|
98
|
+
_ts_decorate([
|
|
99
|
+
(0, _awilixroutercore.DELETE)(),
|
|
100
|
+
(0, _awilixroutercore.route)("/:id"),
|
|
101
|
+
_ts_metadata("design:type", Function),
|
|
102
|
+
_ts_metadata("design:paramtypes", [
|
|
103
|
+
typeof _express.Request === "undefined" ? Object : _express.Request,
|
|
104
|
+
typeof _express.Response === "undefined" ? Object : _express.Response
|
|
105
|
+
]),
|
|
106
|
+
_ts_metadata("design:returntype", Promise)
|
|
107
|
+
], CameraStreamController.prototype, "delete", null);
|
|
108
|
+
CameraStreamController = _ts_decorate([
|
|
109
|
+
(0, _awilixroutercore.route)(`${_serverconstants.AppConstants.apiRoute}/camera-stream`),
|
|
110
|
+
(0, _awilixroutercore.before)([
|
|
111
|
+
(0, _authenticate.authenticate)(),
|
|
112
|
+
(0, _authenticate.authorizeRoles)([
|
|
113
|
+
_authorizationconstants.ROLES.OPERATOR,
|
|
114
|
+
_authorizationconstants.ROLES.ADMIN
|
|
115
|
+
])
|
|
116
|
+
]),
|
|
117
|
+
_ts_metadata("design:type", Function),
|
|
118
|
+
_ts_metadata("design:paramtypes", [
|
|
119
|
+
Object
|
|
120
|
+
])
|
|
121
|
+
], CameraStreamController);
|
|
58
122
|
|
|
59
123
|
//# sourceMappingURL=camera-stream.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/controllers/camera-stream.controller.ts"],"names":["CameraStreamController","cameraStreamService","isTypeormMode","constructor","list","req","res","result","send","map","item","toDto","get","id","validateInput","params","idRulesV2","create","body","update","delete","
|
|
1
|
+
{"version":3,"sources":["../../src/controllers/camera-stream.controller.ts"],"names":["CameraStreamController","cameraStreamService","isTypeormMode","constructor","list","req","res","result","send","map","item","toDto","get","id","validateInput","params","idRulesV2","create","body","update","delete","AppConstants","apiRoute","authenticate","authorizeRoles","ROLES","OPERATOR","ADMIN"],"mappings":";;;;+BAWaA;;;eAAAA;;;kCAXyC;iCACzB;4BACC;mCACJ;8BACmB;yBACX;wCAEZ;;;;;;;;;;AAIf,MAAMA;IACMC,oBAA0C;IAC1CC,cAAuB;IAExCC,YAAY,EAAEF,mBAAmB,EAAEC,aAAa,EAAyE,CAAE;QACzH,IAAI,CAACD,mBAAmB,GAAGA;QAC3B,IAAI,CAACC,aAAa,GAAGA;IACvB;IAEA,MAEME,KAAKC,GAAY,EAAEC,GAAa,EAAE;QACtC,MAAMC,SAAS,MAAM,IAAI,CAACN,mBAAmB,CAACG,IAAI;QAClDE,IAAIE,IAAI,CAACD,OAAOE,GAAG,CAAC,CAACC,OAAS,IAAI,CAACT,mBAAmB,CAACU,KAAK,CAACD;IAC/D;IAEA,MAEME,IAAIP,GAAY,EAAEC,GAAa,EA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YAAED,6BAAK,CAACE,KAAK;SAAC"}
|
|
@@ -22,7 +22,6 @@ const _serverconstants = require("../server.constants");
|
|
|
22
22
|
const _authorizationconstants = require("../constants/authorization.constants");
|
|
23
23
|
const _validators = require("../handlers/validators");
|
|
24
24
|
const _settingsservicevalidation = require("../services/validators/settings-service.validation");
|
|
25
|
-
const _ip = require("ip");
|
|
26
25
|
const _demomiddleware = require("../middleware/demo.middleware");
|
|
27
26
|
const _printerapiinterface = require("../services/printer-api.interface");
|
|
28
27
|
class SettingsController {
|
|
@@ -43,10 +42,8 @@ class SettingsController {
|
|
|
43
42
|
getSettings(req, res) {
|
|
44
43
|
let connection;
|
|
45
44
|
try {
|
|
46
|
-
const serverIp = (0, _ip.address)();
|
|
47
45
|
connection = {
|
|
48
46
|
clientIp: req.socket?.remoteAddress,
|
|
49
|
-
ip: serverIp,
|
|
50
47
|
version: this.serverVersion
|
|
51
48
|
};
|
|
52
49
|
} catch (e) {
|
|
@@ -84,22 +81,13 @@ class SettingsController {
|
|
|
84
81
|
const result = await this.settingsStore.setExperimentalClientSupport(enabled);
|
|
85
82
|
res.send(result);
|
|
86
83
|
}
|
|
87
|
-
async updateWhitelistSettings(req, res) {
|
|
88
|
-
const { whitelistEnabled, whitelistedIpAddresses } = await (0, _validators.validateInput)(req.body, _settingsservicevalidation.whitelistSettingUpdateRules);
|
|
89
|
-
if (!whitelistedIpAddresses.includes("127.0.0.1")) {
|
|
90
|
-
whitelistedIpAddresses.push("127.0.0.1");
|
|
91
|
-
}
|
|
92
|
-
await this.settingsStore.setWhitelist(whitelistEnabled, whitelistedIpAddresses);
|
|
93
|
-
res.send();
|
|
94
|
-
}
|
|
95
84
|
async updateFrontendSettings(req, res) {
|
|
96
85
|
const validatedInput = await (0, _validators.validateInput)(req.body, _settingsservicevalidation.frontendSettingsUpdateRules);
|
|
97
86
|
const result = await this.settingsStore.updateFrontendSettings(validatedInput);
|
|
98
87
|
res.send(result);
|
|
99
88
|
}
|
|
100
89
|
async updateServerSettings(req, res) {
|
|
101
|
-
const
|
|
102
|
-
const validatedInput = await (0, _validators.validateInput)(req.body, (0, _settingsservicevalidation.serverSettingsUpdateRules)(isWhitelistFeatureEnabled));
|
|
90
|
+
const validatedInput = await (0, _validators.validateInput)(req.body, _settingsservicevalidation.serverSettingsUpdateRules);
|
|
103
91
|
const result = await this.settingsStore.updateServerSettings(validatedInput);
|
|
104
92
|
res.send(result);
|
|
105
93
|
}
|
|
@@ -191,13 +179,6 @@ const _default = (0, _awilixexpress.createController)(SettingsController).prefix
|
|
|
191
179
|
]),
|
|
192
180
|
_demomiddleware.demoUserNotAllowed
|
|
193
181
|
]
|
|
194
|
-
}).put("/whitelist", "updateWhitelistSettings", {
|
|
195
|
-
before: [
|
|
196
|
-
(0, _authenticate.authorizeRoles)([
|
|
197
|
-
_authorizationconstants.ROLES.ADMIN
|
|
198
|
-
]),
|
|
199
|
-
_demomiddleware.demoUserNotAllowed
|
|
200
|
-
]
|
|
201
182
|
}).put("/frontend", "updateFrontendSettings", {
|
|
202
183
|
before: [
|
|
203
184
|
(0, _authenticate.authorizeRoles)([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/controllers/settings.controller.ts"],"names":["SettingsController","settingsStore","logger","printerCache","printerService","configService","serverVersion","constructor","loggerFactory","name","getSettings","req","res","connection","
|
|
1
|
+
{"version":3,"sources":["../../src/controllers/settings.controller.ts"],"names":["SettingsController","settingsStore","logger","printerCache","printerService","configService","serverVersion","constructor","loggerFactory","name","getSettings","req","res","connection","clientIp","socket","remoteAddress","version","e","warn","settings","send","getSettingsSensitive","updateSentryDiagnosticsEnabled","enabled","validateInput","body","sentryDiagnosticsEnabledRules","result","setSentryDiagnosticsEnabled","updateMoonrakerSupport","moonrakerSupportRules","setExperimentalMoonrakerSupport","printers","listCachedPrinters","klipperPrinters","filter","p","printerType","MoonrakerType","printer","updateEnabled","id","updateClientSupport","clientNextRules","setExperimentalClientSupport","updateFrontendSettings","validatedInput","frontendSettingsUpdateRules","updateServerSettings","serverSettingsUpdateRules","updateLoginRequiredSettings","loginRequired","setLoginRequired","updateRegistrationEnabledSettings","registrationEnabled","setRegistrationEnabled","updateCredentialSettings","credentialSettingPatchRules","updateFileCleanSettings","fileCleanSettingsUpdateRules","patchFileCleanSettings","updateTimeoutSettings","timeoutSettingsUpdateRules","createController","prefix","AppConstants","apiRoute","before","authenticate","get","authorizeRoles","ROLES","ADMIN","demoUserNotAllowed","patch","demoUserNotAllowedInterceptor","put"],"mappings":";;;;;;;;;;;IAyBaA,kBAAkB;eAAlBA;;IAwHb,OAc+G;eAd/G;;;+BAjJiC;8BACY;iCAChB;wCACP;4BACQ;2CAUvB;gCAK2D;qCAGpC;AAGvB,MAAMA;IACXC,cAA6B;IAC7BC,OAAsB;IACtBC,aAA2B;IAC3BC,eAAgC;IAChCC,cAA8B;IAC9BC,cAAsB;IAEtBC,YAAY,EACVN,aAAa,EACbE,YAAY,EACZC,cAAc,EACdE,aAAa,EACbE,aAAa,EACbH,aAAa,EAQd,CAAE;QACD,IAAI,CAACJ,aAAa,GAAGA;QACrB,IAAI,CAACC,MAAM,GAAGM,cAAcR,mBAAmBS,IAAI;QACnD,IAAI,CAACH,aAAa,GAAGA;QACrB,IAAI,CAACD,aAAa,GAAGA;QACrB,IAAI,CAACF,YAAY,GAAGA;QACpB,IAAI,CAACC,cAAc,GAAGA;IACxB;IAEAM,YAAYC,GAAY,EAAEC,GAAa,EAAE;QACvC,IAAIC;QACJ,IAAI;YACFA,aAAa;gBACXC,UAAUH,IAAII,MAAM,EAAEC;gBACtBC,SAAS,IAAI,CAACX,aAAa;YAC7B;QACF,EAAE,OAAOY,GAAG;YACV,IAAI,CAAChB,MAAM,CAACiB,IAAI,CAAC;QACnB;QACA,MAAMC,WAAW,IAAI,CAACnB,aAAa,CAACS,WAAW;QAC/CE,IAAIS,IAAI,CAAC;YAAE,GAAGD,QAAQ;YAAEP;QAAW;IACrC;IAEA,MAAMS,qBAAqBX,GAAY,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GACpHG,GAAG,CAAC,yBAAyB,qCAAqC;IAAET,QAAQ;QAACG,IAAAA,4BAAc,EAAC;YAACC,6BAAK,CAACC,KAAK;SAAC;QAAGC,kCAAkB;KAAC;AAAC,GAChIG,GAAG,CAAC,eAAe,4BAA4B;IAAET,QAAQ;QAACG,IAAAA,4BAAc,EAAC;YAACC,6BAAK,CAACC,KAAK;SAAC;QAAGC,kCAAkB;KAAC;AAAC,GAC7GG,GAAG,CAAC,eAAe,2BAA2B;IAAET,QAAQ;QAACG,IAAAA,4BAAc,EAAC;YAACC,6BAAK,CAACC,KAAK;SAAC;QAAGC,kCAAkB;KAAC;AAAC,GAC5GG,GAAG,CAAC,aAAa,0BAA0B;IAAET,QAAQ;QAACG,IAAAA,4BAAc,EAAC;YAACC,6BAAK,CAACC,KAAK;SAAC;KAAE;AAAC,GACrFI,GAAG,CAAC,YAAY,yBAAyB;IAAET,QAAQ;QAACG,IAAAA,4BAAc,EAAC;YAACC,6BAAK,CAACC,KAAK;SAAC;QAAGC,kCAAkB;KAAC;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/entities/settings.entity.ts"],"names":["Settings","serverSettingsKey","credentialSettingsKey","wizardSettingKey","printerFileCleanSettingKey","frontendSettingKey","timeoutSettingKey","BaseEntity","id","type","nullable"],"mappings":";;;;+BAYaA;;;eAAAA;;;yCALN;yBACgD;4BAC5B;;;;;;;;;;IAQzB,
|
|
1
|
+
{"version":3,"sources":["../../src/entities/settings.entity.ts"],"names":["Settings","serverSettingsKey","credentialSettingsKey","wizardSettingKey","printerFileCleanSettingKey","frontendSettingKey","timeoutSettingKey","BaseEntity","id","type","nullable"],"mappings":";;;;+BAYaA;;;eAAAA;;;yCALN;yBACgD;4BAC5B;;;;;;;;;;IAQzB,MAiBA,OAQA,OAOA,OAOA,OAOA;AA9CA,OAACC,0CAAiB;AAiBlB,QAACC,8CAAqB;AAQtB,QAACC,yCAAgB;AAOjB,QAACC,mDAA0B;AAO3B,QAACC,2CAAkB;AAOnB,QAACC,0CAAiB;AAnDb,MAAMN,iBAAiBO,sBAAU;IAEtCC,GAAY;IAGZ,CAAA,KAAmB,CAcjB;IAGF,CAAA,MAAuB,CAKrB;IAGF,CAAA,MAAkB,CAIhB;IAGF,CAAA,MAA4B,CAI1B;IAGF,CAAA,MAAoB,CAIlB;IAGF,CAAA,MAAmB,CAEjB;AACJ;;;;;;;QAlDYC,MAAM;QAAeC,UAAU;;;uBACzC;;;QAgBUD,MAAM;QAAeC,UAAU;;;uBACzC;;;QAOUD,MAAM;QAAeC,UAAU;;;uBACzC;;;QAMUD,MAAM;QAAeC,UAAU;;;uBACzC;;;QAMUD,MAAM;QAAeC,UAAU;;;uBACzC;;;QAMUD,MAAM;QAAeC,UAAU;;;uBACzC"}
|
|
@@ -12,18 +12,14 @@ _export(exports, {
|
|
|
12
12
|
interceptRoles: function() {
|
|
13
13
|
return interceptRoles;
|
|
14
14
|
},
|
|
15
|
-
validateWhitelistedIp: function() {
|
|
16
|
-
return validateWhitelistedIp;
|
|
17
|
-
},
|
|
18
15
|
validateWizardCompleted: function() {
|
|
19
16
|
return validateWizardCompleted;
|
|
20
17
|
}
|
|
21
18
|
});
|
|
22
19
|
const _awilixexpress = require("awilix-express");
|
|
23
|
-
const _serversettingsconstants = require("../constants/server-settings.constants");
|
|
24
20
|
const _runtimeexceptions = require("../exceptions/runtime.exceptions");
|
|
25
21
|
const validateWizardCompleted = (0, _awilixexpress.inject)(({ configService, settingsStore, loggerFactory })=>async (req, res, next)=>{
|
|
26
|
-
const logger = loggerFactory(
|
|
22
|
+
const logger = loggerFactory(validateWizardCompleted.name);
|
|
27
23
|
const isDemoMode = configService.isDemoMode();
|
|
28
24
|
if (isDemoMode || !!settingsStore.getWizardSettings()?.wizardCompleted) {
|
|
29
25
|
next();
|
|
@@ -43,26 +39,6 @@ const validateWizardCompleted = (0, _awilixexpress.inject)(({ configService, set
|
|
|
43
39
|
throw new _runtimeexceptions.ForbiddenError(`First-time-setup not completed, these api paths are enabled: ${allowedPaths.join(", ")}`);
|
|
44
40
|
}
|
|
45
41
|
});
|
|
46
|
-
const validateWhitelistedIp = (0, _awilixexpress.inject)(({ settingsStore, loggerFactory })=>async (req, res, next)=>{
|
|
47
|
-
const logger = loggerFactory(validateWhitelistedIp.name);
|
|
48
|
-
const serverSettings = settingsStore.getSettings();
|
|
49
|
-
if (!serverSettings && !settingsStore.getServerSettings() || !settingsStore.getServerSettings()?.whitelistEnabled) {
|
|
50
|
-
next();
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const whitelist = serverSettings[_serversettingsconstants.serverSettingsKey].whitelistedIpAddresses;
|
|
54
|
-
const ipAddress = req.socket.remoteAddress;
|
|
55
|
-
if (whitelist?.length && !whitelist.includes(ipAddress) && ipAddress !== "::ffff:127.0.0.1") {
|
|
56
|
-
const subnextMatched = whitelist.find((w)=>{
|
|
57
|
-
return ipAddress.startsWith(w);
|
|
58
|
-
});
|
|
59
|
-
if (!subnextMatched) {
|
|
60
|
-
logger.error("IP did not match whitelist filters", req.socket.remoteAddress);
|
|
61
|
-
throw new _runtimeexceptions.ForbiddenError("Bad IP: " + req.socket.remoteAddress);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
next();
|
|
65
|
-
});
|
|
66
42
|
const interceptRoles = (0, _awilixexpress.inject)(({ settingsStore, roleService, isTypeormMode })=>async (req, res, next)=>{
|
|
67
43
|
const serverSettings = await settingsStore.getSettings();
|
|
68
44
|
if (isTypeormMode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/middleware/global.middleware.ts"],"names":["interceptRoles","
|
|
1
|
+
{"version":3,"sources":["../../src/middleware/global.middleware.ts"],"names":["interceptRoles","validateWizardCompleted","inject","configService","settingsStore","loggerFactory","req","res","next","logger","name","isDemoMode","getWizardSettings","wizardCompleted","allowedPaths","includes","path","startsWith","error","ForbiddenError","join","roleService","isTypeormMode","serverSettings","getSettings","roles","user","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126,16 +126,6 @@ const SettingsSchema = new _mongoose.Schema({
|
|
|
126
126
|
default: false,
|
|
127
127
|
required: true
|
|
128
128
|
},
|
|
129
|
-
whitelistEnabled: {
|
|
130
|
-
type: Boolean,
|
|
131
|
-
default: false,
|
|
132
|
-
required: true
|
|
133
|
-
},
|
|
134
|
-
whitelistedIpAddresses: [
|
|
135
|
-
{
|
|
136
|
-
type: String
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
129
|
experimentalMoonrakerSupport: {
|
|
140
130
|
type: Boolean,
|
|
141
131
|
default: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/models/Settings.ts"],"names":["Settings","SettingsSchema","Schema","wizardSettingKey","wizardCompleted","type","Boolean","default","required","wizardCompletedAt","Date","wizardVersion","Number","printerFileCleanSettingKey","autoRemoveOldFilesBeforeUpload","autoRemoveOldFilesAtBoot","autoRemoveOldFilesCriteriumDays","credentialSettingsKey","jwtSecret","String","minlength","trim","jwtExpiresIn","refreshTokenAttempts","refreshTokenExpiry","createdAt","now","updatedAt","serverSettingsKey","sentryDiagnosticsEnabled","debugSettings","debugSocketIoEvents","debugSocketReconnect","debugSocketRetries","debugSocketSetup","debugSocketMessages","debugSocketIoBandwidth","loginRequired","registration","
|
|
1
|
+
{"version":3,"sources":["../../src/models/Settings.ts"],"names":["Settings","SettingsSchema","Schema","wizardSettingKey","wizardCompleted","type","Boolean","default","required","wizardCompletedAt","Date","wizardVersion","Number","printerFileCleanSettingKey","autoRemoveOldFilesBeforeUpload","autoRemoveOldFilesAtBoot","autoRemoveOldFilesCriteriumDays","credentialSettingsKey","jwtSecret","String","minlength","trim","jwtExpiresIn","refreshTokenAttempts","refreshTokenExpiry","createdAt","now","updatedAt","serverSettingsKey","sentryDiagnosticsEnabled","debugSettings","debugSocketIoEvents","debugSocketReconnect","debugSocketRetries","debugSocketSetup","debugSocketMessages","debugSocketIoBandwidth","loginRequired","registration","experimentalMoonrakerSupport","experimentalClientSupport","frontendSettingKey","gridCols","gridRows","largeTiles","timeoutSettingKey","apiTimeout","model"],"mappings":";;;;+BA6NaA;;;eAAAA;;;0BA7NiB;yCAQvB;AA4DP,MAAMC,iBAAiB,IAAIC,gBAAM,CAAY;IAC3C,CAACC,yCAAgB,CAAC,EAAE;QAClBC,iBAAiB;YACfC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAC,mBAAmB;YACjBJ,MAAMK;YACNH,SAAS;YACTC,UAAU;QACZ;QACAG,eAAe;YACbN,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACK,mDAA0B,CAAC,EAAE;QAC5BC,gCAAgC;YAC9BT,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAO,0BAA0B;YACxBV,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAQ,iCAAiC;YAC/BX,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACS,8CAAqB,CAAC,EAAE;QACvBZ,MAAM;YACJa,WAAW;gBACTb,MAAMc;gBACNC,WAAW;gBACXC,MAAM;gBACNb,UAAU;YACZ;YACAc,cAAc;gBACZjB,MAAMO;gBACNJ,UAAU;YACZ;YACAe,sBAAsB;gBACpBlB,MAAMO;gBACNJ,UAAU;YACZ;YACAgB,oBAAoB;gBAClBnB,MAAMO;gBACNJ,UAAU;YACZ;YACAiB,WAAW;gBACTpB,MAAMK;gBACNH,SAASG,KAAKgB,GAAG;gBACjBlB,UAAU;YACZ;YACAmB,WAAW;gBACTtB,MAAMK;gBACNH,SAASG,KAAKgB,GAAG;gBACjBlB,UAAU;YACZ;QACF;QACAA,UAAU;IACZ;IACA,CAACoB,0CAAiB,CAAC,EAAE;QACnBC,0BAA0B;YACxBxB,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAsB,eAAe;YACbC,qBAAqB;gBACnB1B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACAwB,sBAAsB;gBACpB3B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACAyB,oBAAoB;gBAClB5B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA0B,kBAAkB;gBAChB7B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA2B,qBAAqB;gBACnB9B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA4B,wBAAwB;gBACtB/B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;QACF;QACA6B,eAAe;YACbhC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACA8B,cAAc;YACZjC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACA+B,8BAA8B;YAC5BlC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAgC,2BAA2B;YACzBnC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACiC,2CAAkB,CAAC,EAAE;QACpBC,UAAU;YACRrC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;QACAmC,UAAU;YACRtC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;QACAoC,YAAY;YACVvC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACqC,0CAAiB,CAAC,EAAE;QACnBC,YAAY;YACVzC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;AACF;AAEO,MAAMR,WAAW+C,IAAAA,eAAK,EAAC,kBAAkB9C"}
|
package/dist/server.constants.js
CHANGED
|
@@ -27,7 +27,6 @@ const AppConstants = {
|
|
|
27
27
|
defaultMongoStringUnauthenticated: "mongodb://127.0.0.1:27017/fdm-monster",
|
|
28
28
|
apiRoute: "/api",
|
|
29
29
|
enableClientDistAutoUpdateKey: "ENABLE_CLIENT_DIST_AUTO_UPDATE",
|
|
30
|
-
ENABLE_EXPERIMENTAL_WHITELIST_SETTINGS: "ENABLE_EXPERIMENTAL_WHITELIST_SETTINGS",
|
|
31
30
|
OVERRIDE_LOGIN_REQUIRED: "OVERRIDE_LOGIN_REQUIRED",
|
|
32
31
|
OVERRIDE_REGISTRATION_ENABLED: "OVERRIDE_REGISTRATION_ENABLED",
|
|
33
32
|
DEFAULT_USERNAME_MINLEN: 3,
|
|
@@ -66,7 +65,7 @@ const AppConstants = {
|
|
|
66
65
|
githubUrl: "https://github.com/fdm-monster/fdm-monster",
|
|
67
66
|
orgName: "fdm-monster",
|
|
68
67
|
currentWizardVersion: 1,
|
|
69
|
-
defaultClientMinimum: "1.
|
|
68
|
+
defaultClientMinimum: "1.7.2",
|
|
70
69
|
influxUrl: "INFLUX_URL",
|
|
71
70
|
influxToken: "INFLUX_TOKEN",
|
|
72
71
|
influxOrg: "INFLUX_ORG",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.constants.ts"],"names":["AppConstants","NON_NPM_MODE_KEY","NODE_ENV_KEY","VERSION_KEY","SERVER_PORT_KEY","MONGO_KEY","DATABASE_PATH","DATABASE_FILE","pm2ServiceName","logAppName","defaultFileStorageFolder","defaultLogsFolder","defaultLogZipsFolder","defaultClientBundleStorage","defaultClientBundleZipsStorage","defaultServerPort","defaultMongoStringUnauthenticated","apiRoute","enableClientDistAutoUpdateKey","
|
|
1
|
+
{"version":3,"sources":["../src/server.constants.ts"],"names":["AppConstants","NON_NPM_MODE_KEY","NODE_ENV_KEY","VERSION_KEY","SERVER_PORT_KEY","MONGO_KEY","DATABASE_PATH","DATABASE_FILE","pm2ServiceName","logAppName","defaultFileStorageFolder","defaultLogsFolder","defaultLogZipsFolder","defaultClientBundleStorage","defaultClientBundleZipsStorage","defaultServerPort","defaultMongoStringUnauthenticated","apiRoute","enableClientDistAutoUpdateKey","OVERRIDE_LOGIN_REQUIRED","OVERRIDE_REGISTRATION_ENABLED","DEFAULT_USERNAME_MINLEN","DEFAULT_PASSWORD_MINLEN","OVERRIDE_JWT_SECRET","OVERRIDE_JWT_EXPIRES_IN","DEFAULT_JWT_EXPIRES_IN","DEFAULT_REFRESH_TOKEN_ATTEMPTS","DEFAULT_REFRESH_TOKEN_EXPIRY","OVERRIDE_JWT_ISSUER","DEFAULT_JWT_ISSUER","OVERRIDE_JWT_AUDIENCE","DEFAULT_JWT_AUDIENCE","OVERRIDE_IS_DEMO_MODE","OVERRIDE_DEMO_USERNAME","DEFAULT_DEMO_USERNAME","OVERRIDE_DEMO_PASSWORD","DEFAULT_DEMO_PASSWORD","OVERRIDE_DEMO_ROLE","DEFAULT_DEMO_ROLE","defaultDevelopmentEnv","defaultTestEnv","defaultProductionEnv","knownEnvNames","GITHUB_PAT","serverPackageName","serverRepoName","clientPackageName","clientRepoName","clientNextPackageName","clientNextRepoName","githubUrl","orgName","currentWizardVersion","defaultClientMinimum","influxUrl","influxToken","influxOrg","influxBucket","defaultWebsocketHandshakeTimeout","defaultSocketThrottleRate","debugSocketStatesKey","defaultDebugSocketStates","debugFileWritePrinterStatesKey","defaultDebugFileWritePrinterStates","enableMqttAutoDiscoveryToken","enableMqttAutoDiscoveryDefault","mqttUrlToken","mqttPortToken","mqttPortDefault","mqttUsernameToken","mqttPasswordToken","monsterPiFilePath","sentryCustomDsnToken","sentryCustomDsnDefault","debugRoutesKey","ENABLE_EXPERIMENTAL_TYPEORM","enableExperimentalTypeormDefault"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,eAAe;IAC1BC,kBAAkB;IAClBC,cAAc;IACdC,aAAa;IACbC,iBAAiB;IACjBC,WAAW;IACXC,eAAe;IACfC,eAAe;IAEfC,gBAAgB;IAChBC,YAAY;IAGZC,0BAA0B;IAC1BC,mBAAmB;IACnBC,sBAAsB;IAEtBC,4BAA4B;IAC5BC,gCAAgC;IAChCC,mBAAmB;IACnBC,mCAAmC;IACnCC,UAAU;IACVC,+BAA+B;IAG/BC,yBAAyB;IAEzBC,+BAA+B;IAE/BC,yBAAyB;IAEzBC,yBAAyB;IAEzBC,qBAAqB;IAErBC,yBAAyB;IACzBC,wBAAwB,KAAK;IAE7BC,gCAAgC,CAAC;IAEjCC,8BAA8B,KAAK,KAAK,KAAK;IAE7CC,qBAAqB;IACrBC,oBAAoB;IAEpBC,uBAAuB;IACvBC,sBAAsB;IAEtBC,uBAAuB;IACvBC,wBAAwB;IACxBC,uBAAuB;IACvBC,wBAAwB;IACxBC,uBAAuB;IACvBC,oBAAoB;IACpBC,mBAAmB;IAEnBC,uBAAuB;IACvBC,gBAAgB;IAChBC,sBAAsB;IACtBC,eAAe;QAAC;QAAe;QAAc;KAAO;IACpDC,YAAY;IACZC,mBAAmB;IACnBC,gBAAgB;IAChBC,mBAAmB;IACnBC,gBAAgB;IAChBC,uBAAuB;IACvBC,oBAAoB;IACpBC,WAAW;IACXC,SAAS;IAETC,sBAAsB;IACtBC,sBAAsB;IAEtBC,WAAW;IACXC,aAAa;IACbC,WAAW;IACXC,cAAc;IAGdC,kCAAkC;IAClCC,2BAA2B;IAC3BC,sBAAsB;IACtBC,0BAA0B;IAC1BC,gCAAgC;IAChCC,oCAAoC;IAGpCC,8BAA8B;IAC9BC,gCAAgC;IAChCC,cAAc;IACdC,eAAe;IACfC,iBAAiB;IACjBC,mBAAmB;IACnBC,mBAAmB;IAGnBC,mBAAmB;IAGnBC,sBAAsB;IACtBC,wBAAwB;IAExBC,gBAAgB;IAEhBC,6BAA6B;IAC7BC,kCAAkC;AACpC"}
|
package/dist/server.core.js
CHANGED
|
@@ -91,7 +91,7 @@ async function setupServer() {
|
|
|
91
91
|
"anonymous"
|
|
92
92
|
], {
|
|
93
93
|
session: false
|
|
94
|
-
})).use((0, _awilixexpress.scopePerRequest)(container)).use(_database.interceptDatabaseError).use(_globalmiddleware.
|
|
94
|
+
})).use((0, _awilixexpress.scopePerRequest)(container)).use(_database.interceptDatabaseError).use(_globalmiddleware.validateWizardCompleted).use(_globalmiddleware.interceptRoles);
|
|
95
95
|
return {
|
|
96
96
|
httpServer,
|
|
97
97
|
container
|
package/dist/server.core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.core.ts"],"names":["setupServer","httpServer","express","experimentalTypeormEnabled","getEnvOrDefault","AppConstants","ENABLE_EXPERIMENTAL_TYPEORM","enableExperimentalTypeormDefault","dbFolder","process","env","DATABASE_PATH","ensureDirExists","join","superRootPath","container","configureContainer","initializePassportStrategies","passport","use","cors","origin","methods","helmet","contentSecurityPolicy","json","limit","cookieParser","urlencoded","extended","initialize","authenticate","session","scopePerRequest","interceptDatabaseError","
|
|
1
|
+
{"version":3,"sources":["../src/server.core.ts"],"names":["setupServer","httpServer","express","experimentalTypeormEnabled","getEnvOrDefault","AppConstants","ENABLE_EXPERIMENTAL_TYPEORM","enableExperimentalTypeormDefault","dbFolder","process","env","DATABASE_PATH","ensureDirExists","join","superRootPath","container","configureContainer","initializePassportStrategies","passport","use","cors","origin","methods","helmet","contentSecurityPolicy","json","limit","cookieParser","urlencoded","extended","initialize","authenticate","session","scopePerRequest","interceptDatabaseError","validateWizardCompleted","interceptRoles"],"mappings":";;;;+BAesBA;;;eAAAA;;;iEAfoB;qEACjB;iEACJ;6DACJ;+DACE;+BACa;2BACG;0BACI;kCACiB;2BACX;iCAChB;sBACR;yBAC0B;0BACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,eAAeA;IACpB,MAAMC,aAAaC,IAAAA,gBAAO;IAC1B,MAAMC,6BACJC,IAAAA,yBAAe,EAACC,6BAAY,CAACC,2BAA2B,EAAED,6BAAY,CAACE,gCAAgC,MAAM;IAC/G,IAAIJ,4BAA4B;QAC9B,MAAMK,WAAWC,QAAQC,GAAG,CAACL,6BAAY,CAACM,aAAa,CAAC,IAAI;QAC5DC,IAAAA,wBAAe,EAACC,IAAAA,UAAI,EAACC,IAAAA,sBAAa,KAAIN;IACxC;IAEA,MAAMO,YAAYC,IAAAA,6BAAkB,EAACb;IACrCc,IAAAA,uCAA4B,EAACC,iBAAQ,EAAEH;IAEvCd,WACGkB,GAAG,CACFC,IAAAA,aAAI,EAAC;QACHC,QAAQ;QACRC,SAAS;IACX,IAEDH,GAAG,CACFI,IAAAA,eAAM,EAAC;QACLC,uBAAuB;IACzB,IAEDL,GAAG,CAACM,IAAAA,aAAI,EAAC;QAAEC,OAAO;IAAO,IACzBP,GAAG,CAACQ,IAAAA,qBAAY,KAChBR,GAAG,CAACS,IAAAA,mBAAU,EAAC;QAAEC,UAAU;IAAM,IACjCV,GAAG,CAACD,iBAAQ,CAACY,UAAU,IACvBX,GAAG,CAACD,iBAAQ,CAACa,YAAY,CAAC;QAAC;QAAO;KAAY,EAAE;QAAEC,SAAS;IAAM,IACjEb,GAAG,CAACc,IAAAA,8BAAe,EAAClB,YACpBI,GAAG,CAACe,gCAAsB,EAE1Bf,GAAG,CAACgB,yCAAuB,EAC3BhB,GAAG,CAACiB,gCAAc;IAErB,OAAO;QACLnC;QACAc;IACF;AACF"}
|
|
@@ -2,25 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
IpWhitelistSettingsDto: function() {
|
|
13
|
-
return IpWhitelistSettingsDto;
|
|
14
|
-
},
|
|
15
|
-
SettingsDto: function() {
|
|
5
|
+
Object.defineProperty(exports, "SettingsDto", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
16
8
|
return SettingsDto;
|
|
17
9
|
}
|
|
18
10
|
});
|
|
19
11
|
const _serversettingsconstants = require("../../constants/server-settings.constants");
|
|
20
|
-
class IpWhitelistSettingsDto {
|
|
21
|
-
whitelistedIpAddresses;
|
|
22
|
-
whitelistEnabled;
|
|
23
|
-
}
|
|
24
12
|
class SettingsDto {
|
|
25
13
|
[_serversettingsconstants.serverSettingsKey];
|
|
26
14
|
[_serversettingsconstants.wizardSettingKey];
|