Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update nostr-rs-relay db location and address setting #65

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading