DEV Community

Piotr
Piotr

Posted on • Edited on

2

Setting up Archivebox on Truenas Scale

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 archivebox user in Truenas Scale

Creating an app

To setup Archivebox I you need to use custom-app chart from TrueCharts repository.

Custom-app chart

Change Application name to Archivebox. Then set_Container Image -> Container Repository_ to archivebox/archivebox, Container Tag to latest and Container Pullpolicy to ifNotPresent.

Image description

Enable All liveness probes.

Image description

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.

Image description

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.

Image description

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Then change the user to archivebox.

su - archivebox
Enter fullscreen mode Exit fullscreen mode

Go to /data and run:

archivebox init --setup
Enter fullscreen mode Exit fullscreen mode

References

Image of AssemblyAI tool

Challenge Submission: SpeechCraft - AI-Powered Speech Analysis for Better Communication

SpeechCraft is an advanced real-time speech analytics platform that transforms spoken words into actionable insights. Using cutting-edge AI technology from AssemblyAI, it provides instant transcription while analyzing multiple dimensions of speech performance.

Read full post

Top comments (1)

Collapse
 
thesquashsh profile image
Nick Sweeting • Edited

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 :)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay