mirror of
https://github.com/studiokaiji/nostr-webhost.git
synced 2025-12-17 14:54:31 +01:00
nostrhコマンドをhostrに変更
This commit is contained in:
0
nostrh/.gitignore → hostr/.gitignore
vendored
0
nostrh/.gitignore → hostr/.gitignore
vendored
@@ -12,10 +12,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/consts"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/consts"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/keystore"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/keystore"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/relays"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/relays"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/tools"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/tools"
|
||||||
"golang.org/x/net/html"
|
"golang.org/x/net/html"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/nbd-wtf/go-nostr/nip19"
|
"github.com/nbd-wtf/go-nostr/nip19"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/paths"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/paths"
|
||||||
)
|
)
|
||||||
|
|
||||||
const PATH = ".nostr_account_secret"
|
const PATH = ".nostr_account_secret"
|
||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/paths"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/paths"
|
||||||
)
|
)
|
||||||
|
|
||||||
const PATH = ".nostr_relays"
|
const PATH = ".nostr_relays"
|
||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/nbd-wtf/go-nostr/nip19"
|
"github.com/nbd-wtf/go-nostr/nip19"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/consts"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/consts"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/relays"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/relays"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Start(port string) {
|
func Start(port string) {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
module github.com/studiokaiji/nostr-webhost/nostrh
|
module github.com/studiokaiji/nostr-webhost/hostr
|
||||||
|
|
||||||
go 1.21
|
go 1.21
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/deploy"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/deploy"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/keystore"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/keystore"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/relays"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/relays"
|
||||||
"github.com/studiokaiji/nostr-webhost/nostrh/cmd/server"
|
"github.com/studiokaiji/nostr-webhost/hostr/cmd/server"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ func main() {
|
|||||||
key := nostr.GeneratePrivateKey()
|
key := nostr.GeneratePrivateKey()
|
||||||
err := keystore.SetSecret(key)
|
err := keystore.SetSecret(key)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fmt.Print("🗝 Generated key\n🗝 You can check the public key with 'nostrh show-public'\n")
|
fmt.Print("🗝 Generated key\n🗝 You can check the public key with 'hostr show-public'\n")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
},
|
},
|
||||||
12
readme.md
12
readme.md
@@ -13,7 +13,7 @@ Domain-based authorization mechanisms such as NIP-7 should not currently be used
|
|||||||
|
|
||||||
To get started with Nostr Webhost, follow these steps:
|
To get started with Nostr Webhost, follow these steps:
|
||||||
|
|
||||||
1. `go install github.com/studiokaiji/nostr-webhost/nostrh@latest`
|
1. `go install github.com/studiokaiji/nostr-webhost/hostr@latest`
|
||||||
|
|
||||||
### ⌨️ Commands
|
### ⌨️ Commands
|
||||||
|
|
||||||
@@ -34,15 +34,15 @@ COMMANDS:
|
|||||||
|
|
||||||
1. Install Nostr Webhost as mentioned above.
|
1. Install Nostr Webhost as mentioned above.
|
||||||
2. Set or generate private key
|
2. Set or generate private key
|
||||||
If you set private key: `nostrh set-private "nsec or hex private key"`
|
If you set private key: `hostr set-private "nsec or hex private key"`
|
||||||
Or if you want to generate private key: `nostrh generate-key`
|
Or if you want to generate private key: `hostr generate-key`
|
||||||
3. Add relay
|
3. Add relay
|
||||||
`nostrh add-relay wss://r.hostr.cc`
|
`hostr add-relay wss://r.hostr.cc`
|
||||||
4. Deploy
|
4. Deploy
|
||||||
`nostrh deploy /BUILT/SPA/DIR/PATH`
|
`hostr deploy /BUILT/SPA/DIR/PATH`
|
||||||
The event id of index.html will be output after deploy. Please make a copy of it.
|
The event id of index.html will be output after deploy. Please make a copy of it.
|
||||||
5. Start test web server
|
5. Start test web server
|
||||||
`nostrh start`
|
`hostr start`
|
||||||
6. Access the `http://localhost:3000/e/{event-id-of-index.html}`
|
6. Access the `http://localhost:3000/e/{event-id-of-index.html}`
|
||||||
|
|
||||||
For detailed information on how to use each command, you can use the `help` command followed by the specific command name.
|
For detailed information on how to use each command, you can use the `help` command followed by the specific command name.
|
||||||
|
|||||||
Reference in New Issue
Block a user