Skip to content

Commit

Permalink
add nodejs check to geo adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Apr 8, 2024
1 parent 3c28e88 commit e1de874
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"deploy:nocapd@amsterdam": "ansible-playbook .ansible/nocapd/deploy.yaml -i .ansible/inventories/amsterdam",
"deploy:nocapd@newyork": "ansible-playbook .ansible/nocapd/deploy.yaml -i .ansible/inventories/newyork",
"deploy:nocapd@johannesburg": "ansible-playbook .ansible/nocapd/deploy.yaml -i .ansible/inventories/johannesburg",
"deploy:nocapd@johannesburg": "ansible-playbook .ansible/nocapd/deploy.yaml -i .ansible/inventories/frankfurt",
"deploy:nocapd@saopaulo": "ansible-playbook .ansible/nocapd/deploy.yaml -i .ansible/inventories/saopaulo",
"nukecache@all": "ansible-playbook .ansible/nocapd/nuke-cache.yaml -i .ansible/inventories/johannesburg -i .ansible/inventories/amsterdam -i .ansible/inventories/mumbai -i .ansible/inventories/newyork -i .ansible/inventories/saopaulo -i .ansible/inventories/seoul -i .ansible/inventories/siliconvalley -i .ansible/inventories/sydney"
},
"packageManager": "[email protected]^",
Expand Down
2 changes: 1 addition & 1 deletion packages/announce/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class AnnounceMonitor {
}

static formatChecks(checks: Array<string>): Array<string> {
if(checks.length === 1 && checks[0] === 'all')
if(checks.includes('all'))
return ['open', 'read', 'write', 'info', 'dns', 'geo', 'ssl']
return checks
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@nostrwatch/nocap-every-adapter-default",
"version": "1.2.0",
"version": "1.2.1",
"type": "module",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@nostrwatch/nocap-dns-adapter-default": "^1.0.2",
"@nostrwatch/nocap-geo-adapter-default": "^1.0.1",
"@nostrwatch/nocap-geo-adapter-default": "^1.0.2",
"@nostrwatch/nocap-info-adapter-default": "^1.0.1",
"@nostrwatch/nocap-ssl-adapter-default": "^1.0.1",
"@nostrwatch/nocap-websocket-adapter-default": "^1.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/nocap/adapters/default/GeoAdapterDefault/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { fetch } from 'cross-fetch'
let endpoint
const iparr = this.$.results.get('dns')?.data.ipv4
const ip = iparr[iparr.length-1]
const apiKey = process?.env?.IP_API_KEY? process.env.IP_API_KEY: this.$.config.adapterOptions.geo.apiKey
const apiKey = typeof process !== 'undefined' && process?.env?.IP_API_KEY? process.env.IP_API_KEY: this.$.config.adapterOptions.geo.apiKey
//todo, enable override via options
const fields = 'proxy,mobile,timezone,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,isp,as,asname,query'
if(typeof ip !== 'string')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nostrwatch/nocap-geo-adapter-default",
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"main": "index.js",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions packages/nocap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nostrwatch/nocap",
"version": "0.4.5",
"version": "0.4.6",
"main": "src/index.js",
"type": "module",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"dependencies": {
"@nostrwatch/logger": "^0.0.5",
"@nostrwatch/nocap-every-adapter-default": "^1.2.0",
"@nostrwatch/nocap-every-adapter-default": "^1.2.1",
"@nostrwatch/utils": "^0.0.3",
"fetch-h2": "3.0.2",
"get-ssl-certificate": "2.3.3",
Expand Down
1 change: 0 additions & 1 deletion packages/nocap/src/classes/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export default class Base {
this.defaultAdapters()
await this.start(key).catch( err => this.logger.debug(err) )
const result = await this.promises.get(key).promise
// process.exit()
this.logger.debug(`${key}: check(): resolved`)
if(result?.[key]?.status === "error" ) {
this.on_check_error( key, result )
Expand Down

0 comments on commit e1de874

Please sign in to comment.