@certd/lib-server 1.39.11 → 1.39.13
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/dist/system/settings/service/models.d.ts +3 -0
- package/dist/system/settings/service/models.js +3 -0
- package/dist/system/settings/service/sys-settings-service.js +2 -1
- package/dist/user/access/service/access-service.d.ts +1 -0
- package/dist/user/access/service/access-service.js +18 -0
- package/package.json +13 -8
|
@@ -21,8 +21,10 @@ export declare class SysPublicSettings extends BaseSettings {
|
|
|
21
21
|
managerOtherUserPipeline: boolean;
|
|
22
22
|
icpNo?: string;
|
|
23
23
|
mpsNo?: string;
|
|
24
|
+
customFooter?: string;
|
|
24
25
|
robots?: boolean;
|
|
25
26
|
aiChatEnabled: boolean;
|
|
27
|
+
homePageEnabled: boolean;
|
|
26
28
|
captchaEnabled: boolean;
|
|
27
29
|
captchaType?: string;
|
|
28
30
|
captchaAddonId?: number;
|
|
@@ -54,6 +56,7 @@ export declare class SysPrivateSettings extends BaseSettings {
|
|
|
54
56
|
httpRequestTimeout?: number;
|
|
55
57
|
pipelineMaxRunningCount?: number;
|
|
56
58
|
environmentVars?: string;
|
|
59
|
+
acmeWalkFromAuthoritative?: boolean;
|
|
57
60
|
sms?: {
|
|
58
61
|
type?: string;
|
|
59
62
|
config?: any;
|
|
@@ -24,8 +24,10 @@ export class SysPublicSettings extends BaseSettings {
|
|
|
24
24
|
managerOtherUserPipeline = false;
|
|
25
25
|
icpNo;
|
|
26
26
|
mpsNo;
|
|
27
|
+
customFooter;
|
|
27
28
|
robots = true;
|
|
28
29
|
aiChatEnabled = true;
|
|
30
|
+
homePageEnabled = true;
|
|
29
31
|
//验证码是否开启
|
|
30
32
|
captchaEnabled = false;
|
|
31
33
|
//验证码类型
|
|
@@ -61,6 +63,7 @@ export class SysPrivateSettings extends BaseSettings {
|
|
|
61
63
|
httpRequestTimeout = 30;
|
|
62
64
|
pipelineMaxRunningCount;
|
|
63
65
|
environmentVars = '';
|
|
66
|
+
acmeWalkFromAuthoritative = true;
|
|
64
67
|
sms = {
|
|
65
68
|
type: 'aliyun',
|
|
66
69
|
config: {},
|
|
@@ -12,7 +12,7 @@ import { InjectEntityModel } from '@midwayjs/typeorm';
|
|
|
12
12
|
import { Repository } from 'typeorm';
|
|
13
13
|
import { SysSettingsEntity } from '../entity/sys-settings.js';
|
|
14
14
|
import { SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js';
|
|
15
|
-
import { getAllSslProviderDomains, setSslProviderReverseProxies } from '@certd/acme-client';
|
|
15
|
+
import { getAllSslProviderDomains, setSslProviderReverseProxies, setWalkFromAuthoritative } from '@certd/acme-client';
|
|
16
16
|
import { cache, logger, mergeUtils, setGlobalProxy } from '@certd/basic';
|
|
17
17
|
import { isPlus } from '@certd/plus-core';
|
|
18
18
|
import * as dns from 'node:dns';
|
|
@@ -163,6 +163,7 @@ let SysSettingsService = class SysSettingsService extends BaseService {
|
|
|
163
163
|
setSslProviderReverseProxies(privateSetting.reverseProxies);
|
|
164
164
|
//加载环境变量
|
|
165
165
|
this.setEnvironmentVars(privateSetting.environmentVars);
|
|
166
|
+
setWalkFromAuthoritative(privateSetting.acmeWalkFromAuthoritative);
|
|
166
167
|
}
|
|
167
168
|
setEnvironmentVars(vars) {
|
|
168
169
|
const envVars = {};
|
|
@@ -119,6 +119,24 @@ let AccessService = class AccessService extends BaseService {
|
|
|
119
119
|
delete param.keyId;
|
|
120
120
|
return await super.update(param);
|
|
121
121
|
}
|
|
122
|
+
async updateAccess(access) {
|
|
123
|
+
const oldEntity = await this.info(access.id);
|
|
124
|
+
if (oldEntity == null) {
|
|
125
|
+
throw new ValidateException('该授权配置不存在,请确认是否已被删除');
|
|
126
|
+
}
|
|
127
|
+
const setting = this.decryptAccessEntity(oldEntity);
|
|
128
|
+
for (const key of Object.keys(access)) {
|
|
129
|
+
if (key === 'id') {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
setting[key] = access[key];
|
|
133
|
+
}
|
|
134
|
+
return await this.update({
|
|
135
|
+
id: access.id,
|
|
136
|
+
type: oldEntity.type,
|
|
137
|
+
setting: JSON.stringify(setting),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
122
140
|
async getSimpleInfo(id) {
|
|
123
141
|
const entity = await this.info(id);
|
|
124
142
|
if (entity == null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@certd/lib-server",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.13",
|
|
4
4
|
"description": "midway with flyway, sql upgrade way ",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"build": "npm run before-build && tsc --skipLibCheck",
|
|
13
13
|
"dev-build": "npm run build",
|
|
14
14
|
"test": "midway-bin test --ts -V",
|
|
15
|
+
"test:unit": "cross-env NODE_ENV=unittest mocha --no-config --node-option no-warnings --node-option loader=ts-node/esm \"src/**/*.test.ts\"",
|
|
15
16
|
"test1": "midway-bin test --ts -V -f test/blank.test.ts -t 'hash-check'",
|
|
16
17
|
"cov": "midway-bin cov --ts",
|
|
17
18
|
"lint": "mwts check",
|
|
@@ -28,11 +29,11 @@
|
|
|
28
29
|
],
|
|
29
30
|
"license": "AGPL",
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@certd/acme-client": "^1.39.
|
|
32
|
-
"@certd/basic": "^1.39.
|
|
33
|
-
"@certd/pipeline": "^1.39.
|
|
34
|
-
"@certd/plugin-lib": "^1.39.
|
|
35
|
-
"@certd/plus-core": "^1.39.
|
|
32
|
+
"@certd/acme-client": "^1.39.13",
|
|
33
|
+
"@certd/basic": "^1.39.13",
|
|
34
|
+
"@certd/pipeline": "^1.39.13",
|
|
35
|
+
"@certd/plugin-lib": "^1.39.13",
|
|
36
|
+
"@certd/plus-core": "^1.39.13",
|
|
36
37
|
"@midwayjs/cache": "3.14.0",
|
|
37
38
|
"@midwayjs/core": "3.20.11",
|
|
38
39
|
"@midwayjs/i18n": "3.20.13",
|
|
@@ -43,7 +44,6 @@
|
|
|
43
44
|
"@midwayjs/upload": "3.20.13",
|
|
44
45
|
"@midwayjs/validate": "3.20.13",
|
|
45
46
|
"better-sqlite3": "^11.1.2",
|
|
46
|
-
"cross-env": "^7.0.3",
|
|
47
47
|
"dayjs": "^1.11.7",
|
|
48
48
|
"lodash-es": "^4.17.21",
|
|
49
49
|
"mwts": "^1.3.0",
|
|
@@ -52,17 +52,22 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/chai": "^4.3.3",
|
|
55
|
+
"@types/mocha": "^10.0.1",
|
|
55
56
|
"@types/node": "^18",
|
|
56
57
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
57
58
|
"@typescript-eslint/parser": "^8.26.1",
|
|
59
|
+
"cross-env": "^7.0.3",
|
|
58
60
|
"eslint": "^8.24.0",
|
|
59
61
|
"eslint-config-prettier": "^8.5.0",
|
|
60
62
|
"eslint-plugin-prettier": "^4.2.1",
|
|
63
|
+
"esmock": "^2.7.5",
|
|
64
|
+
"mocha": "^10.2.0",
|
|
61
65
|
"prettier": "^2.8.8",
|
|
62
66
|
"rimraf": "^5.0.5",
|
|
67
|
+
"ts-node": "^10.9.2",
|
|
63
68
|
"tslib": "^2.8.1",
|
|
64
69
|
"typeorm": "^0.3.11",
|
|
65
70
|
"typescript": "^5.4.2"
|
|
66
71
|
},
|
|
67
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "9f7d766cb386b299d4098141f4a47d23e16975e3"
|
|
68
73
|
}
|