send ["OK",false,"auth-required: blah"] should be enough, i forget exactly, but the client has to expect that and queue the request to send it out after doing the auth and getting the OK true
i forget how the CLOSE envelope plays into it, but i do know that replicatr does it correctly, lemme dig it up...
no, it's CLOSED envelope:
https://github.com/Hubmakerlabs/replicatr/blob/main/app/auth.go
and then after that you send the AUTH envelope with the challenge to the client
and here is my client side code, this shoud help the client devs a bit at least:
this is a simple auth tester:
https://github.com/Hubmakerlabs/replicatr/blob/main/cmd/authr/authr.go
this shows how it's used in a client (this one can auth to two relays and pull from one and push to the other):
https://github.com/Hubmakerlabs/replicatr/blob/main/cmd/ingestr/app/ingest.go
of course nobody pays attention to me, but i've actually written both sides of it, fiatjaf wrote some fragments of parts of it but i wasn't able to find anything that actually demonstrated how to string it together
yes, this works with coracle btw on the client side
hell, replicatr works perfectly as a relay except after about 24 hours it has some weird resource leak that eats CPU that's why it isn't in production
if you can find it and fix it i'll pay a reasonable amount of sats for doing it, it's embarrassing that i couldn't find that bastard thing... it's instrumented with profiling and runtime configuration settings and everything, drove me nuts
most likely i made the bug, also, but probably thanks to how convoluted fiatjaf's goroutine spawning is written
I am pretty sure auth is working I tested with a bunch of clients and use it with ndk, but the mystery of the giftwraps. I tried your tool, it has mleku.net deps still lingering I can't build it.
ah crap, i better fix that tomorrow
not sure why you aren't getting them from the go module proxy cache tho
yeah, tomorrow...
i'm currently working on a count encoder that appends to a buffer you pass it so you can reuse the buffer
i'm getting that done now btw, just running tests after moving all the required content into place so it's a monorepo then i'll check that everything in cmd and the root build correctly also, won't be long (one of the tests runs for a while haha)
it's done btw, you should now be able to do like
go install github.com/Hubmakerlabs/replicatr/cmd/ingestr
and have it pull and build it, anyhow, it's there, i needed to fix it, i forgot it was totally broken
go install github.com/Hubmakerlabs/replicatr/cmd/ingestr@latest
lol
go install github.com/Hubmakerlabs/replicatr/cmd/ingestr@v1.2.17
better still, that is the actually what i just built now
me@iox:/src/github.com/Hubmakerlabs/replicatr$ ingestr
Usage: ingestr [--nsec NSEC] [--since SINCE] [--limit LIMIT] [--interval INTERVAL] [--pause PAUSE] [--follows FOLLOWS] DOWNLOADRELAY UPLOADRELAY
error: downloadrelay is required
Thanks man, ya I found my bug. String instead of bool. 🤦♂️
i saw that, was just thinking maybe something in that stuff might have helped with the auth flow is all