Skip to content

Commit 970fcaa

Browse files
authored
chore: update nostr-rs-relay db location and address setting (#65)
1 parent 341d2e3 commit 970fcaa

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

pkg/relays/nostr_rs_relay/constants.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Type=simple
2222
User=nostr
2323
Group=nostr
2424
WorkingDirectory=/home/nostr
25-
ExecStart={{.BinaryFilePath}}
25+
Environment=RUST_LOG=info,nostr_rs_relay=info
26+
ExecStart={{.BinaryFilePath}} --config /etc/nostr-rs-relay/config.toml --db /var/lib/nostr-rs-relay/db
2627
Restart=on-failure
2728
2829
[Install]

pkg/relays/nostr_rs_relay/nginx_http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func ConfigureNginxHttp(domainName string) {
2323
}
2424
2525
upstream nostr_rs_relay_websocket {
26-
server 127.0.0.1:8080;
26+
server 0.0.0.0:8080;
2727
}
2828
2929
server {

pkg/relays/nostr_rs_relay/nginx_https.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func ConfigureNginxHttps(domainName string) {
2020
}
2121
2222
upstream nostr_rs_relay_websocket {
23-
server 127.0.0.1:8080;
23+
server 0.0.0.0:8080;
2424
}
2525
2626
server {

pkg/relays/nostr_rs_relay/service.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func SetupRelayService(domain, pubKey, relayContact string, httpsEnabled bool) {
1717
// Ensure the data directory exists and set ownership
1818
spinner.UpdateText("Creating data directory...")
1919
directories.CreateDirectory(DataDirPath, 0755)
20+
directories.CreateDirectory(fmt.Sprintf("%s/db", DataDirPath), 0755)
2021

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

49-
// Construct the sed command to change the address
50-
files.InPlaceEdit(fmt.Sprintf(`s|address = ".*"|address = "127.0.0.1"|`), TmpConfigFilePath)
51-
5250
// Construct the sed command to change the remote ip header
5351
files.InPlaceEdit(fmt.Sprintf(`s|#remote_ip_header = "x-forwarded-for"|remote_ip_header = "x-forwarded-for"|`), TmpConfigFilePath)
5452

0 commit comments

Comments
 (0)