mybase 1.0.49 → 1.0.51

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.
Files changed (2) hide show
  1. package/mybase.js +14 -5
  2. package/package.json +2 -1
package/mybase.js CHANGED
@@ -139,10 +139,10 @@ function Geoip2Paths() {
139
139
  }
140
140
 
141
141
  return {
142
- country:firstExisting(['/opt/geoip2/GeoIP2-Country.mmdb','/usr/local/var/GeoIP/GeoIP2-Country.mmdb','/var/lib/GeoIP/GeoIP2-Country.mmdb','/usr/share/GeoIP/GeoIP2-Country.mmdb',path.join(__dirname, 'assets/GeoIP2-Country.mmdb')]),
143
- city:firstExisting(['/opt/geoip2/GeoIP2-City.mmdb','/usr/local/var/GeoIP/GeoIP2-City.mmdb','/var/lib/GeoIP/GeoIP2-City.mmdb','/usr/share/GeoIP/GeoIP2-City.mmdb',path.join(__dirname, 'assets/GeoIP2-City.mmdb')]),
144
- isp:firstExisting(['/opt/geoip2/GeoIP2-ISP.mmdb','/usr/local/var/GeoIP/GeoIP2-ISP.mmdb','/var/lib/GeoIP/GeoIP2-ISP.mmdb','/usr/share/GeoIP/GeoIP2-ISP.mmdb',path.join(__dirname, 'assets/GeoIP2-ISP.mmdb')]),
145
- ct:firstExisting(['/opt/geoip2/GeoIP2-Connection-Type.mmdb','/usr/local/var/GeoIP/GeoIP2-Connection-Type.mmdb','/var/lib/GeoIP/GeoIP2-Connection-Type.mmdb','/usr/share/GeoIP/GeoIP2-Connection-Type.mmdb',path.join(__dirname, 'assets/GeoIP2-Connection-Type.mmdb')]),
142
+ country:firstExisting(['/opt/geoip2/GeoIP2-Country.mmdb','/usr/local/var/GeoIP/GeoIP2-Country.mmdb','/var/lib/GeoIP/GeoIP2-Country.mmdb','/usr/share/GeoIP/GeoIP2-Country.mmdb',path.join(__dirname, 'assets/GeoIP2-Country.mmdb'),path.join(require?.main?.path || __dirname, 'assets/GeoIP2-Country.mmdb')]),
143
+ city:firstExisting(['/opt/geoip2/GeoIP2-City.mmdb','/usr/local/var/GeoIP/GeoIP2-City.mmdb','/var/lib/GeoIP/GeoIP2-City.mmdb','/usr/share/GeoIP/GeoIP2-City.mmdb',path.join(__dirname, 'assets/GeoIP2-City.mmdb'),path.join(require?.main?.path || __dirname, 'assets/GeoIP2-City.mmdb')]),
144
+ isp:firstExisting(['/opt/geoip2/GeoIP2-ISP.mmdb','/usr/local/var/GeoIP/GeoIP2-ISP.mmdb','/var/lib/GeoIP/GeoIP2-ISP.mmdb','/usr/share/GeoIP/GeoIP2-ISP.mmdb',path.join(__dirname, 'assets/GeoIP2-ISP.mmdb'),path.join(require?.main?.path || __dirname, 'assets/GeoIP2-ISP.mmdb')]),
145
+ ct:firstExisting(['/opt/geoip2/GeoIP2-Connection-Type.mmdb','/usr/local/var/GeoIP/GeoIP2-Connection-Type.mmdb','/var/lib/GeoIP/GeoIP2-Connection-Type.mmdb','/usr/share/GeoIP/GeoIP2-Connection-Type.mmdb',path.join(__dirname, 'assets/GeoIP2-Connection-Type.mmdb'),path.join(require?.main?.path || __dirname, 'assets/GeoIP2-Connection-Type.mmdb')]),
146
146
  }
147
147
  }
148
148
 
@@ -676,6 +676,14 @@ function decryptAES_CBC_NOIV(encryptedHex, encryptionKey) {
676
676
  }
677
677
  }
678
678
 
679
+ function MaxRuntimeHours(hours=24) {
680
+ setTimeout(() => {
681
+ console.log(`Max runtime of ${hours} hours reached, exiting`)
682
+ process.exit(0)
683
+ }, hours * 60 * 60 * 1000)
684
+ }
685
+
686
+
679
687
  function isReservedLANIP(address) {
680
688
  // Define the reserved LAN IP ranges for IPv4 and IPv6.
681
689
  const reservedLANIPRanges = [
@@ -740,5 +748,6 @@ module.exports = {
740
748
  hash_sha512,
741
749
  isReservedLANIP,
742
750
  isLANIp,
743
- isLoopbackIP
751
+ isLoopbackIP,
752
+ MaxRuntimeHours
744
753
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mybase",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "",
5
5
  "main": "mybase.js",
6
6
  "scripts": {
@@ -17,6 +17,7 @@
17
17
  "ip6": "=0.2.7",
18
18
  "ip6addr": "^0.2.5",
19
19
  "js-sha512": "^0.8.0",
20
+ "psl": "^1.9.0",
20
21
  "punycode": "^2.1.1",
21
22
  "validator": "^13.7.0"
22
23
  },