• This repository has been archived on 26/Feb/2023
  • Stars
    star
    162
  • Rank 223,999 (Top 5 %)
  • Language
    Go
  • License
    GNU Affero Genera...
  • Created about 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modern network boot server.

bofied

demo.mp4

Modern network boot server.

hydrun CI Docker CI Go Reference Matrix Docker Pulls Binary Downloads

Overview

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.

It enables you to ...

  • Boot nodes from the network: Using (proxy)DHCP for PXE service, it can configure nodes which are set to network boot
  • Serve boot files: The integrated TFTP and HTTP servers can provide the iPXE network bootloader, Linux distros or other boot files
  • Easily manage and script the network boot config: By using the browser or WebDAV, boot files can be managed and the scriptable configuration can be edited
  • Monitor network boot: By monitoring it's (proxy)DHCP and TFTP traffic, bofied can give an insight to the network boot process using a browser or the gRPC API
  • Remotely provision nodes: Because bofied is based on open web technologies and supports OpenID Connect authentication, it can be securely exposed to the public internet and be used to manage network boot in a offsite location

Installation

Containerized

You can get the Docker container like so:

$ docker pull pojntfx/bofied-backend

Natively

If you prefer a native installation, static binaries are also available on GitHub releases.

You can install them like so:

$ curl -L -o /tmp/bofied-backend https://github.com/pojntfx/bofied/releases/latest/download/bofied-backend.linux-$(uname -m)
$ sudo install /tmp/bofied-backend /usr/local/bin
$ sudo setcap cap_net_bind_service+ep /usr/local/bin/bofied-backend # This allows rootless execution

About the Frontend

The frontend is also available on GitHub releases in the form of a static .tar.gz archive; to deploy it, simply upload it to a CDN or copy it to a web server. For most users, this shouldn't be necessary though; thanks to @maxence-charriere's go-app package, bofied is a progressive web app. By simply visiting the public deployment once, it will be available for offline use whenever you need it:

Usage

1. Setting up Authentication

bofied uses 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 for this purpose, but feel free to use something like Ory if you prefer a self-hosted solution:

Setting up OpenID Connect for Internal Apps YouTube Video

2. Verifying Port Availability

First, verify that ports 67/udp, 4011/udp, 69/udp, 15256/tcp and 15257/tcp aren't in use by another app:

$ ss -tlnp | grep -E -- ':(15256|15257)'
$ ss -ulnp | grep -E -- ':(67|4011|69)'

Neither of these two commands should return anything; if they do, kill the process that listens on the port.

3. Getting the Advertised IP

bofied integrates a (proxy)DHCP server, which advertises the IP address of the integrated TFTP server. To do so, you'll have to find out the IP of the node which is running bofied; you can find it with ip a:

$ ip -4 a
# ...
2: enp0s13f0u1u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.178.147/24 brd 192.168.178.255 scope global dynamic noprefixroute enp0s13f0u1u3
       valid_lft 862274sec preferred_lft 862274sec
# ...

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

4 (Option 1): Starting the Backend (Containerized)

Using Docker (or an alternative like Podman), you can now easily start & configure the backend; see the Reference for more configuration parameters:

Expand containerized installation instructions

Run the following:

$ docker run \
    --name bofied-backend \
    -d \
    --restart always \
    --net host \
    --cap-add NET_BIND_SERVICE \
    -v ${HOME}/.local/share/bofied:/root/.local/share/bofied:z \
    -e BOFIED_BACKEND_OIDCISSUER=https://pojntfx.eu.auth0.com/ \
    -e BOFIED_BACKEND_OIDCCLIENTID=myoidcclientid \
    -e BOFIED_BACKEND_ADVERTISEDIP=192.168.178.147 \
    pojntfx/bofied-backend

The logs are available like so:

$ docker logs bofied-backend

4 (Option 2): Starting the Backend (Natively)

If you prefer a native setup, a non-containerized installation is also possible.

Expand native installation instructions

First, set up a config file at ~/.local/share/bofied/etc/bofied/bofied-backend-config.yaml; see the Reference for more configuration parameters:

$ mkdir -p ~/.local/share/bofied/etc/bofied/
$ cat <<EOT >~/.local/share/bofied/etc/bofied/bofied-backend-config.yaml
oidcIssuer: https://pojntfx.eu.auth0.com/
oidcClientID: myoidcclientid
advertisedIP: 192.168.178.147
EOT

Now, create a systemd service for it:

$ mkdir -p ~/.config/systemd/user/
$ cat <<EOT >~/.config/systemd/user/bofied-backend.service
[Unit]
Description=bofied

[Service]
ExecStart=/usr/local/bin/bofied-backend -c \${HOME}/.local/share/bofied/etc/bofied/bofied-backend-config.yaml

[Install]
WantedBy=multi-user.target
EOT

Finally, reload systemd and enable the service:

$ systemctl --user daemon-reload
$ systemctl --user enable --now bofied-backend

You can get the logs like so:

$ journalctl --user -u bofied-backend

5. Setting up the Firewall

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

$ for port in 67/udp 4011/udp 69/udp 15256/tcp 15257/tcp; do sudo firewall-cmd --permanent --add-port=${port}; done

6. Connecting the Frontend

Now that the backend is running, head over to https://pojntfx.github.io/bofied/:

Alternatively, as described in 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:

Setup page

You'll have to enter your own information here; the Backend URL is the URL on which the backend (http://localhost:15256/ by default) runs, the OIDC Issuer, Client ID and Redirect URL are the same values that you've set the backend up with above.

Finally, click on Login, and if everything worked out fine you should be presented with the initial launch screen:

Initial page

πŸš€ That's it! We hope you enjoy using bofied.

Screenshots

Click on an image to see a larger version.

Screenshot of syntax validation Screenshot of monitoring Screenshot 2 of file operations Screenshot 3 of file operations Screenshot of sharing Screenshot of the text editor Screenshot of about modal

Reference

Command Line Arguments

$ bofied-backend --help
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.

For more information, please visit https://github.com/pojntfx/bofied.

Usage:
  bofied-backend [flags]

Flags:
      --advertisedIP string                IP to advertise for DHCP clients (default "100.64.154.246")
  -c, --configFile string                  Config file to use
      --dhcpListenAddress string           Listen address for DHCP server (default ":67")
      --extendedHTTPListenAddress string   Listen address for WebDAV, HTTP and gRPC-Web server (default ":15256")
      --grpcListenAddress string           Listen address for gRPC server (default ":15257")
  -h, --help                               help for bofied-backend
  -t, --oidcClientID string                OIDC client ID (default "myoidcclientid")
  -i, --oidcIssuer string                  OIDC issuer (default "https://pojntfx.eu.auth0.com/")
      --proxyDHCPListenAddress string      Listen address for proxyDHCP server (default ":4011")
  -p, --pureConfig Configuration           Prevent usage of stdlib in configuration file, even if enabled in Configuration function
  -s, --skipStarterDownload                Don't initialize by downloading the starter on the first run
      --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")
      --tftpListenAddress string           Listen address for TFTP server (default ":69")
  -d, --workingDir string                  Working directory (default "/home/pojntfx/.local/share/bofied/var/lib/bofied")

Environment Variables

All command line arguments described above can also be set using environment variables; for example, to set --advertisedIP to 192.168.178.147 with an environment variable, use BOFIED_BACKEND_ADVERTISEDIP=192.168.178.147.

Configuration File

Just like with the environment variables, bofied can also be configured using a configuration file; see examples/bofied-backend-config.yaml for an example configuration file.

Config Script

The config script is separate from the config file and is used to dynamically decide which file to send to which node based on it's IP address, MAC address and processor architecture. It can be set & validated using either the frontend or WebDAV. The default config script, which is fetched from pojntfx/ipxe-binaries, returns a matching executable based on the architecture:

package config

func Filename(
	ip string,
	macAddress string,
	arch string,
	archID int,
) string {
	switch arch {
	case "x86 BIOS":
		return "ipxe-i386.kpxe"
	case "x86 UEFI":
		return "ipxe-i386.efi"
	case "x64 UEFI":
		return "ipxe-x86_64.efi"
	case "ARM 32-bit UEFI":
		return "ipxe-arm32.efi"
	case "ARM 64-bit UEFI":
		return "ipxe-arm64.efi"
	default:
		return "ipxe-i386.kpxe"
	}
}

func Configure() map[string]string {
	return map[string]string{
		"useStdlib": "false",
	}
}

The script is just a small Go program which exports two functions: Filename and Configure. Configure is called to configure the interpreter; for example, if you want to use the standard library, i.e. to log information with log.Println or to make a HTTP request with http.Get, you can set "useStdlib": "true",. Filename is called with the IP address, MAC address and architecture (as a string and as an ID), and should return the name of the file to send to the booting node. The following architecture values are available (see IANA Processor Architecture Types):

Expand available architecture values
archID Parameter arch Parameter
0x00 x86 BIOS
0x01 NEC/PC98 (DEPRECATED)
0x02 Itanium
0x03 DEC Alpha (DEPRECATED)
0x04 Arc x86 (DEPRECATED)
0x05 Intel Lean Client (DEPRECATED)
0x06 x86 UEFI
0x07 x64 UEFI
0x08 EFI Xscale (DEPRECATED)
0x09 EBC
0x0a ARM 32-bit UEFI
0x0b ARM 64-bit UEFI
0x0c PowerPC Open Firmware
0x0d PowerPC ePAPR
0x0e POWER OPAL v3
0x0f x86 uefi boot from http
0x10 x64 uefi boot from http
0x11 ebc boot from http
0x12 arm uefi 32 boot from http
0x13 arm uefi 64 boot from http
0x14 pc/at bios boot from http
0x15 arm 32 uboot
0x16 arm 64 uboot
0x17 arm uboot 32 boot from http
0x18 arm uboot 64 boot from http
0x19 RISC-V 32-bit UEFI
0x1a RISC-V 32-bit UEFI boot from http
0x1b RISC-V 64-bit UEFI
0x1c RISC-V 64-bit UEFI boot from http
0x1d RISC-V 128-bit UEFI
0x1e RISC-V 128-bit UEFI boot from http
0x1f s390 Basic
0x20 s390 Extended
0x21 MIPS 32-bit UEFI
0x22 MIPS 64-bit UEFI
0x23 Sunway 32-bit UEFI
0x24 Sunway 64-bit UEFI

When bofied is first started, it automatically downloads pojntfx/ipxe-binaries to the boot file directory, so without configuring anything you can already network boot many Linux distros and other operating systems thanks to netboot.xyz. This behavior can of course also be disabled, in which case only a minimal config file will be created; see Reference.

WebDAV

In addition to using the frontend to manage boot files, you can also mount them using WebDAV. You can the required credentials by using the Mount directory button in the frontend:

Mount directory modal

Using a file manager like Files, you can now mount the folder:

GNOME Files WebDAV mounting

When transfering large files, using WebDAV directly is the recommended method.

GNOME Files WebDAV listing

gRPC API

bofied exposes a streaming gRPC and gRPC-Web API for monitoring network boot, which is also in use internally in the frontend. You can find the relevant .proto files in api/proto/v1; send the OpenID Connect token with the X-Bofied-Authorization metadata key.

Acknowledgements

  • This project would not have been possible were it not for @maxence-charriere's go-app package; if you enjoy using bofied, please donate to him!
  • The open source PatternFly design system provides a professional design and reduced the need for custom CSS to a minimium (less than 30 SLOC!).
  • pin/tftp provides the TFTP functionality for bofied.
  • studio-b12/gowebdav provides the WebDAV client for the bofied frontend.
  • The yaegi Go interpreter is used to securely evaluate the config script.
  • All the rest of the authors who worked on the dependencies used! Thanks a lot!

Contributing

To contribute, please use the GitHub flow and follow our Code of Conduct.

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

$ git clone https://github.com/pojntfx/bofied.git
$ cd bofied
$ make depend
$ BOFIED_BACKEND_OIDCISSUER=https://pojntfx.eu.auth0.com/ BOFIED_BACKEND_OIDCCLIENTID=myoidcclientid BOFIED_BACKEND_ADVERTISEDIP=192.168.178.147 make dev

The backend should now be started and the frontend be available on http://localhost:15225/. Whenever you change a source file, the back- and frontend will automatically be re-compiled.

Have any questions or need help? Chat with us on Matrix!

Related Projects

If you want to have persistent inventory of services and nodes on your network or turn the nodes in it on remotely, check out liwasc!

Troubleshooting

  • If you run bofied over Wifi or advertise your Wifi adapter's IP, old PXE clients might hang at PXE errors such as TFTP cannot read from connection or TFTP read timeout due to very slow transfer speeds or other problems with complex network topologies. To fix this, disconnect other network adapters - i.e. if you're running bofied on a laptop with both a Wifi and an ethernet card and you advertise the Wifi card's IP, disconnect the ethernet cable. bofied's log and Wireshark might also give you more insights in such situations. For the best reliablity, run bofied on a wired connection.

License

bofied (c) 2021 Felicitas Pojtinger and contributors

SPDX-License-Identifier: AGPL-3.0

More Repositories

1

weron

Overlay networks based on WebRTC.
Go
1,375
star
2

go-nbd

Pure Go NBD server and client library.
Go
326
star
3

multiplex

Watch torrents with your friends.
Go
205
star
4

liwasc

List, wake and scan nodes in a network.
Go
157
star
5

keygaen

Sign, verify, encrypt and decrypt data with PGP in your browser.
Go
110
star
6

htorrent

HTTP to BitTorrent gateway with seeking support.
Go
110
star
7

octarchive

Simple tool to back up all repos on a GitHub/Gitea account to a local folder.
Go
106
star
8

ram-dl

A tool to download more RAM (yes, seriously!)
Go
86
star
9

gon2n

Go bindings, management daemons and CLIs for n2n edges and supernodes.
Go
76
star
10

pojde

Develop from any device with a browser.
Shell
64
star
11

r3map

High-performance remote memory region mounts and migrations in user space.
Go
64
star
12

tinynet

A `net` implementation for Go and TinyGo based on unisockets, targeting both WebAssembly and native platforms.
Go
47
star
13

hydrapp

Build fast apps that run everywhere with Go and a browser engine of your choice.
Go
38
star
14

stfs

Simple Tape File System (STFS), a file system for tapes and tar files.
Go
34
star
15

unisockets

A universal Berkeley sockets implementation for both WebAssembly (based on WebRTC) and native platforms with bindings for C, Go and TinyGo.
TypeScript
34
star
16

alpimager

Build custom Alpine Linux images with Docker.
Go
29
star
17

panrpc

Language-, transport- and serialization-agnostic RPC framework with remote closure support that allows exposing and calling functions on both clients and servers.
TypeScript
26
star
18

nextcloud-talk-bot-framework

A framework for writing Nextcloud Talk chatbots with every language that supports gRPC.
Go
24
star
19

html2goapp

CLI and web app to convert HTML markup to go-app.dev's syntax.
Go
18
star
20

webnetes

Peer-to-Peer Computing Platform for the Browser and Node.
TypeScript
17
star
21

skysweeper

Automatically delete your old skeets from Bluesky.
TypeScript
16
star
22

networked-linux-memsync

Efficient Synchronization of Linux Memory Regions over a Network: A Comparative Study and Implementation (Bachelor's Thesis)
Jupyter Notebook
14
star
23

nextcloud-talk-bot-jitsi

A bot for Nextcloud Talk that creates Jitsi meetings.
JavaScript
14
star
24

hydrun

Execute a command for the current directory on multiple architectures and operating systems.
Go
10
star
25

felicitas.pojtinger.com

My personal site.
HTML
9
star
26

connmapper

Visualize your system's internet connections on a globe.
TypeScript
9
star
27

uni-itsec-notes

Notes for the IT security course at HdM Stuttgart.
Makefile
9
star
28

xeus-cling-binaries

Weekly builds of https://github.com/jupyter-xeus/xeus-cling.
Shell
9
star
29

uni-bwl-notes

Notes for the Planung und Kalkulation von IT-Projekten (econ 101) course at HdM Stuttgart.
Makefile
9
star
30

tapisk

Expose a tape drive as a block device.
Go
8
star
31

deliverance

Universal document publishing system.
Makefile
8
star
32

goit

Get a OIDC token from your terminal.
Go
8
star
33

growlapse

Visualize plant growth over time with Go, WebDAV and WASM; @pojntfx's entry for #growlab.
Go
8
star
34

invaentory

Quickly find all IPv6 and IPv4 hosts in a LAN.
Go
7
star
35

bagop

Build for all Go-supported platforms by default, disable those which you don't want.
Go
7
star
36

rpiplay-binaries

Weekly builds of https://github.com/FD-/RPiPlay.
Shell
6
star
37

webpipe

Share files, sockets, pipes and char devices over WebRTC.
Go
6
star
38

uni-appsecurity-notes

Notes for the Anwendungssicherheit (app security) course at HdM Stuttgart.
6
star
39

webnetesctl

Frontend for webnetes, the peer-to-peer computing platform for the browser and node.
TypeScript
6
star
40

adwaita-gtk-ubuntu

A modern Ambiance replacement that keeps Ubuntu's identity while staying upstream.
CSS
6
star
41

ipxe-binaries

Weekly builds of https://ipxe.org/, with an embedded script that chainloads /config.ipxe.
Shell
5
star
42

grpc-examples

gRPC example microservices in Go, Rust, C#, Python and JavaScript.
JavaScript
5
star
43

cadmium-builds

Weekly builds of https://github.com/Maccraft123/Cadmium.
Shell
5
star
44

uni-db1-notes

Personal notes for the DB1 course at HdM Stuttgart.
Makefile
5
star
45

consumat.io

Track, plan and enjoy content.
5
star
46

go-app-grpc-chat-frontend-web

Web frontend for an example chat application using the `go-app` package and gRPC over WebSockets (like gRPC-Web).
Go
5
star
47

appl-alg-interpreter-binaries

Weekly builds and source mirror for Prof. Dr. Fridtjof Toenniessen's ApplAlgInterpreter.
Java
5
star
48

the-commitment

A contract requiring you to do one daily public OSS contribution, while allowing time for rest.
5
star
49

learn-chinese-platform

A modern and libre way to learn Chinese.
TypeScript
4
star
50

uni-algodat-notes

Personal notes and snippets for the Algorithms and Data Structures course at HdM Stuttgart.
Go
4
star
51

box

Setup for my personal (pet) server.
Makefile
4
star
52

uni-distributedsystems-notes

Notes for the distributed systems course at HdM Stuttgart.
4
star
53

go-isc-dhcp

Management daemons and CLIs for the ISC DHCP server and client.
Go
4
star
54

donna

Minimal personal CRM.
Go
3
star
55

atmosfeed

Create fully custom Bluesky feeds with Wasm modules, powered by Scale Functions.
TypeScript
3
star
56

keystoregaen

Generate Java keystores in your browser.
Go
3
star
57

saltpanelo

Fast, smart and secure service mesh.
Go
3
star
58

image-builder

A tool to build KubeVirt disk images. Based on @Tedezed's implementation.
Shell
3
star
59

minitel

Instructions on how to use a Minitel as a Linux terminal.
3
star
60

nebulark

Distribute your workload to the edge.
JavaScript
3
star
61

ppc32-builds

CI/CD build configurations to get binaries for projects on 32-Bit PowerPC (ppc32) machines.
Shell
2
star
62

uni-se1-notes

Assignments for the SE1 course of HDM Stuttgart, as Jupyter notebooks.
Jupyter Notebook
2
star
63

adwaita-gtk-ubuntu-legacy

To test out whether it may be a better idea to use Adwaita instead of Ambiance in LTS if Communitheme won't be done in time.
SCSS
2
star
64

SwiftUIMenuBar

A menu bar app for macOS built with SwiftUI.
Swift
2
star
65

gon2n-frontend

React frontend for @pojntfx/gon2n.
TypeScript
2
star
66

xeus-sql-binaries

Weekly builds of https://github.com/jupyter-xeus/xeus-sql.
Shell
2
star
67

glode

Compute, Network and Storage Node based on WASM, libp2p and IPFS.
TypeScript
2
star
68

bagccgop

Build for all gccgo-supported platforms by default, disable those which you don't want (bagop with CGo support).
Go
2
star
69

weron-archive

Overlay networks based on WebRTC.
Go
2
star
70

consumat.io-api

API spec for https://github.com/alphahorizonio/consumat.io.
2
star
71

gnome-shell-extension-sticky-app

A GNOME shell extension to toggle an app's visibility.
JavaScript
2
star
72

birdid

Bird + Cupid: Find the first interaction between two Twitter users
Go
2
star
73

go-cuse

CUSE bindings for Go.
Go
2
star
74

uni-webdev-backend-notes

Notes for the webdev backend course at HdM Stuttgart.
2
star
75

uni-netpractice-notes

Notes for the Praktikum Rechnernetze (networking practice) course at HdM Stuttgart.
2
star
76

mepi

Middle Earth Property Insurance, a uni project of @jakwai01, @dentremor, @lucas-goldner and @pojntfx for HdM Stuttgart.
2
star
77

consumat.io-frontend

Frontend for https://github.com/alphahorizonio/consumat.io.
TypeScript
2
star
78

jitsi-meet-node-client

A NodeJS client for Jitsi Meet.
JavaScript
2
star
79

ports2packets

Generates a CSV file with the packets that are to be sent in order to check if a UDP port is open.
Go
2
star
80

papilio

CLI and web app to configure the Terminus FE and SL series of USB Hubs.
Go
2
star
81

mosalink-archive

Archive of research from 2017 on AX.25 mesh networks with batman-adv and eoax.
1
star
82

skytheon

Cross-post between Bluesky, Mastodon and Twitter in all directions with ease.
Go
1
star
83

pojde-rs

Experimental Rust implementation of https://github.com/pojntfx/pojde.
Rust
1
star
84

go-auth-utils

Simple auth utilities for Go to secure web APIs with.
Go
1
star
85

webwormhole-binaries

Weekly builds of https://github.com/saljam/webwormhole.
Shell
1
star
86

clusterplatform

The Lean Distributed Cloud Computing System.
JavaScript
1
star
87

gopojde

Experimental Go implementation of https://github.com/pojntfx/pojde.
Go
1
star
88

tftpdd

TFTP server daemon.
Go
1
star
89

go-app-experiments

Experiments with the `go-app` package
Go
1
star
90

uni-hacking-notes

Notes for the hacking (IT-Sicherheit: Angriff & Verteidigung) course at HdM Stuttgart.
1
star
91

csv2go

Generates Go code containing a multi-dimensional array with the contents of a CSV file.
Go
1
star
92

ruby-packer-binaries

Weekly builds of https://github.com/metanorma/ruby-packer.
Shell
1
star
93

connaections

The TCP and UDP connections of a node, as an API. See https://github.com/pojntfx/connaections-frontend-web/ for a web frontend.
Go
1
star
94

jmather

A grpc-java example project for teaching GitHub Flow to the SE1 course at HdM Stuttgart University.
Java
1
star
95

simple-direct-democracy-backend

Fast and minimal backend for a simple direct democracy's suggestion and voting system.
JavaScript
1
star
96

ipxebuilderd

Build daemon and CLI for iPXE.
Go
1
star
97

uni-supply-chain-paper

A paper on supply chain security in software development for Uni.
1
star
98

documatio

In goes Markdown, out come indexed HTML and PDF slides and documents.
Shell
1
star
99

transcommunal-confederation

Flags etc. of the Transcommunal Confederation and it's communes.
1
star
100

uni-webtopics-notes

Notes for the Spezielle Themen fΓΌr Web-Anwendungen (special topics for web applications) course at HdM Stuttgart.
1
star