Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
generic:mods:theming [2017/09/17 13:06] matthias [Customization hints] |
generic:mods:theming [2017/09/17 13:29] (current) matthias [FAQ] |
||
---|---|---|---|
Line 16: | Line 16: | ||
__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). **favicon.ico** is stored here. | __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). **favicon.ico** is stored here. | ||
=== /opt/piratebox/share/content/locales === | === /opt/piratebox/share/content/locales === | ||
- | In this folder the different language files are stored. The ''data-<lang>.properties'' are containing the text which is inserted **during pageload**. The text you can see in the files located in ''/opt/piratebox/share/content'' is a space holder, which is used if no corresponding ''data-<lang>.properties'' file is found. (Language files needs to be referred in ''locales.ini''). | + | In this folder the different language files are stored. |
If you want a multi-language box, you may want to adjust these text files. If you only want to have //your// modification only, it is better to disable the language feature (see below). | If you want a multi-language box, you may want to adjust these text files. If you only want to have //your// modification only, it is better to disable the language feature (see below). | ||
=== /opt/piratebox/share/content/js === | === /opt/piratebox/share/content/js === | ||
Line 33: | Line 33: | ||
sudo /opt/piratebox/bin/distribute_files.sh /opt/piratebox/share/Shared 'true' | sudo /opt/piratebox/bin/distribute_files.sh /opt/piratebox/share/Shared 'true' | ||
+ | **Note:** i10n Feature is not enabled for directory listing. | ||
===== Permissions ===== | ===== Permissions ===== | ||
Line 56: | Line 57: | ||
Beside of HEADER.txt and README.txt you can easily exchange the ''/opt/piratebox/share/content'' folder with your own. | Beside of HEADER.txt and README.txt you can easily exchange the ''/opt/piratebox/share/content'' folder with your own. | ||
=== Language files === | === Language files === | ||
+ | The ''data-<lang>.properties'' are containing the text which is inserted **during pageload**. The text you can see in the files located in ''/opt/piratebox/share/content'' is a space holder, which is used if no corresponding ''data-<lang>.properties'' file is found. (Language files needs to be referred in ''locales.ini''). | ||
=== Deactivate i10n feature === | === Deactivate i10n feature === | ||
+ | If you want to edit directly the text in the HTML file, you might want to disable i10n. | ||
+ | |||
+ | To disable that feature, find & remove the following line in ''/opt/piratebox/share/content/index.html'': | ||
+ | |||
+ | <code html> | ||
+ | <script type="text/javascript" src="/content/js/l10n.js"></script> | ||
+ | </code> | ||
+ | |||
==== FAQ ==== | ==== FAQ ==== | ||
=== Redirect loops === | === Redirect loops === | ||
- | === In case of an upgrade of PirateBox === | + | Redirect loops usually happen, if you refer to a not existing file, which creates a HTTP 404 - which results in a redirect to the landing page... which is referring to a not existing file ... which creates HTTP 404 - you can imagine. To debug this issue, you might want to use the [[https://developers.google.com/web/tools/chrome-devtools/network-performance/resource-loading|features of your browser]] to identify the 404. If you can not find it like this, you might want to disable the automatic redirect in lighttpd configuration (OpenWrt - omit sudo) |
+ | sudo sed -i -e "s/^server.error-handler-404/#server.error-handler-404/" \ | ||
+ | /opt/piratebox/conf/lighttpd/lighttpd.conf | ||
+ | |||
+ | You might want to restart the piratebox or just the service. | ||
+ | |||
+ | OpenWrt: | ||
+ | |||
+ | cd / | ||
+ | /etc/init.d/piratebox restart | ||
+ | |||
+ | RPi: | ||
+ | |||
+ | sudo systemctl restart piratebox | ||
+ | |||
+ | To re-enable it, just run the following command: | ||
+ | |||
+ | sudo sed -i -e "s/^#server.error-handler-404/server.error-handler-404/" \ | ||
+ | /opt/piratebox/conf/lighttpd/lighttpd.conf | ||
+ | |||
+ | Restart Piratebox again. | ||
+ | === In case of an upgrade of PirateBox === | ||
+ | During a reboot the following happens to your customization | ||
+ | - ''/opt/piratebox/share/content'' stays completely untouched. | ||
+ | - ''README.txt'' and ''HEADER.txt'' **is overwritten** with a new version. | ||
+ | - Customization it ''/opt/piratebox/conf'' **is overwritten** and lost. | ||