Skip to content

Commit 3bcecdc

Browse files
authored
docs: document autostart Haven on macOS
Update README.md
2 parents ee18018 + c41867a commit 3bcecdc

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ cp relays_blastr.example.json relays_blastr.json
8080

8181
The JSON should contain an array of relay URLs, which default to wss:// if you don't explicitly specify the protocol.
8282

83-
### 4. Create a Systemd Service
83+
### 4. Run on System Startup
8484

85+
### Linux - Create a Systemd Service
8586
To have the relay run as a service, create a systemd unit file. Make sure to limit the memory usage to less than your system's total memory to prevent the relay from crashing the system.
8687
Replace the values for `ExecStart` and `WorkingDirectory` with the actual paths where you installed Haven and stored the `.env` file.
8788

@@ -128,6 +129,28 @@ sudo systemctl start haven
128129
sudo systemctl enable haven
129130
```
130131

132+
### MacOS - Create a login item App
133+
To have the relay run on boot, create a script that will open terminal and run the haven binary, the termainal will remain open and the relay running with it. Be sure the download /haven directory is locacted in the MacOS home folder ~/
134+
135+
1. Create the App: Open Script Editor
136+
137+
2. Add the following contents:
138+
139+
```ini
140+
tell application "Terminal"
141+
activate
142+
do script "cd \"$HOME/haven\"; ./haven; exec $SHELL"
143+
end tell
144+
```
145+
3. Save in Applications folder
146+
147+
4. Open System Settings - General - Login Items
148+
Hit the plus, add run_haven from Applications folder
149+
150+
5. Reboot - On initial restart and terminal auto-open choose “allow”
151+
152+
6. Reboot again to test login item
153+
131154
### 5. Serving over nginx (optional)
132155

133156
To have a domain name (example: relay.domain.com) point to your machine, you will need to setup an nginx.

0 commit comments

Comments
 (0)