@profullstack/nichedb 0.40.0 → 0.42.0
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 +1 -1
- package/src/index.js +15 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { homedir, tmpdir } from 'node:os';
|
|
|
15
15
|
import { join } from 'node:path';
|
|
16
16
|
import { createInterface } from 'node:readline';
|
|
17
17
|
|
|
18
|
-
export const VERSION = '0.
|
|
18
|
+
export const VERSION = '0.42.0';
|
|
19
19
|
const GEO_FLAGS = ['lat', 'long', 'radius', 'unit', 'bbox', 'sort', 'offset'];
|
|
20
20
|
const DEFAULT_API = process.env.NICHEDB_API ?? 'https://nichedb.dev';
|
|
21
21
|
const CONFIG_DIR = join(process.env.XDG_CONFIG_HOME ?? join(homedir(), '.config'), 'nichedb');
|
|
@@ -245,10 +245,19 @@ export const COMMANDS = [
|
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
name: 'traffic',
|
|
248
|
-
usage: 'traffic [<ip>] [--days <n>] [--category <c>] [--txt]',
|
|
248
|
+
usage: 'traffic [<ip>] [--days <n>] [--category <c>] [--txt|--rpz|--rbldnsd]',
|
|
249
249
|
summary:
|
|
250
250
|
'The human-reviewed /traffic IP blocklist: newest approvals, one address, or --txt for a fail2ban/nftables-ready list. Exits 1 when an address is listed.',
|
|
251
|
-
options: [
|
|
251
|
+
options: [
|
|
252
|
+
'--days <n>',
|
|
253
|
+
'--category <c>',
|
|
254
|
+
'--limit <n>',
|
|
255
|
+
'--offset <n>',
|
|
256
|
+
'--txt',
|
|
257
|
+
'--rpz',
|
|
258
|
+
'--rbldnsd',
|
|
259
|
+
'--json',
|
|
260
|
+
],
|
|
252
261
|
},
|
|
253
262
|
{
|
|
254
263
|
name: 'profiles',
|
|
@@ -1094,8 +1103,9 @@ export async function run(
|
|
|
1094
1103
|
);
|
|
1095
1104
|
return r.listed ? 1 : 0;
|
|
1096
1105
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1106
|
+
const format = flags.rpz ? 'rpz' : flags.rbldnsd ? 'rbldnsd' : flags.txt ? 'txt' : null;
|
|
1107
|
+
if (format) {
|
|
1108
|
+
out(await client.text(`/traffic/blocklist.${format}${qs.size ? `?${qs}` : ''}`));
|
|
1099
1109
|
return 0;
|
|
1100
1110
|
}
|
|
1101
1111
|
const r = await client.get(`/api/v1/traffic${qs.size ? `?${qs}` : ''}`);
|