Skip to content

Commit

Permalink
chore: update nostr-rs-relay db location and address setting (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiarulli authored Oct 31, 2024
1 parent 341d2e3 commit 970fcaa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pkg/relays/nostr_rs_relay/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Type=simple
User=nostr
Group=nostr
WorkingDirectory=/home/nostr
ExecStart={{.BinaryFilePath}}
Environment=RUST_LOG=info,nostr_rs_relay=info
ExecStart={{.BinaryFilePath}} --config /etc/nostr-rs-relay/config.toml --db /var/lib/nostr-rs-relay/db
Restart=on-failure
[Install]
Expand Down
2 changes: 1 addition & 1 deletion pkg/relays/nostr_rs_relay/nginx_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func ConfigureNginxHttp(domainName string) {
}
upstream nostr_rs_relay_websocket {
server 127.0.0.1:8080;
server 0.0.0.0:8080;
}
server {
Expand Down
2 changes: 1 addition & 1 deletion pkg/relays/nostr_rs_relay/nginx_https.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func ConfigureNginxHttps(domainName string) {
}
upstream nostr_rs_relay_websocket {
server 127.0.0.1:8080;
server 0.0.0.0:8080;
}
server {
Expand Down
4 changes: 1 addition & 3 deletions pkg/relays/nostr_rs_relay/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func SetupRelayService(domain, pubKey, relayContact string, httpsEnabled bool) {
// Ensure the data directory exists and set ownership
spinner.UpdateText("Creating data directory...")
directories.CreateDirectory(DataDirPath, 0755)
directories.CreateDirectory(fmt.Sprintf("%s/db", DataDirPath), 0755)

// Use chown command to set ownership of the data directory to the nostr user
directories.SetOwnerAndGroup(relays.User, relays.User, DataDirPath)
Expand Down Expand Up @@ -46,9 +47,6 @@ func SetupRelayService(domain, pubKey, relayContact string, httpsEnabled bool) {
// Construct the sed command to change the data directory
files.InPlaceEdit(fmt.Sprintf(`s|#data_directory = ".*"|data_directory = "%s"|`, DataDirPath), TmpConfigFilePath)

// Construct the sed command to change the address
files.InPlaceEdit(fmt.Sprintf(`s|address = ".*"|address = "127.0.0.1"|`), TmpConfigFilePath)

// Construct the sed command to change the remote ip header
files.InPlaceEdit(fmt.Sprintf(`s|#remote_ip_header = "x-forwarded-for"|remote_ip_header = "x-forwarded-for"|`), TmpConfigFilePath)

Expand Down

0 comments on commit 970fcaa

Please sign in to comment.