@abtnode/router-provider 1.16.43-beta-20250424-125523-08a65a5c → 1.16.43-beta-20250425-130658-8da18f4d
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/lib/nginx/index.js +19 -2
- package/package.json +7 -6
package/lib/nginx/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const { NginxConfFile } = require('nginx-conf');
|
|
|
4
4
|
const fs = require('fs-extra');
|
|
5
5
|
const os = require('os');
|
|
6
6
|
const fg = require('fast-glob');
|
|
7
|
+
const semver = require('semver');
|
|
7
8
|
const path = require('path');
|
|
8
9
|
const shelljs = require('shelljs');
|
|
9
10
|
const kill = require('fkill');
|
|
@@ -393,6 +394,11 @@ class NginxProvider extends BaseProvider {
|
|
|
393
394
|
capabilities.modsecurity = modulePaths.some((x) => toLower(x).includes('modsecurity'));
|
|
394
395
|
}
|
|
395
396
|
|
|
397
|
+
const result = shelljs.exec(`${this.binPath} -v`, { silent: true });
|
|
398
|
+
if (result.code === 0) {
|
|
399
|
+
capabilities.version = semver.coerce((result.stderr || result.stdout).split('/').pop())?.version || '';
|
|
400
|
+
}
|
|
401
|
+
|
|
396
402
|
return capabilities;
|
|
397
403
|
}
|
|
398
404
|
|
|
@@ -865,13 +871,24 @@ class NginxProvider extends BaseProvider {
|
|
|
865
871
|
const crtPath = `${joinNginxPath(this.certDir, certificateFileName.replace('*', '-'))}.crt`;
|
|
866
872
|
const keyPath = `${joinNginxPath(this.certDir, certificateFileName.replace('*', '-'))}.key`;
|
|
867
873
|
|
|
868
|
-
|
|
874
|
+
// Handle HTTP/2 configuration based on Nginx version
|
|
875
|
+
let listen = `${this.httpsPort} ssl`;
|
|
876
|
+
let http2Config = '';
|
|
877
|
+
if (this.capabilities.httpV2) {
|
|
878
|
+
if (this.capabilities.version && semver.gte(this.capabilities.version, '1.25.1')) {
|
|
879
|
+
http2Config = 'http2 on';
|
|
880
|
+
} else {
|
|
881
|
+
listen += ' http2';
|
|
882
|
+
}
|
|
883
|
+
}
|
|
869
884
|
if (serverName === '_') {
|
|
870
885
|
listen = `${listen} default_server`;
|
|
871
886
|
}
|
|
872
|
-
|
|
873
887
|
httpsServerUnit._add('server_name', serverName);
|
|
874
888
|
httpsServerUnit._add('listen', listen);
|
|
889
|
+
if (http2Config) {
|
|
890
|
+
httpsServerUnit._add('http2', 'on');
|
|
891
|
+
}
|
|
875
892
|
httpsServerUnit._add('ssl_certificate', crtPath);
|
|
876
893
|
httpsServerUnit._add('ssl_certificate_key', keyPath);
|
|
877
894
|
httpsServerUnit._add('include', 'includes/ssl');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/router-provider",
|
|
3
|
-
"version": "1.16.43-beta-
|
|
3
|
+
"version": "1.16.43-beta-20250425-130658-8da18f4d",
|
|
4
4
|
"description": "Routing engine implementations for abt node",
|
|
5
5
|
"author": "polunzh <polunzh@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/constant": "1.16.43-beta-
|
|
36
|
-
"@abtnode/logger": "1.16.43-beta-
|
|
37
|
-
"@abtnode/router-templates": "1.16.43-beta-
|
|
38
|
-
"@abtnode/util": "1.16.43-beta-
|
|
35
|
+
"@abtnode/constant": "1.16.43-beta-20250425-130658-8da18f4d",
|
|
36
|
+
"@abtnode/logger": "1.16.43-beta-20250425-130658-8da18f4d",
|
|
37
|
+
"@abtnode/router-templates": "1.16.43-beta-20250425-130658-8da18f4d",
|
|
38
|
+
"@abtnode/util": "1.16.43-beta-20250425-130658-8da18f4d",
|
|
39
39
|
"@arcblock/http-proxy": "^1.19.1",
|
|
40
40
|
"@arcblock/is-valid-domain": "^1.0.5",
|
|
41
41
|
"axios": "^1.7.9",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"object-hash": "^3.0.0",
|
|
52
52
|
"port-used": "^2.0.8",
|
|
53
53
|
"promise-retry": "^2.0.1",
|
|
54
|
+
"semver": "^7.6.3",
|
|
54
55
|
"shelljs": "^0.8.5",
|
|
55
56
|
"tar": "^6.1.11",
|
|
56
57
|
"ufo": "^1.5.3",
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
"bluebird": "^3.7.2",
|
|
61
62
|
"fs-extra": "^11.2.0"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "b5195a0290d5ced00bb716a709548b1a56356134"
|
|
64
65
|
}
|