I recently got into self-hosting. I've wanted to create a self-hosted web archive and my friend recommended an Archivebox, unfortunately TrueCharts doesn't have a chart for it so I had to do it myself. Here's my guide on how to setup Archivebox on Truenas Scale.
Setting up a Archivebox user
First of all you to setup an Archivebox user. As Archivebox container won't even start as root. Go to Credentials -> Local Users -> Add. Create a new user with a username archivebox
and toggle Disable Password
Creating an app
To setup Archivebox I you need to use custom-app
chart from TrueCharts repository.
Change Application name to Archivebox
. Then set_Container Image -> Container Repository_ to archivebox/archivebox
, Container Tag to latest
and Container Pullpolicy to ifNotPresent
.
Enable All liveness probes.
Then set Networking and Services -> Main Service Port Configuration, Port type to HTTP
, Target Port to 8000
and Port to some random port number like 10967
.
Service type will depend on your setup.
Last of all, the storage. You need to mount 2 paths:
/data
/var/spool/cron/crontabs
For your connivance I recommend to mount /data
as hostPath and /var/spool/cron/crontabs
as PVC. As /data
requires some setup later.
Update: After using this setup I found that mountung
/var/spool/cron/crontabs
doesn't work as expected - the files are erased and jobs stop.
Set Pod Security Context -> fsGroup to group id of group archivebox
.
Then click Save.
Post chart setup
Setup up Archivebox
Go to System setting -> Shell and cd into /data
path.
Then run:
docker run -v $PWD:/data -it archivebox/archivebox init --setup
It will setup Archivebox db. After this step, you should be able to access the webui.
If you cannot do that, make sure, that HostPath directory has correct permissions.
chown archivebox:archivebox YOUR_DIR
Fixing the scheduler
I've noticed that some of my scheduled runs were failing. To fix them i run these commands inside the container.
Change the owner of /var/spool/cron/crontabs
to archivebox
.
chown -R archivebox:archivebox /var/spool/cron/crontabs
Then change the user to archivebox.
su - archivebox
Go to /data
and run:
archivebox init --setup
Top comments (1)
Thanks for writing this guide!
btw, I've fixed the /var/spool/cron/crontabs permissions issue in the next upcoming release v0.7.3, see here: github.com/ArchiveBox/ArchiveBox/c...
It now auto-chown's that dir to PUID:PGID of the archivebox user on launch so you shouldn't have to do that step manually anymore.
We also have a new official TrueNAS chart in development, hopefully we can skip all the manual setup soon :)