diff --git a/README.md b/README.md index ae5828e..73fc4e4 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ TODO 3. Download [Soapbox](https://dl.soapbox.pub/) or another web-based Mastodon client of your choice. 4. Put the frontend files inside the `public` directory. 5. Create an `.env` file. -6. Define `DITTO_NSEC=` in your .env file. You can generate an nsec by installing [nak](https://github.com/fiatjaf/nak) and running `nak key generate | nak encode nsec`. +6. Define `DITTO_NSEC=` in your .env file. You can generate an nsec by running `deno task nsec`. 7. Run `deno task dev`. ## License diff --git a/deno.json b/deno.json index a552b64..99f1eb0 100644 --- a/deno.json +++ b/deno.json @@ -7,7 +7,8 @@ "debug": "deno run -A --unstable-ffi --inspect src/server.ts", "test": "DB_PATH=\":memory:\" deno test -A --unstable-ffi", "check": "deno check src/server.ts", - "relays:sync": "deno run -A --unstable-ffi scripts/relays.ts sync" + "relays:sync": "deno run -A --unstable-ffi scripts/relays.ts sync", + "nsec": "deno run scripts/nsec.ts" }, "exclude": ["./public"], "imports": { "@/": "./src/", "@soapbox/nspec": "jsr:@soapbox/nspec@^0.8.1", "~/fixtures/": "./fixtures/" }, diff --git a/scripts/nsec.ts b/scripts/nsec.ts new file mode 100644 index 0000000..b0da325 --- /dev/null +++ b/scripts/nsec.ts @@ -0,0 +1,6 @@ +import { generateSecretKey, nip19 } from 'npm:nostr-tools'; + +const sk = generateSecretKey(); +const nsec = nip19.nsecEncode(sk); + +console.log(nsec);