soajs.controller 4.2.30 → 4.2.31
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/.dockerignore +74 -0
- package/.travis.yml +1 -1
- package/Dockerfile +1 -1
- package/modules/registry/local.js +65 -0
- package/package.json +1 -1
- package/profiles/solo.js +50 -0
- package/release +18 -0
package/.dockerignore
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
|
|
8
|
+
# Runtime data
|
|
9
|
+
pids
|
|
10
|
+
*.pid
|
|
11
|
+
*.seed
|
|
12
|
+
*.pid.lock
|
|
13
|
+
dist
|
|
14
|
+
|
|
15
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
16
|
+
lib-cov
|
|
17
|
+
|
|
18
|
+
# Coverage directory used by tools like istanbul
|
|
19
|
+
coverage
|
|
20
|
+
|
|
21
|
+
# nyc test coverage
|
|
22
|
+
.nyc_output
|
|
23
|
+
|
|
24
|
+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
25
|
+
.grunt
|
|
26
|
+
|
|
27
|
+
# Bower dependency directory (https://bower.io/)
|
|
28
|
+
bower_components
|
|
29
|
+
|
|
30
|
+
# node-waf configuration
|
|
31
|
+
.lock-wscript
|
|
32
|
+
|
|
33
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
34
|
+
build/Release
|
|
35
|
+
|
|
36
|
+
# Dependency directories
|
|
37
|
+
node_modules/
|
|
38
|
+
jspm_packages/
|
|
39
|
+
|
|
40
|
+
# TypeScript v1 declaration files
|
|
41
|
+
typings/
|
|
42
|
+
|
|
43
|
+
# Optional npm cache directory
|
|
44
|
+
.npm
|
|
45
|
+
|
|
46
|
+
# Optional eslint cache
|
|
47
|
+
.eslintcache
|
|
48
|
+
|
|
49
|
+
# Optional REPL history
|
|
50
|
+
.node_repl_history
|
|
51
|
+
|
|
52
|
+
# Output of 'npm pack'
|
|
53
|
+
*.tgz
|
|
54
|
+
|
|
55
|
+
# Yarn Integrity file
|
|
56
|
+
.yarn-integrity
|
|
57
|
+
|
|
58
|
+
# dotenv environment variables file
|
|
59
|
+
.env
|
|
60
|
+
|
|
61
|
+
# next.js build output
|
|
62
|
+
.next
|
|
63
|
+
|
|
64
|
+
# DS_Store files automatically generated by Mac OS X
|
|
65
|
+
.DS_Store
|
|
66
|
+
|
|
67
|
+
# webstorm project formatting
|
|
68
|
+
.idea
|
|
69
|
+
|
|
70
|
+
# package-lock
|
|
71
|
+
package-lock.json
|
|
72
|
+
|
|
73
|
+
# GIT
|
|
74
|
+
.git
|
package/.travis.yml
CHANGED
package/Dockerfile
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright SOAJS All Rights Reserved.
|
|
6
|
+
*
|
|
7
|
+
* Use of this source code is governed by an Apache license that can be
|
|
8
|
+
* found in the LICENSE file at the root of this repository
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
let regFile = (process.env.SOAJS_PROFILE || __dirname + "/../../profiles/solo.js");
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
"init": function () {
|
|
16
|
+
},
|
|
17
|
+
"loadData": function (dbConfiguration, envCode, param, callback) {
|
|
18
|
+
let error = null;
|
|
19
|
+
if (fs.existsSync(regFile)) {
|
|
20
|
+
delete require.cache[require.resolve(regFile)];
|
|
21
|
+
let regFileObj = require(regFile);
|
|
22
|
+
if (regFileObj && typeof regFileObj === 'object' && !(Object.keys(regFileObj).length === 0 && regFileObj.constructor === Object)) {
|
|
23
|
+
let obj = {};
|
|
24
|
+
obj.ENV_schema = regFileObj;
|
|
25
|
+
return callback(null, obj);
|
|
26
|
+
} else {
|
|
27
|
+
error = new Error('Invalid profile file: ' + regFile);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
error = new Error('Invalid profile path: ' + regFile);
|
|
32
|
+
}
|
|
33
|
+
return callback(error, null);
|
|
34
|
+
},
|
|
35
|
+
"registerNewService": function (dbConfiguration, serviceObj, collection, cb) {
|
|
36
|
+
return cb(null);
|
|
37
|
+
},
|
|
38
|
+
"addUpdateServiceIP": function (dbConfiguration, hostObj, cb) {
|
|
39
|
+
return cb(null, true);
|
|
40
|
+
},
|
|
41
|
+
"loadOtherEnvHosts": function (param, cb) {
|
|
42
|
+
let obj = {};
|
|
43
|
+
return cb(null, obj);
|
|
44
|
+
},
|
|
45
|
+
"loadProfile": function (envFrom, cb) {
|
|
46
|
+
let regFileObj = {};
|
|
47
|
+
let registry = {
|
|
48
|
+
"timeLoaded": new Date().getTime(),
|
|
49
|
+
"name": envFrom,
|
|
50
|
+
"environment": envFrom,
|
|
51
|
+
"profileOnly": true,
|
|
52
|
+
"coreDB": {
|
|
53
|
+
"provision": regFileObj
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return cb(null, registry);
|
|
57
|
+
},
|
|
58
|
+
"getAllEnvironments": function (cb) {
|
|
59
|
+
let obj = {};
|
|
60
|
+
return cb(null, obj);
|
|
61
|
+
},
|
|
62
|
+
"addUpdateEnvControllers": function (param, cb) {
|
|
63
|
+
return cb(null);
|
|
64
|
+
}
|
|
65
|
+
};
|
package/package.json
CHANGED
package/profiles/solo.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
"services": {
|
|
5
|
+
"controller": {
|
|
6
|
+
"maxPoolSize": 100,
|
|
7
|
+
"authorization": true,
|
|
8
|
+
"requestTimeout": 30,
|
|
9
|
+
"requestTimeoutRenewal": 0
|
|
10
|
+
},
|
|
11
|
+
"config": {
|
|
12
|
+
"awareness": {},
|
|
13
|
+
"key": {
|
|
14
|
+
"algorithm": "aes256",
|
|
15
|
+
"password": "soajs key lal massa"
|
|
16
|
+
},
|
|
17
|
+
"logger": {
|
|
18
|
+
"src": true,
|
|
19
|
+
"level": "debug",
|
|
20
|
+
"formatter": {
|
|
21
|
+
"outputMode": "long"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"cors": {
|
|
25
|
+
"enabled": true,
|
|
26
|
+
"origin": "*",
|
|
27
|
+
"credentials": "true",
|
|
28
|
+
"methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
|
|
29
|
+
"headers": "key,soajsauth,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type",
|
|
30
|
+
"maxage": 1728000
|
|
31
|
+
},
|
|
32
|
+
"oauth": {
|
|
33
|
+
"grants": [
|
|
34
|
+
"password",
|
|
35
|
+
"refresh_token"
|
|
36
|
+
],
|
|
37
|
+
"accessTokenLifetime": 7200,
|
|
38
|
+
"refreshTokenLifetime": 1209600,
|
|
39
|
+
"debug": false
|
|
40
|
+
},
|
|
41
|
+
"ports": {
|
|
42
|
+
"controller": 4000,
|
|
43
|
+
"maintenanceInc": 1000,
|
|
44
|
+
"randomInc": 100
|
|
45
|
+
},
|
|
46
|
+
"cookie": {},
|
|
47
|
+
"session": {}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
package/release
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
IMAGE="gateway"
|
|
3
|
+
DFILE="Dockerfile"
|
|
4
|
+
|
|
5
|
+
echo "Release ${IMAGE} from ${DFILE}"
|
|
6
|
+
|
|
7
|
+
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -Fn '{ print $2 }' | sed 's/[n:",]//g' | tr -d '[[:space:]]')
|
|
8
|
+
MAJOR_VERSION=$(echo ${PACKAGE_VERSION} | awk -F. '{ print $1 }')
|
|
9
|
+
echo "Package version ${PACKAGE_VERSION}"
|
|
10
|
+
echo "Major version ${MAJOR_VERSION}"
|
|
11
|
+
|
|
12
|
+
docker build -t soajsorg/${IMAGE} -f ${DFILE} . --platform linux/amd64
|
|
13
|
+
docker tag soajsorg/${IMAGE}:latest soajsorg/${IMAGE}:${PACKAGE_VERSION}
|
|
14
|
+
docker tag soajsorg/${IMAGE}:latest soajsorg/${IMAGE}:${MAJOR_VERSION}.x
|
|
15
|
+
|
|
16
|
+
docker push soajsorg/${IMAGE}
|
|
17
|
+
docker push soajsorg/${IMAGE}:${PACKAGE_VERSION}
|
|
18
|
+
docker push soajsorg/${IMAGE}:${MAJOR_VERSION}.x
|