2023-10-30 03:14:50 +07:00
|
|
|
|
|
|
|
// Bostr config
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
// Server listener [Required]
|
|
|
|
address: "0.0.0.0",
|
|
|
|
port: "8080",
|
|
|
|
|
2023-10-31 17:24:59 +07:00
|
|
|
// Clusters.
|
2023-11-18 16:59:44 +07:00
|
|
|
// 0 will make bostr run clusters with available parallelism / CPU cores.
|
|
|
|
clusters: 0,
|
2023-10-31 14:16:43 +07:00
|
|
|
|
2023-11-01 19:54:03 +07:00
|
|
|
// Log about bouncer connection with relays?
|
|
|
|
log_about_relays: false,
|
|
|
|
|
2023-11-18 16:49:20 +07:00
|
|
|
// Time before reconnect to relays in miliseconds.
|
|
|
|
reconnect_time: 5000,
|
|
|
|
|
2023-11-21 18:42:04 +07:00
|
|
|
// Wait for every connected relays send EOSE.
|
|
|
|
// Could improve accurancy on received events.
|
|
|
|
//
|
|
|
|
// Depending on your configured relays,
|
|
|
|
// It may could cause loading problems in client due to slow EOSE from bouncer.
|
|
|
|
wait_eose: false,
|
|
|
|
|
|
|
|
// Pause a subscription from receiving further events after reached to <filter.limit>
|
|
|
|
// Could save client's bandwdith.
|
|
|
|
//
|
|
|
|
// Depending on <wait_eose> settings, It could either miss some events.
|
|
|
|
pause_on_limit: true,
|
|
|
|
|
2023-11-20 21:21:22 +07:00
|
|
|
// A whitelist of users public keys who could use this bouncer.
|
2023-11-20 21:10:57 +07:00
|
|
|
// Leaving this empty will allows everyone to use this bouncer.
|
|
|
|
// NOTE: - Require NIP-42 compatible nostr client
|
2023-11-16 21:53:58 +07:00
|
|
|
authorized_keys: [
|
|
|
|
// "pubkey-in-hex",
|
|
|
|
// "npub ....",
|
|
|
|
// ....
|
|
|
|
],
|
|
|
|
|
2023-11-20 21:21:22 +07:00
|
|
|
// Used for accessing NIP-42 protected events from certain relays.
|
2023-11-20 21:10:57 +07:00
|
|
|
// It could be your key. Leaving this empty completely disables NIP-42 function.
|
2023-11-20 21:21:22 +07:00
|
|
|
//
|
|
|
|
// 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
|
2023-11-16 21:53:58 +07:00
|
|
|
private_keys: {
|
2023-11-16 22:07:07 +07:00
|
|
|
// "pubkey-in-hex": "privatekey",
|
|
|
|
// "pubkey-in-hex": "nsec ...."
|
2023-11-18 22:23:18 +00:00
|
|
|
},
|
2023-11-16 22:07:07 +07:00
|
|
|
// 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....
|
2023-11-16 21:53:58 +07:00
|
|
|
|
2023-10-30 03:14:50 +07:00
|
|
|
// Server information.
|
|
|
|
// Only for when nostr client requesting server information.
|
|
|
|
server_meta: {
|
|
|
|
"contact": "unset",
|
2023-11-19 08:02:40 +07:00
|
|
|
"description": "Nostr relay bouncer",
|
2023-10-30 03:14:50 +07:00
|
|
|
"name": "Bostr",
|
|
|
|
"software": "git+https://github.com/Yonle/bostr",
|
2023-11-12 16:54:39 +07:00
|
|
|
|
|
|
|
// Some nostr client may read the following for compatibility check.
|
2023-11-12 19:41:36 +07:00
|
|
|
// You may change the supported_nips to match with what your relays supported.
|
2023-11-18 22:23:18 +00:00
|
|
|
"supported_nips": [1,2,9,11,12,15,16,20,22,33,40,42,50],
|
2023-11-20 21:21:22 +07:00
|
|
|
"version": require("./package.json").version
|
2023-10-30 03:14:50 +07:00
|
|
|
},
|
|
|
|
|
|
|
|
// Nostr relays to bounce [Required]
|
|
|
|
relays: [
|
|
|
|
"wss://example1.com",
|
|
|
|
"wss://example2.com",
|
|
|
|
// "wss://example3.com",
|
|
|
|
// ...and so on
|
|
|
|
]
|
|
|
|
}
|