tada, with destructions

This commit is contained in:
mleku
2023-10-29 18:32:43 -01:00
parent 0322b76f76
commit 07241bee58
4 changed files with 70 additions and 2 deletions

View File

@@ -1,2 +1,62 @@
# namestr # namestr
simple, zero configuration NIP-05 with LetsEncrypt TLS security simple, zero configuration NIP-05 with LetsEncrypt TLS security
## usage
install go on your VPS, clone this repo:
git clone https://github.com/mleku/namestr.git
build it:
cd namestr
go build
make it so it can listen on ports under 1024:
sudo setcap 'cap_net_bind_service=+ep'
make the proper location for the binary to go:
mkdir -p ~/.local/bin
move the built binary there:
mv namestr ~/.local/bin/
create a file in the following path
touch /home/<username>/.local/bin/namestrt
chmod +x /home/<username>/.local/bin/namestrt
put the details of your desired setup with the parameters you use to launch namestr:
#!/usr/bin/bash
/home/<username>/.local/bin/namestr -vc mleku.online npub1mlekuhhxqq6p8w9x5fs469cjk3fu9zw7uptujr55zmpuhhj48u3qnwx3q5 a.nos.lol bevo.nostr1.com bitcoiner.social nos.lol nostr.wine relay.nostr.band Bevo.nostr1.com ae.purplerelay.com nostr.plebchain.org christpill.nostr1.com relay.nostr.me relay.devstr.org relay.primal.net
The `-vc` enables logging, which prints the URL requests that came in. it only sends a proper answer to the NIP-05 request path, all others return the text "gfy". (hah, if you want to change it, just edit the file `cmd/root.go` and look for "gfy" and change it)
after that is the domain name. this is intended for a domain name that is your nostr display name, mleku.online in my case.
after that, you put the npub. this is automatically decoded to hex for the json response.
after that, zero or more of just the domain names of the relays that you usually use to post with. the `wss://` prefix is not needed.
chmod +x /home/<username>/.local/bin/namestrt
edit the service definition to suit the username you set up on your vps.
mine was 'me' and it appears twice in the service file, one after User and the other in the ExecStart.
edit these to fit the username you created on the VPS.
Then, copy the service using sudo to the correct location:
sudo cp namestr.service /etc/systemd/system/
and then start 'er up:
sudo systemctl enable --now namestr
enjoy your shiny new domain NIP-05 nostr/domain name.

1
go.mod
View File

@@ -3,7 +3,6 @@ module github.com/mleku/namestr
go 1.20 go 1.20
require ( require (
github.com/davecgh/go-spew v1.1.1
github.com/gin-gonic/autotls v0.0.5 github.com/gin-gonic/autotls v0.0.5
github.com/gookit/color v1.5.4 github.com/gookit/color v1.5.4
github.com/mleku/appdata v1.0.0 github.com/mleku/appdata v1.0.0

1
go.sum
View File

@@ -1,6 +1,5 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/blake256 v1.1.0 h1:4AuEhGPT/3TTKFhTfBpZ8hgZE7wJpawcYaEawwsbtqM= github.com/dchest/blake256 v1.1.0 h1:4AuEhGPT/3TTKFhTfBpZ8hgZE7wJpawcYaEawwsbtqM=
github.com/dchest/blake256 v1.1.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY= github.com/dchest/blake256 v1.1.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY=
github.com/gin-gonic/autotls v0.0.5 h1:SXQWwWGDJHujDlthIij1+jxn3m5IPV8I9Za9bcPzMdo= github.com/gin-gonic/autotls v0.0.5 h1:SXQWwWGDJHujDlthIij1+jxn3m5IPV8I9Za9bcPzMdo=

10
namestr.service Normal file
View File

@@ -0,0 +1,10 @@
[Unit]
Description=namestr
[Service]
Type=simple
User=me
ExecStart=/home/me/.local/bin/namestrt
[Install]
WantedBy=multi-user.target