Update README.md

This commit is contained in:
Willem Grobler
2022-02-12 11:03:24 +02:00
committed by GitHub
parent 95d319a4bc
commit a520d486dd

View File

@@ -11,7 +11,7 @@ The service will be run as user 'boringproxy'. Runnning the service as root is n
Add user "boringproxy"
```bash
useradd -M boringproxy
useradd -s /bin/bash -d /home/boringproxy/ -m boringproxy;
```
Add group "boringproxy"
@@ -24,6 +24,11 @@ Add user "boringproxy" to group "boringproxy"
usermod -a -G boringproxy boringproxy
```
Create SSH folder for user. BoringProxy assumes the folder already exists. If it does not exist, the program will fail to add tunnels.
```bash
mkdir /home/boringproxy/.ssh
```
### Download & edit service file
Copy service file from GitHub
@@ -45,11 +50,41 @@ Make sure the file exists, otherwise move file from the current directory to ***
mv ./boringproxy /usr/local/bin/boringproxy
```
### Install service file to systemd
Copy service file to "/etc/systemd/system/"
```bash
mv ./boringproxy-server.service /etc/systemd/system/
```
Reload the service files to include the new service.
```bash
systemctl daemon-reload
```
### Manual start (once off only)
When boringproxy start for the first time, it requires a manual input of your email address. This email address will be used when registering Certificates with Let's Encrypt.
By stating the server manually, you can enter the required information and ensure the server is starting correctly under the new user.
To start the server, you will need to change the current directory to your WorkingDirectory (as indicated in your service file) and then run the ExecStart command (as indicated in your service file). If you made changes to the default WorkingDirectory or boringproxy executable file path, change the command below accordingly.
Change the admin-domain in the command below to your admin-domain and enter your email address when prompted
```bash
runuser -l boringproxy -c 'cd /opt/boringproxy; /usr/local/bin/boringproxy server -admin-domain bp.example.com'
```
If your server was successfully started, close the running process and start it again using the service. Since the process was started as a different user, you will have to kill the foreground process (***Ctrl + C***) as well as close the process started as user boringproxy. To kill all running processes for user boringproxy, use the command below:
```bash
pkill -u boringproxy
```
To check if boringproxy is still running, you can look if a process is listening on port 443 using:
```bash
netstat -tulpn | grep LISTEN | grep 443
```
If nothing is returned, no process is currently using port 443. Alternatively you will receive a result like:
***tcp6 0 0 :::443 :::* LISTEN 9461/boringproxy ***
### Service commands
Start your service
```bash
systemctl start boringproxy-server.service