The server is plain FastAPI + SQLite, so it runs directly under a FreeBSD jail's Python. Docker (see the main README) is the easier path if you have it; these are notes for a native jail install.
pkg install python311 py311-sqlite3 rustpy311-sqlite3is a separate package on FreeBSD; the base Python build does not include the SQLite module.rustis needed at install time to buildpydantic-core(a FastAPI dependency) andwatchfilesif you use--reload. It can be removed afterwards if you want to reclaim the space.
python3.11 -m venv /usr/local/board-inventory/venv
/usr/local/board-inventory/venv/bin/pip install -r requirements.txt
/usr/local/board-inventory/venv/bin/uvicorn app:app --host 0.0.0.0 --port 5000Run it from the directory containing app.py and dashboard.html, or set
BOARD_INVENTORY_DB to choose where the SQLite file lives.
Drop a script at /usr/local/etc/rc.d/board_inventory (no extension) so it
starts on boot. Sketch:
#!/bin/sh
# PROVIDE: board_inventory
# REQUIRE: NETWORKING
# KEYWORD: shutdown
. /etc/rc.subr
name="board_inventory"
rcvar="board_inventory_enable"
pidfile="/var/run/${name}.pid"
board_inventory_user="www"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} \
/usr/local/board-inventory/venv/bin/uvicorn app:app --host 0.0.0.0 --port 5000"
load_rc_config $name
run_rc_command "$1"Then:
sysrc board_inventory_enable=YES
service board_inventory startMake sure the board_inventory_user can read app.py/dashboard.html and
write the database file/directory.