Skip to content

Commit 72fdc49

Browse files
committed
docs: Rework tutorial section with new conventions and system sevices
Signed-off-by: Felicitas Pojtinger <[email protected]>
1 parent 6cae594 commit 72fdc49

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

README.md

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ To self-host, see [contributing](#contributing). A `.tar.gz` archive of the fron
7171

7272
## Tutorial
7373

74+
> TL;DR: Setup OIDC authentication, configure the backend, start the backend, open up a port on the firewall, and connect using the frontend
75+
7476
### 1. Setting up Authentication
7577

7678
bofied uses [OpenID Connect](https://en.wikipedia.org/wiki/OpenID_Connect) for authentication, which means you can use almost any authentication provider, both self-hosted and as a service, that you want to. We've created a short tutorial video which shows how to set up [Auth0](https://auth0.com/) for this purpose, but feel free to use something like [Ory](https://github.com/ory/hydra) if you prefer a self-hosted solution:
@@ -103,17 +105,17 @@ $ ip -4 a
103105

104106
In the following, we'll assume that `192.168.178.147` is the IP address of this node.
105107

106-
### 4 (Option 1): Starting the Backend (Containerized)
108+
### 4. Starting the Backend
107109

108-
Using Docker (or an alternative like Podman), you can now easily start & configure the backend; see the [Reference](#reference) for more configuration parameters:
110+
Next up is starting the backend. It is available both in containerized and static binary form; see the [Reference](#reference) for more configuration parameters:
109111

110112
<details>
111-
<summary>Expand containerized installation instructions</summary>
113+
<summary>Expand containerized instructions</summary>
112114

113115
Run the following:
114116

115-
```shell
116-
$ docker run \
117+
```console
118+
$ sudo podman run \
117119
--name bofied-backend \
118120
-d \
119121
--restart always \
@@ -124,28 +126,30 @@ $ docker run \
124126
-e BOFIED_BACKEND_OIDCCLIENTID=myoidcclientid \
125127
-e BOFIED_BACKEND_ADVERTISEDIP=192.168.178.147 \
126128
pojntfx/bofied-backend
129+
$ sudo podman generate systemd --new bofied-backend | sudo tee /lib/systemd/system/bofied-backend.service
130+
131+
$ sudo systemctl daemon-reload
132+
133+
$ sudo systemctl enable --now bofied-backend
127134
```
128135

129136
The logs are available like so:
130137

131-
```shell
132-
$ docker logs bofied-backend
138+
```console
139+
$ journalctl -u bofied-backend
133140
```
134141

135142
</details>
136143

137-
### 4 (Option 2): Starting the Backend (Natively)
138-
139-
If you prefer a native setup, a non-containerized installation is also possible.
140-
141144
<details>
142-
<summary>Expand native installation instructions</summary>
145+
<summary>Expand native instructions</summary>
143146

144147
First, set up a config file at `~/.local/share/bofied/etc/bofied/bofied-backend-config.yaml`; see the [Reference](#reference) for more configuration parameters:
145148

146-
```shell
147-
$ mkdir -p ~/.local/share/bofied/etc/bofied/
148-
$ cat <<EOT >~/.local/share/bofied/etc/bofied/bofied-backend-config.yaml
149+
```console
150+
$ sudo su
151+
# mkdir -p ~/.local/share/bofied/etc/bofied/
152+
# cat <<EOT >~/.local/share/bofied/etc/bofied/bofied-backend-config.yaml
149153
oidcIssuer: https://pojntfx.eu.auth0.com/
150154
oidcClientID: myoidcclientid
151155
advertisedIP: 192.168.178.147
@@ -154,11 +158,10 @@ EOT
154158

155159
Now, create a systemd service for it:
156160

157-
```shell
158-
$ mkdir -p ~/.config/systemd/user/
159-
$ cat <<EOT >~/.config/systemd/user/bofied-backend.service
161+
```console
162+
$ sudo tee /etc/systemd/system/bofied-backend.service<<'EOT'
160163
[Unit]
161-
Description=bofied
164+
Description=bofied Backend
162165

163166
[Service]
164167
ExecStart=/usr/local/bin/bofied-backend -c \${HOME}/.local/share/bofied/etc/bofied/bofied-backend-config.yaml
@@ -170,24 +173,24 @@ EOT
170173

171174
Finally, reload systemd and enable the service:
172175

173-
```shell
174-
$ systemctl --user daemon-reload
175-
$ systemctl --user enable --now bofied-backend
176+
```console
177+
$ sudo systemctl daemon-reload
178+
$ sudo systemctl enable --now bofied-backend
176179
```
177180

178181
You can get the logs like so:
179182

180-
```shell
181-
$ journalctl --user -u bofied-backend
183+
```console
184+
$ journalctl -u bofied-backend
182185
```
183186

184-
</details>
187+
</details>
185188

186189
### 5. Setting up the Firewall
187190

188191
You might also have to open up the ports on your firewall:
189192

190-
```shell
193+
```console
191194
$ for port in 67/udp 4011/udp 69/udp 15256/tcp 15257/tcp; do sudo firewall-cmd --permanent --add-port=${port}; done
192195
```
193196

@@ -197,7 +200,7 @@ Now that the backend is running, head over to [https://pojntfx.github.io/bofied/
197200

198201
[<img src="https://github.com/alphahorizonio/webnetesctl/raw/main/img/launch.png" width="240">](https://pojntfx.github.io/bofied/)
199202

200-
Alternatively, as described in [About the Frontend](#about-the-frontend), you can also choose to self-host. Once you're on the page, you should be presented with the following setup page:
203+
Alternatively, as described in [Frontend](#frontend), you can also choose to self-host. Once you're on the page, you should be presented with the following setup page:
201204

202205
![Setup page](./assets/setup.png)
203206

@@ -245,7 +248,7 @@ Click on an image to see a larger version.
245248

246249
### Command Line Arguments
247250

248-
```shell
251+
```console
249252
$ bofied-backend --help
250253
bofied is a network boot server. It provides everything you need to PXE boot a node, from a (proxy)DHCP server for PXE service to a TFTP and HTTP server to serve boot files.
251254

@@ -266,7 +269,7 @@ Flags:
266269
--proxyDHCPListenAddress string Listen address for proxyDHCP server (default ":4011")
267270
-p, --pureConfig Configuration Prevent usage of stdlib in configuration file, even if enabled in Configuration function
268271
-s, --skipStarterDownload Don't initialize by downloading the starter on the first run
269-
--starterURL string Download URL to a starter .tar.gz archive; the default chainloads https://netboot.xyz/ (default "https://github.com/pojntfx/ipxe-binaries/releases/download/latest/ipxe.tar.gz")
272+
--starterURL string Download URL to a starter .tar.gz archive; the default chainloads https://netboot.xyz/ (default "https://github.com/pojntfx/ipxe-binaries/releases/latest/download/ipxe.tar.gz")
270273
--tftpListenAddress string Listen address for TFTP server (default ":69")
271274
-d, --workingDir string Working directory (default "/home/pojntfx/.local/share/bofied/var/lib/bofied")
272275
```
@@ -402,7 +405,7 @@ To contribute, please use the [GitHub flow](https://guides.github.com/introducti
402405

403406
To build and start a development version of bofied locally, run the following:
404407

405-
```shell
408+
```console
406409
$ git clone https://github.com/pojntfx/bofied.git
407410
$ cd bofied
408411
$ make depend

0 commit comments

Comments
 (0)