This is an old revision of the document!


Theme - Guide

Among on the forums are several confusions about customizing PirateBox. Let's sum up the possibilities and make clear howto get to you custom Theme. Please provide feedback or help with unclear points in the Piratebox forum.

Folders & Files

/opt/piratebox/www

This is the original webroot folder. You land on this folder when you enter http://piratebox.lan or any url without a path suffix. index.html is containing the absolute URL to the box' name and is changed with the /opt/piratebox/bin/install_piratebox.sh script. It 'always' refers to http://piratebox.lan/content. This also used to forward in case of an unknown (404). PirateBox 1.1.3 still contains redirect.html which will be removed in the future. Usually you do not have do modify the content here. In the folder the generated HTML pages for the Shoutbox and the disk usage bar is stored. All CSS & JS is in /opt/piratebox/www/content .

/opt/piratebox/www_content

This folder contains the original unmodified version of the landing page. It is a backup of the default theme and is copied to /opt/piratebox/share/content during first initialization. PirateBox keeps a copy of the folder in case of (accidentally) removing the content folder on the USB stick- this folder will be placed again to /opt/piratebox/share/content if content is missing during startup.

Note: It is not necessarily needed to modify this folder.

/opt/piratebox/share/content

This is the folder which you should focus on adding on your modifications. /opt/piratebox/www/content is a symlink to /opt/piratebox/share/content , which means, that those are kind of identical. As the share folder is typically on the USB stick or the expanded storage medium, you can backup, edit and exchange this folder on your computer (in case of USB stick).

/opt/piratebox/share/content/js

/opt/piratebox/share/content/css

/opt/piratebox/share/content/locales

/opt/piratebox/share/content/img

/opt/piratebox/share/Shared

HEADER.txt & README.txt

/opt/piratebox/src/*.txt

HEADER.txt & README.txt

Permissions

On OpenWrt based PirateBox your are typically working as root and the USB Stick does not reflect a the Linux file permissions, you do not have to deal with it here. On RPi based or normal Linux based PirateBox it is a bit more difficult. The normal installation changes the permissions of the www folders (see above) to the owner/group nobody/nogroup and the files are read-writable for user&group only, while the user login is alarm. For a normal webserver setup, this is sufficient- but for customization it is difficult. If you decided to use the USB stick as a storage option on RPi, you can easily edit the files on the USB stick.

The easiest way to make the needed folders writable for you is:

sudo chmod a+w <folder>

for example for the content folder:

sudo chmod a+w /opt/piratebox/share/content

After you are done with the customization, the recommendation is to perform the following commands:

sudo chmod a-w <folder>
sudo chown nobody:nogroup -R <folder>

Note: nobody:nogroup may be different on custom installations.

Customization hints

Language files

Deactivate i8n feature

FAQ

Redirect loops

In case of an upgrade of PirateBox