mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-26 09:31:43 +01:00
bouncer & defaultconf: change nobot to noscraper
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
dfdc5fbcc4
commit
2972624c49
@ -6,7 +6,7 @@ const { validateEvent, nip19, matchFilters, mergeFilters, getFilterLimit } = req
|
||||
const auth = require("./auth.js");
|
||||
const nip42 = require("./nip42.js");
|
||||
|
||||
let { relays, approved_publishers, blocked_publishers, log_about_relays, authorized_keys, private_keys, reconnect_time, wait_eose, pause_on_limit, max_eose_score, broadcast_ratelimit, upstream_ratelimit_expiration, max_client_subs, idle_sessions, cache_relays, nobot } = require(process.env.BOSTR_CONFIG_PATH || "./config");
|
||||
let { relays, approved_publishers, blocked_publishers, log_about_relays, authorized_keys, private_keys, reconnect_time, wait_eose, pause_on_limit, max_eose_score, broadcast_ratelimit, upstream_ratelimit_expiration, max_client_subs, idle_sessions, cache_relays, noscraper } = require(process.env.BOSTR_CONFIG_PATH || "./config");
|
||||
|
||||
log_about_relays = process.env.LOG_ABOUT_RELAYS || log_about_relays;
|
||||
authorized_keys = authorized_keys?.map(i => i.startsWith("npub") ? nip19.decode(i).data : i);
|
||||
@ -44,7 +44,7 @@ module.exports = (ws, req, onClose) => {
|
||||
ws.accurateMode = parseInt(query.accurate);
|
||||
ws.saveMode = parseInt(query.save);
|
||||
|
||||
if (nobot || authorized_keys?.length) {
|
||||
if (noscraper || authorized_keys?.length) {
|
||||
authKey = Date.now() + Math.random().toString(36);
|
||||
authorized = false;
|
||||
ws.send(JSON.stringify(["AUTH", authKey]));
|
||||
|
@ -30,8 +30,11 @@ module.exports = {
|
||||
// Use deflate compression for websocket.
|
||||
perMessageDeflate: true,
|
||||
|
||||
// Do not accept bot (This only checks whenever client respond to AUTH)
|
||||
nobot: true,
|
||||
// Reject scraper requests.
|
||||
// This only checks whenever client respond to bouncer's AUTH.
|
||||
//
|
||||
// NOTE: - Require NIP-42 compatible nostr client.
|
||||
noscraper: true,
|
||||
|
||||
// Time before reconnect to relays in milliseconds.
|
||||
reconnect_time: 5000,
|
||||
|
Loading…
x
Reference in New Issue
Block a user