postiz-app icon indicating copy to clipboard operation
postiz-app copied to clipboard

nostr issues - no name and can't post

Open pypeaday opened this issue 6 months ago • 8 comments

📜 Description

I added one of my nostr private keys to add a nostr channel to postiz but seems like there's some issues with it as the channel shows up with "No Name" and posting doesn't result in anything... I"m not even really sure how it would unless there's some default relays built-in but I can't claim to be an expert in nostr or postiz but when I try to post I see this error in the postiz container logs

[0] 2|workers  | [Error] posting on nostr Error: private key must be 32 bytes, hex or bigint, not string

[0] 2|workers  |     at Object.normPrivateKeyToScalar (/app/node_modules/nostr-tools/node_modules/@noble/curves/abstract/weierstrass.js:161:19)

[0] 2|workers  |     at schnorrGetExtPubKey (/app/node_modules/nostr-tools/node_modules/@noble/curves/secp256k1.js:113:38)

[0] 2|workers  |     at Object.schnorrGetPublicKey [as getPublicKey] (/app/node_modules/nostr-tools/node_modules/@noble/curves/secp256k1.js:144:12)

[0] 2|workers  |     at finalizeEvent (/app/node_modules/nostr-tools/lib/cjs/index.js:237:74)

[0] 2|workers  |     at NostrProvider.post (/app/apps/workers/dist/libraries/nestjs-libraries/src/integrations/social/nostr.provider.js:137:63)

[0] 2|workers  |     at PostsService.postSocial (/app/apps/workers/dist/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.js:261:57)

[0] 2|workers  |     at async PostsService.post (/app/apps/workers/dist/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.js:172:19)

[0] 2|workers  |     at async /app/node_modules/@nestjs/microservices/context/rpc-proxy.js:11:32

[0] 2|workers  |     at async bullmq_1.Worker.concurrency [as processFn] (/app/apps/workers/dist/libraries/nestjs-libraries/src/bull-mq-transport-new/strategy.js:19:60)

[0] 2|workers  |     at async /app/node_modules/bullmq/dist/cjs/classes/worker.js:521:32

[0] 2|workers  |     at async Worker.retryIfFailed (/app/node_modules/bullmq/dist/cjs/classes/worker.js:746:24)

do I need to format my private key some other way then nsec***

👟 Reproduction steps

  1. generate a nostr public/private key pair using any easy nostr client... it's been a while but maybe you could generate fresh ones on https://coracle.social/ easily enough
  2. add the private key to postiz
  3. try to post something but get an error in the logs

👍 Expected behavior

It should post to nostr to some set of relays

👎 Actual Behavior with Screenshots

An error shows up in the logs that I pasted above

💻 Operating system

Linux

🤖 Node Version

20.18.1

📃 Provide any additional context for the Bug.

docker image: sha256:277537ca325a71faef0ed42f6cc4cb912df8cafede48f8f4e112b11eb5fc4a88

👀 Have you spent some time to check if this bug has been raised before?

  • [x] I checked and didn't find similar issue

Are you willing to submit PR?

None

pypeaday avatar Jun 03 '25 11:06 pypeaday

Where did you take the private key from? Iris works for me

nevo-david avatar Jun 04 '25 04:06 nevo-david

oh you were quick and I just saw this notification in github

I grabbed my private key from primal

pypeaday avatar Jun 16 '25 11:06 pypeaday

Can you try the hex key?

On Mon, Jun 16, 2025 at 6:03 PM pypeaday @.***> wrote:

pypeaday left a comment (gitroomhq/postiz-app#772) https://github.com/gitroomhq/postiz-app/issues/772#issuecomment-2976109919

oh you were quick and I just saw this notification in github

I grabbed my private key from primal

— Reply to this email directly, view it on GitHub https://github.com/gitroomhq/postiz-app/issues/772#issuecomment-2976109919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX32VBXISEJKNVM7OPNYQF33D2QAVAVCNFSM6AAAAAB6PQWAV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNZWGEYDSOJRHE . You are receiving this because you commented.Message ID: @.***>

nevo-david avatar Jun 16 '25 11:06 nevo-david

gladly, I'm just not sure where to get that... are you saying to encode my private key? or can I get that value from somewhere

pypeaday avatar Jun 16 '25 12:06 pypeaday

since we're here, do you have any quick comments, assuming this hex key works, for configuring the relays to post to? maybe the login not working is hiding something but I couldn't figure out where I would do that if I wasn't experiencing the login issue

pypeaday avatar Jun 16 '25 12:06 pypeaday

ok I just chatgpt'd it and got a little farther... after hexifying my private key it looks like I at least got past the error about the type... but when I go to post here's a log

[0] 3|backend  | connecting

[0] 3|backend  | {

[0] 3|backend  |   "type": "now",

[0] 3|backend  |   "inter": null,

[0] 3|backend  |   "tags": [],

[0] 3|backend  |   "shortLink": false,

[0] 3|backend  |   "date": "2025-06-18T15:19:00",

[0] 3|backend  |   "posts": [

[0] 3|backend  |     {

[0] 3|backend  |       "integration": {

[0] 3|backend  |         "name": "No Name",

[0] 3|backend  |         "id": "cmbgf5oko0001ra99r9vzv1fj",

[0] 3|backend  |         "internalId": "undefined",

[0] 3|backend  |         "disabled": false,

[0] 3|backend  |         "picture": null,

[0] 3|backend  |         "identifier": "nostr",

[0] 3|backend  |         "inBetweenSteps": false,

[0] 3|backend  |         "refreshNeeded": false,

[0] 3|backend  |         "isCustomFields": true,

[0] 3|backend  |         "customFields": [

[0] 3|backend  |           {

[0] 3|backend  |             "key": "password",

[0] 3|backend  |             "label": "Nostr private key",

[0] 3|backend  |             "validation": "/^.{3,}$/",

[0] 3|backend  |             "type": "password"

[0] 3|backend  |           }

[0] 3|backend  |         ],

[0] 3|backend  |         "display": "nic",

[0] 3|backend  |         "type": "social",

[0] 3|backend  |         "time": [

[0] 3|backend  |           {

[0] 3|backend  |             "time": 860

[0] 3|backend  |           },

[0] 3|backend  |           {

[0] 3|backend  |             "time": 1150

[0] 3|backend  |           },

[0] 3|backend  |           {

[0] 3|backend  |             "time": 1440

[0] 3|backend  |           }

[0] 3|backend  |         ],

[0] 3|backend  |         "changeProfilePicture": false,

[0] 3|backend  |         "changeNickName": false,

[0] 3|backend  |         "customer": null,

[0] 3|backend  |         "additionalSettings": "[]"

[0] 3|backend  |       },

[0] 3|backend  |       "value": [

[0] 3|backend  |         {

[0] 3|backend  |           "id": "cmc23l2z70007qha1z42fdy91",

[0] 3|backend  |           "content": "test from posiz😀",

[0] 3|backend  |           "image": []

[0] 3|backend  |         }

[0] 3|backend  |       ],

[0] 3|backend  |       "valid": true,

[0] 3|backend  |       "group": "a186c2a2-f52c-4db4-9774-39d98b6d4ef6",

[0] 3|backend  |       "settings": {}

[0] 3|backend  |     }

[0] 3|backend  |   ]

[0] 3|backend  | }

[0] 3|backend  | event to dispatch:  {

[0] 3|backend  |   pattern: 'post',

[0] 3|backend  |   data: {

[0] 3|backend  |     id: 'cmc23l2z70007qha1z42fdy91',

[0] 3|backend  |     options: { delay: 0 },

[0] 3|backend  |     payload: { id: 'cmc23l2z70007qha1z42fdy91', delay: 0 }

[0] 3|backend  |   }

[0] 3|backend  | }

[0] 2|workers  | processing { id: 'cmc23l2z70007qha1z42fdy91', delay: 0 }

[0] 2|workers  | NOTICE from wss://relay.primal.net/: ERROR: bad req: uneven size input to from_hex

[0] 2|workers  | NOTICE from wss://relay.damus.io/: ERROR: bad req: uneven size input to from_hex

[0] 2|workers  | NOTICE from wss://relay.snort.social/: ERROR: bad req: uneven size input to from_hex

[0] 2|workers  | NOTICE from wss://nostr.wine/: ERROR: bad req: uneven size input to from_hex

[0] 2|workers  | NOTICE from wss://nos.lol/: ERROR: bad req: uneven size input to from_hex

[0] 2|workers  | NOTICE from wss://relay.primal.net/: ERROR: bad req: uneven size input to from_hex

[0] 2|workers  | event to dispatch:  {

[0] 2|workers  |   pattern: 'sendDigestEmail',

[0] 2|workers  |   data: {

[0] 2|workers  |     id: 'digest_f0c8bb02-f095-4350-aff9-f0311e890af6',

[0] 2|workers  |     options: { delay: 60000 },

[0] 2|workers  |     payload: {

[0] 2|workers  |       subject: 'Your post has been published on Nostr',

[0] 2|workers  |       org: 'f0c8bb02-f095-4350-aff9-f0311e890af6',

[0] 2|workers  |       since: '2025-06-18T15:25:08.681Z'

[0] 2|workers  |     }

[0] 2|workers  |   }

[0] 2|workers  | }

[0] 2|workers  | event to dispatch:  {

[0] 2|workers  |   pattern: 'webhooks',

[0] 2|workers  |   data: {

[0] 2|workers  |     id: 'digest_f0c8bb02-f095-4350-aff9-f0311e890af6',

[0] 2|workers  |     options: { delay: 60000 },

[0] 2|workers  |     payload: {

[0] 2|workers  |       org: 'f0c8bb02-f095-4350-aff9-f0311e890af6',

[0] 2|workers  |       since: '2025-06-18T15:24:00'

[0] 2|workers  |     }

[0] 2|workers  |   }

[0] 2|workers  | }

pypeaday avatar Jun 18 '25 15:06 pypeaday

Ok... so I logged into coracle and saw my posts there... decided to try again and the posting is working but there are issues...

  1. the logs are still showing errors for each relay, just as above
  2. in postiz it still says I'm "No Name" but in coracle the notes are showing up appropriately, so that's probably just some front-end issues? idk where the responsibility would be for that relative to the errors on the relays

glad it's actually functioning, just a little rough around the edges I suppose

pypeaday avatar Jun 18 '25 21:06 pypeaday

confirmed:

you need the nsec in hex format

the name parsing is not working. just shows "No Name" for the nostr account

yeahoffline avatar Sep 07 '25 21:09 yeahoffline