@yobytechautomation/config-lib 0.3.3 → 0.3.5
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/base-config.service.js +10 -3
- package/package.json +1 -1
|
@@ -112,9 +112,16 @@ class BaseConfigServiceImpl {
|
|
|
112
112
|
.update(apiKey + machineId)
|
|
113
113
|
.digest("hex");
|
|
114
114
|
console.log('DEBUG SIGNATURE:', signature);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.
|
|
115
|
+
let clientIp = 'unknown';
|
|
116
|
+
try {
|
|
117
|
+
const res = await axios_1.default.get('https://api.ipify.org?format=json', {
|
|
118
|
+
timeout: 2000,
|
|
119
|
+
});
|
|
120
|
+
clientIp = res.data.ip;
|
|
121
|
+
}
|
|
122
|
+
catch (e) {
|
|
123
|
+
console.warn('⚠️ Could not fetch public IP, using fallback');
|
|
124
|
+
}
|
|
118
125
|
const res = await axios_1.default.get(url, {
|
|
119
126
|
headers: {
|
|
120
127
|
"x-api-key": apiKey,
|