https://github.com/sinedied/hads
A simple, markdown-based wiki written in Node. It does just enough for what I need and not much more.
Installed on TrueNas in a FreeBSD jail. HADS lives in /mnt/HADS/
- Create DNS A record for home pointing to 10.39.6.46
pkg install setsid npm sudo
sudo visudo
to add a line foruser ALL=NOPASSWD: /mnt/HADS/node_modules/hads/bin/hads
- Map persistent directories:
/mnt/Vol_2X8T/Server/Apps/home-server --> /mnt/Vol_2X8T/iocage/jails/HOME/root/mnt
/mnt/Vol_2X8T/Server/Apps/home-server/etc --> /mnt/Vol_2X8T/iocage/jails/HOME/root/etc
Note: for the second command to work, I had to become root on the server and do this:
root@fn:/mnt/Vol_2X8T/iocage/jails/home-www/root # mv etc etc-orig
- Edit user's crontab:
SHELL=/bin/sh
@reboot setsid sudo /mnt/HADS/node_modules/hads/bin/hads /mnt/HADS/data -i /mnt/HADS/images/ --host 10.39.6.46 --port 80 --readonly >>/var/log/hads_ro.log 2>&1 < /dev/null & echo $! >/tmp/hads_
ro.pid
@reboot setsid sudo /mnt/HADS/node_modules/hads/bin/hads /mnt/HADS/data -i /mnt/HADS/images/ --host 10.39.6.46 --port 3906 >>/var/log/hads_rw.log 2>&1 < /dev/null & echo $! >/tmp/hads_rw.pid
Any browser can reach the HADS server on HTTP://home ... to edit they must connect to HTTP://home:3906. Firewall restrictions allow only local authenticated access to the 3906 port.
Manage (stop) the daemons in the shell with e.g.:
kill `echo /tmp/hads_ro.pid`