Last active
May 21, 2024 17:46
-
-
Save ohmantics/11516438b693a91e8bca4edcba7f796b to your computer and use it in GitHub Desktop.
Homebridge in an iocage jail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATASET=/zroot/apps | |
# Create the jail | |
iocage create -n "homebridge" -r 13.1-RELEASE dhcp=1 bpf=1 vnet=1 allow_raw_sockets="1" boot="on" | |
# switch to Latest | |
iocage exec homebridge "mkdir -p /usr/local/etc/pkg/repos" | |
iocage exec homebridge "echo -e 'FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/latest\" }' > /usr/local/etc/pkg/repos/FreeBSD.conf" | |
# Install Homebridge and dependencies | |
iocage exec homebridge "pkg install -y npm-node18 python3 sudo" | |
iocage exec homebridge "npm install -g --unsafe-perm homebridge homebridge-config-ui-x" | |
# create homebridge user (somewhat arbitrary unused UID/GID choice from ports list) | |
iocage exec homebridge "pw groupadd -n homebridge -g 866 -q" | |
iocage exec homebridge "pw useradd -n homebridge -u 866 -g 866 -q -c 'Homebridge User' -d /nonexistent -s /usr/sbin/nologin" | |
# Mount storage | |
mkdir -p $DATASET/homebridge | |
chown 866:866 $DATASET/homebridge | |
iocage exec homebridge "mkdir -p /var/lib/homebridge" | |
iocage fstab -a homebridge $DATASET/homebridge /var/lib/homebridge nullfs rw 0 0 | |
iocage exec homebridge "hb-service install --user homebridge" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment