not-node 6.1.3 → 6.1.4
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/bin/not-cli.mjs +3 -3
- package/package.json +1 -1
- package/playground/.babelrc +11 -0
- package/playground/.eslintignore +4 -0
- package/playground/.eslintrc.json +23 -0
- package/playground/app/front/build/admin.css +2 -0
- package/playground/app/front/build/admin.js +52419 -0
- package/playground/app/front/build/client.css +2 -0
- package/playground/app/front/build/client.js +52419 -0
- package/playground/app/front/build/guest.css +2 -0
- package/playground/app/front/build/guest.js +50915 -0
- package/playground/app/front/build/root.css +2 -0
- package/playground/app/front/build/root.js +60015 -0
- package/playground/app/front/build/user.css +2 -0
- package/playground/app/front/build/user.js +52417 -0
- package/playground/app/front/build.env.js +15 -0
- package/playground/app/front/index.!.js +64 -0
- package/playground/app/front/index.admin.js +160 -0
- package/playground/app/front/index.client.js +160 -0
- package/playground/app/front/index.guest.js +160 -0
- package/playground/app/front/index.root.js +224 -0
- package/playground/app/front/index.user.js +160 -0
- package/playground/app/front/rollup.!.js +70 -0
- package/playground/app/front/rollup.admin.js +70 -0
- package/playground/app/front/rollup.client.js +70 -0
- package/playground/app/front/rollup.guest.js +70 -0
- package/playground/app/front/rollup.root.js +70 -0
- package/playground/app/front/rollup.user.js +70 -0
- package/playground/app/front/src/admin/main/index.js +34 -0
- package/playground/app/front/src/client/main/index.js +34 -0
- package/playground/app/front/src/common/index.js +40 -0
- package/playground/app/front/src/common/ncInit.js +18 -0
- package/playground/app/front/src/common/ws.client.main.js +34 -0
- package/playground/app/front/src/guest/main/index.js +45 -0
- package/playground/app/front/src/root/main/index.js +34 -0
- package/playground/app/front/src/user/main/index.js +34 -0
- package/playground/app/server/app.js +25 -0
- package/playground/app/server/config/common.json +106 -0
- package/playground/app/server/config/development.json +34 -0
- package/playground/app/server/config/production.json +34 -0
- package/playground/app/server/config/stage.json +34 -0
- package/playground/app/server/index.js +20 -0
- package/playground/app/server/routes/index.js +34 -0
- package/playground/app/server/routes/site.js +71 -0
- package/playground/app/server/views/admin/foot.pug +1 -0
- package/playground/app/server/views/admin/head.pug +7 -0
- package/playground/app/server/views/admin/menu.pug +2 -0
- package/playground/app/server/views/admin.pug +19 -0
- package/playground/app/server/views/dashboard.pug +20 -0
- package/playground/app/server/views/index.pug +15 -0
- package/playground/app/server/views/parts/header.android.pug +6 -0
- package/playground/app/server/views/parts/header.ios.pug +5 -0
- package/playground/app/server/views/parts/header.pug +18 -0
- package/playground/app/server/views/parts/menu.pug +1 -0
- package/playground/app/server/views/parts/overview.pug +2 -0
- package/playground/app/server/ws/auth.js +41 -0
- package/playground/app/server/ws/index.js +84 -0
- package/playground/bin/build.sh +8 -0
- package/playground/package.json +85 -0
- package/playground/project.manifest.json +37 -0
- package/src/cli/readers/ws.mjs +12 -0
- package/src/cli/renderers/controllers.mjs +1 -0
- package/tmpl/dirs/module.front.mjs +1 -1
- package/tmpl/files/module.front/common/index.ejs +7 -6
- package/tmpl/files/module.front/common/ws.client.main.ejs +2 -3
- package/tmpl/files/module.front/role/index.ejs +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Rollup plugins
|
|
2
|
+
import babel from "@rollup/plugin-babel";
|
|
3
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
4
|
+
import svelte from "rollup-plugin-svelte";
|
|
5
|
+
import resolve from "@rollup/plugin-node-resolve";
|
|
6
|
+
import filesize from "rollup-plugin-filesize";
|
|
7
|
+
import sizes from "rollup-plugin-sizes";
|
|
8
|
+
import postcss from "rollup-plugin-postcss";
|
|
9
|
+
import json from "@rollup/plugin-json";
|
|
10
|
+
|
|
11
|
+
import { babelOn } from "./build.env.js";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
input: "/var/server/nn/playground/app/front/index.root.js",
|
|
15
|
+
output: {
|
|
16
|
+
file: "/var/server/nn/playground/app/front/build/root.js",
|
|
17
|
+
name: "notNodeApplication",
|
|
18
|
+
format: "iife",
|
|
19
|
+
sourcemap:
|
|
20
|
+
false && (process.env.NODE_ENV === "production" ? false : "inline"),
|
|
21
|
+
},
|
|
22
|
+
plugins: [
|
|
23
|
+
json(),
|
|
24
|
+
svelte({
|
|
25
|
+
emitCss: true,
|
|
26
|
+
}),
|
|
27
|
+
resolve({
|
|
28
|
+
browser: true,
|
|
29
|
+
preferBuiltins: true,
|
|
30
|
+
dedupe: (importee) =>
|
|
31
|
+
importee === "svelte" || importee.startsWith("svelte/"),
|
|
32
|
+
}),
|
|
33
|
+
commonjs({}),
|
|
34
|
+
postcss({
|
|
35
|
+
extract: true,
|
|
36
|
+
minimize: true,
|
|
37
|
+
use: [
|
|
38
|
+
[
|
|
39
|
+
"sass",
|
|
40
|
+
{
|
|
41
|
+
includePaths: ["./src/styles/theme", "./node_modules"],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
babelOn() &&
|
|
47
|
+
babel({
|
|
48
|
+
presets: [
|
|
49
|
+
[
|
|
50
|
+
"@babel/preset-env",
|
|
51
|
+
{
|
|
52
|
+
corejs: 3,
|
|
53
|
+
modules: false,
|
|
54
|
+
useBuiltIns: "usage",
|
|
55
|
+
targets: "> 2.5%, not dead",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
],
|
|
59
|
+
babelHelpers: "bundled",
|
|
60
|
+
plugins: [
|
|
61
|
+
"@babel/plugin-proposal-class-properties",
|
|
62
|
+
"@babel/plugin-proposal-private-methods",
|
|
63
|
+
"@babel/transform-arrow-functions",
|
|
64
|
+
],
|
|
65
|
+
exclude: ["node_modules/**", "build/**"],
|
|
66
|
+
}),
|
|
67
|
+
sizes(),
|
|
68
|
+
filesize(),
|
|
69
|
+
],
|
|
70
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Rollup plugins
|
|
2
|
+
import babel from "@rollup/plugin-babel";
|
|
3
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
4
|
+
import svelte from "rollup-plugin-svelte";
|
|
5
|
+
import resolve from "@rollup/plugin-node-resolve";
|
|
6
|
+
import filesize from "rollup-plugin-filesize";
|
|
7
|
+
import sizes from "rollup-plugin-sizes";
|
|
8
|
+
import postcss from "rollup-plugin-postcss";
|
|
9
|
+
import json from "@rollup/plugin-json";
|
|
10
|
+
|
|
11
|
+
import { babelOn } from "./build.env.js";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
input: "/var/server/nn/playground/app/front/index.user.js",
|
|
15
|
+
output: {
|
|
16
|
+
file: "/var/server/nn/playground/app/front/build/user.js",
|
|
17
|
+
name: "notNodeApplication",
|
|
18
|
+
format: "iife",
|
|
19
|
+
sourcemap:
|
|
20
|
+
false && (process.env.NODE_ENV === "production" ? false : "inline"),
|
|
21
|
+
},
|
|
22
|
+
plugins: [
|
|
23
|
+
json(),
|
|
24
|
+
svelte({
|
|
25
|
+
emitCss: true,
|
|
26
|
+
}),
|
|
27
|
+
resolve({
|
|
28
|
+
browser: true,
|
|
29
|
+
preferBuiltins: true,
|
|
30
|
+
dedupe: (importee) =>
|
|
31
|
+
importee === "svelte" || importee.startsWith("svelte/"),
|
|
32
|
+
}),
|
|
33
|
+
commonjs({}),
|
|
34
|
+
postcss({
|
|
35
|
+
extract: true,
|
|
36
|
+
minimize: true,
|
|
37
|
+
use: [
|
|
38
|
+
[
|
|
39
|
+
"sass",
|
|
40
|
+
{
|
|
41
|
+
includePaths: ["./src/styles/theme", "./node_modules"],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
babelOn() &&
|
|
47
|
+
babel({
|
|
48
|
+
presets: [
|
|
49
|
+
[
|
|
50
|
+
"@babel/preset-env",
|
|
51
|
+
{
|
|
52
|
+
corejs: 3,
|
|
53
|
+
modules: false,
|
|
54
|
+
useBuiltIns: "usage",
|
|
55
|
+
targets: "> 2.5%, not dead",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
],
|
|
59
|
+
babelHelpers: "bundled",
|
|
60
|
+
plugins: [
|
|
61
|
+
"@babel/plugin-proposal-class-properties",
|
|
62
|
+
"@babel/plugin-proposal-private-methods",
|
|
63
|
+
"@babel/transform-arrow-functions",
|
|
64
|
+
],
|
|
65
|
+
exclude: ["node_modules/**", "build/**"],
|
|
66
|
+
}),
|
|
67
|
+
sizes(),
|
|
68
|
+
filesize(),
|
|
69
|
+
],
|
|
70
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import ncInit from "../../common/ncInit";
|
|
2
|
+
|
|
3
|
+
let manifest = {
|
|
4
|
+
environment: "admin",
|
|
5
|
+
router: {
|
|
6
|
+
root: "/dashboard",
|
|
7
|
+
manifest: [],
|
|
8
|
+
},
|
|
9
|
+
crud: {
|
|
10
|
+
containerSelector: ".main-container",
|
|
11
|
+
},
|
|
12
|
+
modules: {
|
|
13
|
+
user: {},
|
|
14
|
+
},
|
|
15
|
+
brand: {
|
|
16
|
+
icon: {
|
|
17
|
+
src: "/img/icons/icon-w-64.png",
|
|
18
|
+
width: 48,
|
|
19
|
+
height: 28,
|
|
20
|
+
},
|
|
21
|
+
url: "/",
|
|
22
|
+
},
|
|
23
|
+
menu: {
|
|
24
|
+
side: {
|
|
25
|
+
sections: [],
|
|
26
|
+
},
|
|
27
|
+
top: {
|
|
28
|
+
sections: [],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
initController: ncInit,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { ncInit, manifest };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import ncInit from "../../common/ncInit";
|
|
2
|
+
|
|
3
|
+
let manifest = {
|
|
4
|
+
environment: "client",
|
|
5
|
+
router: {
|
|
6
|
+
root: "/dashboard",
|
|
7
|
+
manifest: [],
|
|
8
|
+
},
|
|
9
|
+
crud: {
|
|
10
|
+
containerSelector: ".main-container",
|
|
11
|
+
},
|
|
12
|
+
modules: {
|
|
13
|
+
user: {},
|
|
14
|
+
},
|
|
15
|
+
brand: {
|
|
16
|
+
icon: {
|
|
17
|
+
src: "/img/icons/icon-w-64.png",
|
|
18
|
+
width: 48,
|
|
19
|
+
height: 28,
|
|
20
|
+
},
|
|
21
|
+
url: "/",
|
|
22
|
+
},
|
|
23
|
+
menu: {
|
|
24
|
+
side: {
|
|
25
|
+
sections: [],
|
|
26
|
+
},
|
|
27
|
+
top: {
|
|
28
|
+
sections: [],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
initController: ncInit,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { ncInit, manifest };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
import main from './ws.client.main.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
let manifest = {
|
|
6
|
+
brand: {
|
|
7
|
+
icon: {
|
|
8
|
+
src: '/img/icons/icon-w-64.png',
|
|
9
|
+
width: 48,
|
|
10
|
+
height: 28
|
|
11
|
+
},
|
|
12
|
+
title: 'notNodeApplication',
|
|
13
|
+
url: '/'
|
|
14
|
+
},
|
|
15
|
+
modules:{
|
|
16
|
+
|
|
17
|
+
ws:{
|
|
18
|
+
clients:{
|
|
19
|
+
//options for ws client here
|
|
20
|
+
main: {
|
|
21
|
+
host: '' || window.location.hostname,
|
|
22
|
+
port: 3030,
|
|
23
|
+
path: 'websocket',
|
|
24
|
+
secure: true,
|
|
25
|
+
ssl: false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const wsc = {
|
|
34
|
+
main
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
manifest,
|
|
39
|
+
wsc
|
|
40
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Frame } from 'not-bulma';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
notSideMenu, notTopMenu,
|
|
5
|
+
notController} = Frame;
|
|
6
|
+
|
|
7
|
+
class ncInit extends notController {
|
|
8
|
+
constructor(app) {
|
|
9
|
+
super(app);
|
|
10
|
+
this.setModuleName('init');
|
|
11
|
+
this.log('init app');
|
|
12
|
+
notSideMenu.render(app);
|
|
13
|
+
notTopMenu.render(app);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default ncInit;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {notCommon} from 'not-bulma';
|
|
2
|
+
const logger = notCommon.createLogger(`WSClient(main)`);
|
|
3
|
+
|
|
4
|
+
const main = {
|
|
5
|
+
logger: logger,
|
|
6
|
+
getToken: () => {
|
|
7
|
+
return notCommon.getApp().getModel('user', {}).$token({})
|
|
8
|
+
.then((res) => {
|
|
9
|
+
notCommon.getApp().setWorking('token', res.result);
|
|
10
|
+
return res.result;
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
messenger: {
|
|
14
|
+
validateTypeAndName: false,
|
|
15
|
+
secure: false,//not secure, bc its not issuing tokens and has no secret key
|
|
16
|
+
types: {
|
|
17
|
+
'__service': ['updateToken'],
|
|
18
|
+
'request': [],
|
|
19
|
+
'response': [],
|
|
20
|
+
'event': []
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
router:{
|
|
24
|
+
routes:{
|
|
25
|
+
event: {
|
|
26
|
+
notification(){
|
|
27
|
+
console.log(...arguments);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default main;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import ncInit from "../../common/ncInit";
|
|
2
|
+
|
|
3
|
+
let manifest = {
|
|
4
|
+
environment: "guest",
|
|
5
|
+
router: {
|
|
6
|
+
manifest: [],
|
|
7
|
+
},
|
|
8
|
+
crud: {
|
|
9
|
+
containerSelector: ".main-container",
|
|
10
|
+
},
|
|
11
|
+
modules: {
|
|
12
|
+
user: {
|
|
13
|
+
loginFormContainerSelector: ".main-container",
|
|
14
|
+
registerFormContainerSelector: ".main-container",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
initController: ncInit,
|
|
18
|
+
menu: {
|
|
19
|
+
top: {
|
|
20
|
+
toggleSelector: ".navbar-burger",
|
|
21
|
+
sections: [],
|
|
22
|
+
items: [
|
|
23
|
+
{
|
|
24
|
+
title: "Вход",
|
|
25
|
+
url: "/login",
|
|
26
|
+
priority: 10,
|
|
27
|
+
showOnTouch: true,
|
|
28
|
+
type: "button",
|
|
29
|
+
place: "start",
|
|
30
|
+
} , {
|
|
31
|
+
id: 'register',
|
|
32
|
+
title: 'Регистрация',
|
|
33
|
+
url: '/register',
|
|
34
|
+
type: 'button',
|
|
35
|
+
priority: 11,
|
|
36
|
+
showOnTouch:true,
|
|
37
|
+
place: 'start'
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export { ncInit, manifest };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import ncInit from "../../common/ncInit";
|
|
2
|
+
|
|
3
|
+
let manifest = {
|
|
4
|
+
environment: "root",
|
|
5
|
+
router: {
|
|
6
|
+
root: "/dashboard",
|
|
7
|
+
manifest: [],
|
|
8
|
+
},
|
|
9
|
+
crud: {
|
|
10
|
+
containerSelector: ".main-container",
|
|
11
|
+
},
|
|
12
|
+
modules: {
|
|
13
|
+
user: {},
|
|
14
|
+
},
|
|
15
|
+
brand: {
|
|
16
|
+
icon: {
|
|
17
|
+
src: "/img/icons/icon-w-64.png",
|
|
18
|
+
width: 48,
|
|
19
|
+
height: 28,
|
|
20
|
+
},
|
|
21
|
+
url: "/",
|
|
22
|
+
},
|
|
23
|
+
menu: {
|
|
24
|
+
side: {
|
|
25
|
+
sections: [],
|
|
26
|
+
},
|
|
27
|
+
top: {
|
|
28
|
+
sections: [],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
initController: ncInit,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { ncInit, manifest };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import ncInit from "../../common/ncInit";
|
|
2
|
+
|
|
3
|
+
let manifest = {
|
|
4
|
+
environment: "user",
|
|
5
|
+
router: {
|
|
6
|
+
root: "/dashboard",
|
|
7
|
+
manifest: [],
|
|
8
|
+
},
|
|
9
|
+
crud: {
|
|
10
|
+
containerSelector: ".main-container",
|
|
11
|
+
},
|
|
12
|
+
modules: {
|
|
13
|
+
user: {},
|
|
14
|
+
},
|
|
15
|
+
brand: {
|
|
16
|
+
icon: {
|
|
17
|
+
src: "/img/icons/icon-w-64.png",
|
|
18
|
+
width: 48,
|
|
19
|
+
height: 28,
|
|
20
|
+
},
|
|
21
|
+
url: "/",
|
|
22
|
+
},
|
|
23
|
+
menu: {
|
|
24
|
+
side: {
|
|
25
|
+
sections: [],
|
|
26
|
+
},
|
|
27
|
+
top: {
|
|
28
|
+
sections: [],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
initController: ncInit,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { ncInit, manifest };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const notNode = require("not-node");
|
|
2
|
+
|
|
3
|
+
const InitIdentityTokens = require("not-user").InitIdentityTokens;
|
|
4
|
+
|
|
5
|
+
const Init = require("not-node").Init,
|
|
6
|
+
path = require("path"),
|
|
7
|
+
manifest = require("./../../project.manifest.json");
|
|
8
|
+
|
|
9
|
+
module.exports = () => {
|
|
10
|
+
const options = {
|
|
11
|
+
pathToApp: path.join(__dirname),
|
|
12
|
+
pathToNPM: path.join(__dirname, "../../node_modules"),
|
|
13
|
+
routesPath: path.join(__dirname, "./routes"),
|
|
14
|
+
indexRoute: require("./routes/site.js").index,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const additional = {
|
|
18
|
+
pre({ initSequence }) {
|
|
19
|
+
initSequence.remove("InitMonitoring");
|
|
20
|
+
initSequence.insert(InitIdentityTokens);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
Init.run({ options, manifest, additional });
|
|
25
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"port": 3000,
|
|
3
|
+
"host": "localhost",
|
|
4
|
+
"cors": [""],
|
|
5
|
+
"template": {
|
|
6
|
+
"engine": "pug",
|
|
7
|
+
"views": "views",
|
|
8
|
+
"partialsDir": "partials",
|
|
9
|
+
"partials": {}
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
"db": {
|
|
13
|
+
|
|
14
|
+
"mongoose": {
|
|
15
|
+
"uri": "mongodb:///test?authSource=admin",
|
|
16
|
+
"options": {
|
|
17
|
+
"useNewUrlParser": true,
|
|
18
|
+
"useUnifiedTopology": true,
|
|
19
|
+
"db": "test",
|
|
20
|
+
"host": "",
|
|
21
|
+
"user": "tester",
|
|
22
|
+
"pass": "test",
|
|
23
|
+
"autoIndex": false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
"redis": {},
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
"ioredis": {
|
|
32
|
+
"enableOfflineQueue": false
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
"session": {
|
|
39
|
+
"driver": "redis",
|
|
40
|
+
"secret": "mlI1kwtmLRmcScfro2ftMkkifJIzlJBQ2FvITbKM",
|
|
41
|
+
"cookie": {
|
|
42
|
+
"maxAge": 2628000000
|
|
43
|
+
},
|
|
44
|
+
"key": "SessionID"
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
"path": {
|
|
49
|
+
"static": "../static",
|
|
50
|
+
"app": "/client",
|
|
51
|
+
"dbDumps": "../../../db.dumps",
|
|
52
|
+
"front": "../front/build",
|
|
53
|
+
"ws": "./ws"
|
|
54
|
+
},
|
|
55
|
+
"defaultUserRole": "user",
|
|
56
|
+
"modules": {
|
|
57
|
+
|
|
58
|
+
"ws": {
|
|
59
|
+
"servers": {
|
|
60
|
+
"main": {
|
|
61
|
+
"connection": {
|
|
62
|
+
"port": 3030,
|
|
63
|
+
"secure": true,
|
|
64
|
+
"secret": "zZswkyHax9xzb3hMn6fsxJkJnK2dFF02gpKTnQwh"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
"user": {
|
|
72
|
+
"errors":{
|
|
73
|
+
"noUserData": false,
|
|
74
|
+
"noUserWithId": false
|
|
75
|
+
},
|
|
76
|
+
"debug":{
|
|
77
|
+
"loaded": false
|
|
78
|
+
},
|
|
79
|
+
"tokenTTL": 3600,
|
|
80
|
+
"secret": "zZswkyHax9xzb3hMn6fsxJkJnK2dFF02gpKTnQwh",
|
|
81
|
+
"roles": {
|
|
82
|
+
"primary": ["root","admin","client","user","guest"],
|
|
83
|
+
"secondary": ["confirmed","manager"]
|
|
84
|
+
},
|
|
85
|
+
"restrict": {
|
|
86
|
+
"registration": false
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
"rateLimiter": {
|
|
93
|
+
"keyPrefix": "rateLimiterMiddleware",
|
|
94
|
+
"points": 500,
|
|
95
|
+
"duration": 1
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
},
|
|
99
|
+
"middleware": {
|
|
100
|
+
"not-options": {},"not-filter": {},"not-notification": {},"not-locale": {},"not-inform": {},"not-inform-rule-tag": {},"not-inform-sink-email": {},"not-inform-sink-notification": {},"not-inform-sink-ws": {},"not-key": {},"not-ws": {},"not-store": {},"not-dbdump": {},"not-user": {},"not-error": {}
|
|
101
|
+
},
|
|
102
|
+
"importModulesFromNPM": [
|
|
103
|
+
"not-options","not-filter","not-notification","not-locale","not-inform","not-inform-rule-tag","not-inform-sink-email","not-inform-sink-notification","not-inform-sink-ws","not-key","not-ws","not-store","not-dbdump","not-user","not-error"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hostname":"localhost",
|
|
3
|
+
"CSP": {
|
|
4
|
+
"connect": [
|
|
5
|
+
"'self'",
|
|
6
|
+
"*",
|
|
7
|
+
"wss:",
|
|
8
|
+
"https:",
|
|
9
|
+
"'unsafe-inline'"
|
|
10
|
+
],
|
|
11
|
+
"default": [
|
|
12
|
+
"'self'",
|
|
13
|
+
"*",
|
|
14
|
+
"wss:",
|
|
15
|
+
"https:",
|
|
16
|
+
"'unsafe-inline'"
|
|
17
|
+
],
|
|
18
|
+
"img": [
|
|
19
|
+
"'self'",
|
|
20
|
+
"data:"
|
|
21
|
+
],
|
|
22
|
+
"script": [
|
|
23
|
+
"'self'",
|
|
24
|
+
"'unsafe-eval'",
|
|
25
|
+
"'unsafe-inline'"
|
|
26
|
+
],
|
|
27
|
+
"style": [
|
|
28
|
+
"'self'",
|
|
29
|
+
"'unsafe-inline'",
|
|
30
|
+
"'unsafe-eval'"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hostname":"localhost",
|
|
3
|
+
"CSP": {
|
|
4
|
+
"connect": [
|
|
5
|
+
"'self'",
|
|
6
|
+
"*",
|
|
7
|
+
"wss:",
|
|
8
|
+
"https:",
|
|
9
|
+
"'unsafe-inline'"
|
|
10
|
+
],
|
|
11
|
+
"default": [
|
|
12
|
+
"'self'",
|
|
13
|
+
"*",
|
|
14
|
+
"wss:",
|
|
15
|
+
"https:",
|
|
16
|
+
"'unsafe-inline'"
|
|
17
|
+
],
|
|
18
|
+
"img": [
|
|
19
|
+
"'self'",
|
|
20
|
+
"data:"
|
|
21
|
+
],
|
|
22
|
+
"script": [
|
|
23
|
+
"'self'",
|
|
24
|
+
"'unsafe-eval'",
|
|
25
|
+
"'unsafe-inline'"
|
|
26
|
+
],
|
|
27
|
+
"style": [
|
|
28
|
+
"'self'",
|
|
29
|
+
"'unsafe-inline'",
|
|
30
|
+
"'unsafe-eval'"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hostname":"localhost",
|
|
3
|
+
"CSP": {
|
|
4
|
+
"connect": [
|
|
5
|
+
"'self'",
|
|
6
|
+
"*",
|
|
7
|
+
"wss:",
|
|
8
|
+
"https:",
|
|
9
|
+
"'unsafe-inline'"
|
|
10
|
+
],
|
|
11
|
+
"default": [
|
|
12
|
+
"'self'",
|
|
13
|
+
"*",
|
|
14
|
+
"wss:",
|
|
15
|
+
"https:",
|
|
16
|
+
"'unsafe-inline'"
|
|
17
|
+
],
|
|
18
|
+
"img": [
|
|
19
|
+
"'self'",
|
|
20
|
+
"data:"
|
|
21
|
+
],
|
|
22
|
+
"script": [
|
|
23
|
+
"'self'",
|
|
24
|
+
"'unsafe-eval'",
|
|
25
|
+
"'unsafe-inline'"
|
|
26
|
+
],
|
|
27
|
+
"style": [
|
|
28
|
+
"'self'",
|
|
29
|
+
"'unsafe-inline'",
|
|
30
|
+
"'unsafe-eval'"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const env = process.env.NODE_ENV || 'development';
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
require('dotenv').config({ path: path.resolve(__dirname, '../../../.env')});
|
|
5
|
+
|
|
6
|
+
const configPath = path.join(__dirname, 'config');
|
|
7
|
+
const configModule = require('not-config');
|
|
8
|
+
|
|
9
|
+
//инициализируем доступ к логам
|
|
10
|
+
const log = require('not-log')(module, 'init');
|
|
11
|
+
log.info('Environment', env, configPath);
|
|
12
|
+
|
|
13
|
+
//иницилизируем доступ к настройкам
|
|
14
|
+
const configLoaded = configModule.init(configPath);
|
|
15
|
+
if (configLoaded !== false){
|
|
16
|
+
log.info('Config loaded: ', configPath);
|
|
17
|
+
require('./app.js')();
|
|
18
|
+
}else{
|
|
19
|
+
log.error('Config not loaded: ', configPath);
|
|
20
|
+
}
|