Dive into FreeBSD - beginner/ hobbyist/ tinkerer friendly, mobile-first web interface to run FreeBSD as a personal/ public server.
Find a file
2024-05-23 14:27:46 +05:30
assets Fix search 2024-05-16 08:31:40 +05:30
config Add colorhash 2024-05-14 06:22:55 +05:30
lib Add enable/disable service commands 2024-05-22 01:00:43 +05:30
priv Install dependencies and configure doas 2024-05-23 13:48:26 +05:30
rel/overlays/bin Add mix release, commands to create user and reset password. 2024-05-13 15:29:38 +05:30
test Redo Liliform for clarity 2024-05-15 01:28:42 +05:30
.formatter.exs Add Phoenix Framework 2024-05-10 00:58:48 +05:30
.gitignore Improve icon colors, test colorhash feature flag (needs page refresh) 2024-05-16 00:23:00 +05:30
deploy-local.sh Make deploy local script executable 2024-05-21 01:43:51 +05:30
freedive.env.sample Add colorhash 2024-05-14 06:22:55 +05:30
LICENSE Initial commit 2024-05-09 16:14:45 +02:00
mix.exs Add file monitor to reload services, improve icons. 2024-05-19 14:52:27 +05:30
mix.lock Add FreeBSD packaging 2024-05-13 20:56:07 +05:30
README.md Update development instructions in readme 2024-05-23 14:27:46 +05:30

Freedive

Dive into FreeBSD

Freedive aims to provide a mobile-first WebUI to manage FreeBSD hosts, designed to welcome beginners, hobbyists and tinkerers to the FreeBSD ecosystem with minimal fuss.

Develop

Clone the repository:

  • git clone https://brew.bsd.cafe/hiway/freedive.git
  • cd freedive

Install dependencies:

  • pkg install -U -y inotify-tools doas

Setup your own account to run commands as root without password:

  • echo "permit nopass <USERNAME> as root" >> /usr/local/etc/doas.conf

Start Freedive:

  • Run mix setup to install and setup dependencies
  • Start Freedive with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

User management

Every user has full access to every part of the system via Freedive, do NOT create accounts for people you do not trust to have root access on this machine.

Create release:

  • mix release --overwrite

Create account on dev server

  • _build/dev/rel/freedive/bin/freedive eval "Freedive.Release.account_create"

Reset password for account on dev server

  • _build/dev/rel/freedive/bin/freedive eval "Freedive.Release.password_reset"

Deploy

Create FreeBSD package:

  • mix package

Copy package to target machine:

  • scp freedive-0.1.0.pkg hostname:

SSH to the tagret machine, use doas -S (or sudo -s) if required to gain admin privileges and then run:

  • pkg install -U -y freedive-0.1.0.pkg

Configure Freedive

  • $EDITOR /usr/local/etc/freedive/freedive.env

Set preferences in freedive.env

  • HOST="hostname"
  • BIND="ip-to-bind"
  • PORT=3443

Ensure that the host is set to whatever hostname you'll use to access the service from browser. For example, if you bind to the Tailscale/Wireguard IP, use the hostname that'll point to this IP. Port can be anything suitable in your environmet that's open and accessible from your mobile/laptop.

Enable Freedive

  • service freedive enable

Initialize Freedive

  • service freedive init

Create an account for yourself

  • service freedive account_create

Start Freedive

  • service freedive start

Check logs

  • tail -f /var/log/freedive/freedive.log

Visit https://hostname:port from your browser and log in with the account created above.