New PirateBox Folder Structure Suggestion (To allow ease of use customization)

Posted by F75 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
F75
New PirateBox Folder Structure Suggestion (To allow ease of use customization)
August 23, 2017 04:54AM
I'm not sure how much work this would entail, but would it be possible to put the whole PirateBox content on the USB drive so that you could swap drives and have different custom PirateBoxes?
This would allow easy access to change network information, graphics, html, etc.

I've customized my version quite a bit but had to change several files that seemed to have duplicate information scattered around the system and it was difficult to know what file is actually changing the HTML code, etc.
I feel this would cut down on file size and make things tidy and easy to locate.

Customizable files on USB:
CSS: Background Color, Text Color, Hypertext Color, etc.
All Images
Piratebox Greeting Message (File)
Shout Box Greeting Message (File)
WIFI SSID, Password (Network Config File)
SSH Greeting Banner (File)

Suggested Layout:


I appreciate PirateBox, this forum and everyone's hard work.
Thank you.
Cheers!
Re: New PirateBox Folder Structure Suggestion (To allow ease of use customization)
August 24, 2017 06:53AM
Hi,
thank you for the suggestion. The folder structure looks quite nice, and parts of your thoughts are already implemented.. in LibraryBox.

wait what?

LibraryBox is more for the usecase of not learning, but just configure your stuff. There is already a package, which brings parts of the configuration to textfiles on the USB stick. Yes, it is not that nicely sorted like in your example, but the mentioned features are similar.

Yes. PirateBox philosophy is to bring people to computer/linux technology and learn shell. So, we won't bring each comfort function. In addition, -especially on OpenWrt- you have a mix between plain PirateBox configuration files /opt/piratebox/conf and system configuration (firewall, wifi and parts of the network).
The system configuration needs to be brought in sync with configuration files on the USB stick.. and the place on the 4MB firmware images (MR3020, MR3040) are nearly exhausted for PirateBox 2.0.

90 % of the landing page is already inside the content folder, which is located on the USB stick.
CSS, JS and images are sorted in different folders on the content folder. You can throw away most parts of the content folder and place your own UI.
Only the directory listing is the last man standing of single UI configuration, which is also targeted for PirateBox 2.0.
It is difficult to exchange the text, yes, but on the other side we have a multi-language interface. So this is the trade off :-(

In fact, these two things needs to be changed via console:
Shout Box Greeting Message (File)
WIFI SSID, Password (Network Config File)
SSH Greeting Banner (File)

What do you think about it?
Matthias
F75
Re: New PirateBox Folder Structure Suggestion (To allow ease of use customization)
August 24, 2017 05:24PM
I haven't tried Library Box yet but I'll give it a look.
I'm not a linux noob, but more of an intermediate novice, if that makes sense.
I managed to get things customized previously and could customize even more, but It's fine were it's at for now.
The only reason why I asked because I will be helping other deploy these MR3020s, I'm fine hacking around the shell, but I guess I didn't understand how on boot, it ties all the files together.
I use a 64Gig Sandisk Cruizer Blade so it fits snug agains the device, this helps with physical size, so that is super nice.

Here is a screenshot of my landing page:


Thanks for the reply.
I'll try to contribute to development as much as I can.
Cheers!
Re: New PirateBox Folder Structure Suggestion (To allow ease of use customization)
August 24, 2017 06:44PM
Hi,

Quote

The only reason why I asked because I will be helping other deploy these MR3020s, I'm fine hacking around the shell, but I guess I didn't understand how on boot, it ties all the files together.
Yes, any constructive feedback is appreciated! (This feedback is constructive.)
PirateBox has a few legacy things, which we we are pulling with us through the different releases. One of these things are the FAT32 limitation, which is based on fact that FAT32 has the best compatibility across the different OS (mac, windows, linux).
The customization for LibraryBox (USB config files) can be used on PirateBox as well, it is just not preinstalled (and no special PirateBox version). (Librarybox and PirateBox are share alot of the codebase).

You landing page looks nice.

Any help is appreciated. If you like to support development, have a look at the issues for 1.2 on github and at the Development forum. We are running a automatic build for OpenWrt/LEDE based Piratebox every 2 days and an rebuild of the RPi images on request.
I also implemented a sort of captive portal hack, which should present a welcome page and then work like a normal PirateBox (without Firewall restrictions or something else).

I also want to move the shoutbox from python scripts over to a set of PHP scripts... to lower the amount of python code to 0% (for reducing the needed script languages on the devices).

best regards Matthias