mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-18 22:02:18 +01:00
165 lines
5.4 KiB
Plaintext
165 lines
5.4 KiB
Plaintext
|
|
// Bostr config
|
|
|
|
module.exports = {
|
|
// Server listener [Required]
|
|
address: "0.0.0.0",
|
|
port: "8080",
|
|
|
|
// Standalone HTTPS server. Normally bostr is accepting unsecured connections.
|
|
// Specifying the absolute path of the private key/certificate will make bostr to only accept secured connections.
|
|
//
|
|
// Tip: You do not need this if you are running bostr behind reverse proxy.
|
|
https: {
|
|
privKey: "",
|
|
certificate: "",
|
|
ticketKey: ""
|
|
},
|
|
|
|
// Clusters.
|
|
// 0 will make bostr run clusters with available parallelism / CPU cores.
|
|
clusters: 1,
|
|
|
|
// Numbers of idle sessions to be created
|
|
// Default: 1
|
|
idle_sessions: 1,
|
|
|
|
// Log about bouncer connection with relays?
|
|
log_about_relays: false,
|
|
|
|
// Use deflate compression for websocket.
|
|
perMessageDeflate: true,
|
|
|
|
// Time before reconnect to relays in milliseconds.
|
|
reconnect_time: 5000,
|
|
|
|
// Ratelimit expiration after ratelimit from upstream relay in miliseconds.
|
|
// Setting as 0 will disable ratelimit handling.
|
|
upstream_ratelimit_expiration: 10000,
|
|
|
|
// Maximum subscriptions that client could open.
|
|
// Setting as -1 will disable max subscription limit.
|
|
max_client_subs: -1,
|
|
|
|
// Wait for every connected relays send EOSE.
|
|
// Could improve accuracy on received events.
|
|
//
|
|
// Depending on your configured relays,
|
|
// It may could cause loading problems in client due to slow EOSE from bouncer.
|
|
// You could try fix this by changing <eose_timeout> or <max_eose_score> value.
|
|
wait_eose: true,
|
|
|
|
// Pause an subscription from receiving further events after reached to <filter.limit>
|
|
// Could save client's bandwidth. Disable this if you need to get more events.
|
|
// This is also known as save mode.
|
|
//
|
|
// You may also need to adjust <max_eose_score>.
|
|
pause_on_limit: true,
|
|
|
|
// Maximum of received EOSE from relays to send EOSE to client.
|
|
// Normally, waiting EOSE from 3 relays should be enough. Leaving it with 0 equals wait for every established relays.
|
|
// NOTE: Please adjust this max score correctly with your configured relays.
|
|
// If you only setted up 3 relays, Set the <max_eose_score> as 0.
|
|
// Tip : The bigger = The more accurate EOSE, The less = EOSE sent way earlier.
|
|
max_eose_score: 0,
|
|
|
|
// Client event broadcast ratelimit in miliseconds.
|
|
// Client only able to broadcast new event to this bouncer after <broadcast_ratelimit>.
|
|
// Leaving it as 0 will disable this function.
|
|
broadcast_ratelimit: 0,
|
|
|
|
// Incomming websocket connection ratelimit in miliseconds.
|
|
// Leaving it as 0 will disable this function.
|
|
incomming_ratelimit: 0,
|
|
|
|
// A whitelist of users public keys who could use this bouncer.
|
|
// Leaving this empty will allow everyone to use this bouncer.
|
|
// NOTE: - Require NIP-42 compatible nostr client.
|
|
// You may use <allowed_event_authors> instead if your client does not support NIP-42.
|
|
authorized_keys: [
|
|
// "pubkey-in-hex",
|
|
// "npub ....",
|
|
// ....
|
|
],
|
|
|
|
// A whitelist of approved event publishers.
|
|
// Leaving this empty will allow everyone to publish events with this bouncer.
|
|
approved_publishers: [
|
|
// "pubkey-in-hex",
|
|
// "npub ....",
|
|
// ....
|
|
],
|
|
|
|
// A blacklist of blocked event publishers.
|
|
blocked_publishers: [
|
|
// "pubkey-in-hex",
|
|
// "npub ....",
|
|
// ....
|
|
],
|
|
|
|
// Block incomming websocket connections from the following hosts.
|
|
blocked_hosts: [
|
|
// "127.0.0.1",
|
|
// "127.0.0.2",
|
|
// "::1",
|
|
// "::2",
|
|
// ....
|
|
],
|
|
|
|
// Used for accessing NIP-42 protected events from certain relays.
|
|
// It could be your key. Leaving this empty completely disables NIP-42 function.
|
|
//
|
|
// You could use this function even as a public bouncer.
|
|
// There are no security risk as it utilize NIP-42 to recognize client public key.
|
|
//
|
|
// NOTE: - Require NIP-42 compatible nostr client
|
|
private_keys: {
|
|
// "pubkey-in-hex": "privatekey-in-hex",
|
|
// "pubkey-in-hex": "nsec ...."
|
|
},
|
|
// Tip: If you want to convert your pubkey/privatekey to hex,
|
|
// You could run the following command:
|
|
// $ node hexconverter.js npub....
|
|
// $ node hexconverter.js nsec....
|
|
// or
|
|
// $ bostr hexconverter npub....
|
|
// $ bostr hexconverter nsec....
|
|
|
|
// Server information.
|
|
// Only for when nostr client requesting server information.
|
|
server_meta: {
|
|
"contact": "unset",
|
|
"pubkey": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
"description": "Nostr relay bouncer",
|
|
"name": "Bostr",
|
|
"software": "git+https://github.com/Yonle/bostr",
|
|
|
|
// Some nostr client may read the following for compatibility check.
|
|
// You may change the supported_nips to match with what your relays supported.
|
|
"supported_nips": [1,2,9,11,12,15,16,20,22,33,40,42,50],
|
|
// "icon_url": ""
|
|
},
|
|
|
|
// Path to favicon file.
|
|
favicon: "",
|
|
|
|
// Nostr relays to bounce [Required]
|
|
relays: [
|
|
"wss://example1.com",
|
|
"wss://example2.com",
|
|
// "wss://example3.com",
|
|
// ...and so on
|
|
],
|
|
|
|
// Cache relays - Store received events to cache relay(s) (Optional).
|
|
// Could improve the speed of event deliveries.
|
|
//
|
|
// Ensure that the cache relay does not have websocket ratelimit being set.
|
|
// CAUTION: - Cache relay is intensive in storing events.
|
|
// - Only works best with only 1 cache relay.
|
|
// - Things may not work properly if you configure more than just a single cache relays.
|
|
cache_relays: [
|
|
// "ws://localhost:3000"
|
|
]
|
|
}
|