dbgate-api 5.4.1 → 5.4.3
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dbgate-api",
|
|
3
3
|
"main": "src/index.js",
|
|
4
|
-
"version": "5.4.
|
|
4
|
+
"version": "5.4.3",
|
|
5
5
|
"homepage": "https://dbgate.org/",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"compare-versions": "^3.6.0",
|
|
27
27
|
"cors": "^2.8.5",
|
|
28
28
|
"cross-env": "^6.0.3",
|
|
29
|
-
"dbgate-datalib": "^5.4.
|
|
29
|
+
"dbgate-datalib": "^5.4.3",
|
|
30
30
|
"dbgate-query-splitter": "^4.10.3",
|
|
31
|
-
"dbgate-sqltree": "^5.4.
|
|
32
|
-
"dbgate-tools": "^5.4.
|
|
31
|
+
"dbgate-sqltree": "^5.4.3",
|
|
32
|
+
"dbgate-tools": "^5.4.3",
|
|
33
33
|
"debug": "^4.3.4",
|
|
34
34
|
"diff": "^5.0.0",
|
|
35
35
|
"diff2html": "^3.4.13",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/fs-extra": "^9.0.11",
|
|
76
76
|
"@types/lodash": "^4.14.149",
|
|
77
|
-
"dbgate-types": "^5.4.
|
|
77
|
+
"dbgate-types": "^5.4.3",
|
|
78
78
|
"env-cmd": "^10.1.0",
|
|
79
79
|
"node-loader": "^1.0.2",
|
|
80
80
|
"nodemon": "^2.0.2",
|
package/src/currentVersion.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
const axios = require('axios');
|
|
2
2
|
const os = require('os');
|
|
3
3
|
const crypto = require('crypto');
|
|
4
|
+
const platformInfo = require('./platformInfo');
|
|
4
5
|
|
|
5
|
-
async function
|
|
6
|
+
async function getPublicIpInfo() {
|
|
6
7
|
try {
|
|
7
|
-
const resp = await axios.default.get('https://
|
|
8
|
-
|
|
8
|
+
const resp = await axios.default.get('https://ipinfo.io/json');
|
|
9
|
+
if (!resp.data?.ip) {
|
|
10
|
+
return { ip: 'unknown-ip' };
|
|
11
|
+
}
|
|
12
|
+
return resp.data;
|
|
9
13
|
} catch (err) {
|
|
10
|
-
return 'unknown-ip';
|
|
14
|
+
return { ip: 'unknown-ip' };
|
|
11
15
|
}
|
|
12
16
|
}
|
|
13
17
|
|
|
@@ -28,7 +32,7 @@ function getMacAddress() {
|
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
async function getHardwareFingerprint() {
|
|
31
|
-
const
|
|
35
|
+
const publicIpInfo = await getPublicIpInfo();
|
|
32
36
|
const macAddress = getMacAddress();
|
|
33
37
|
const platform = os.platform();
|
|
34
38
|
const release = os.release();
|
|
@@ -36,7 +40,10 @@ async function getHardwareFingerprint() {
|
|
|
36
40
|
const totalMemory = os.totalmem();
|
|
37
41
|
|
|
38
42
|
return {
|
|
39
|
-
publicIp,
|
|
43
|
+
publicIp: publicIpInfo.ip,
|
|
44
|
+
country: publicIpInfo.country,
|
|
45
|
+
region: publicIpInfo.region,
|
|
46
|
+
city: publicIpInfo.city,
|
|
40
47
|
macAddress,
|
|
41
48
|
platform,
|
|
42
49
|
release,
|
|
@@ -61,6 +68,11 @@ async function getPublicHardwareFingerprint() {
|
|
|
61
68
|
hash,
|
|
62
69
|
payload: {
|
|
63
70
|
platform: fingerprint.platform,
|
|
71
|
+
city: fingerprint.city,
|
|
72
|
+
country: fingerprint.country,
|
|
73
|
+
region: fingerprint.region,
|
|
74
|
+
isDocker: platformInfo.isDocker,
|
|
75
|
+
isElectron: platformInfo.isElectron,
|
|
64
76
|
},
|
|
65
77
|
};
|
|
66
78
|
}
|