release: 2.0.6

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2024-02-21 16:17:50 +07:00
parent 6a851ecfe1
commit e545f2e877
4 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env node
const { version } = require("./package.json");
const { nip19 } = require("nostr-tools")
const fs = require("fs");
const cluster = require("cluster");
const argv = process.argv.slice(2);
@ -10,10 +11,11 @@ function showHelp() {
console.log(
"Usage: bostr [command] (argv)\n" +
"Available command:\n" +
" makeconf [conffile] - Make config file\n" +
" start [conffile] - Run bostr with specified config\n" +
" check [conffile] - Check config file\n" +
" help - Show this help text\n\n" +
" makeconf [conffile] - Make config file\n" +
" start [conffile] - Run bostr with specified config\n" +
" check [conffile] - Check config file\n" +
" hexconverter [nip19] - Convert NIP-19 string to hex\n" +
" help - Show this help text\n\n" +
"Software is licensed under BSD-3-Clause\n" +
"https://github.com/Yonle/bostr"
);
@ -68,6 +70,12 @@ switch (argv[0]) {
process.env.BOSTR_CONFIG_PATH = readPath(argv[1]);
require("./index.js");
break;
case "hexconverter":
if (!argv[1]) return console.log("Usage: bostr hexconverter [npub|nsec|....] ....");
for (const i of argv.slice(1)) {
console.log(nip19.decode(i).data);
}
break;
default:
if (argv[0] && (argv[0] !== "help")) {
console.error("Unrecognized command:", argv[0]);

View File

@ -204,7 +204,7 @@ function newConn(addr, client, reconn_t = 0) {
if (client.readyState !== 1) return;
const relay = new WebSocket(addr, {
headers: {
"User-Agent": `Bostr (v${version}); The nostr relay bouncer; https://github.com/Yonle/bostr`
"User-Agent": `Bostr ${version}; The nostr relay bouncer; https://github.com/Yonle/bostr`
},
noDelay: true,
allowSynchronousEvents: true

View File

@ -102,13 +102,16 @@ module.exports = {
//
// NOTE: - Require NIP-42 compatible nostr client
private_keys: {
// "pubkey-in-hex": "privatekey",
// "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.

View File

@ -1,6 +1,6 @@
{
"name": "bostr",
"version": "2.0.5",
"version": "2.0.6",
"description": "Nostr relay bouncer",
"main": "index.js",
"scripts": {