Custom Homepage?

Posted by stayxrestless 
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
Custom Homepage?
June 18, 2014 06:23AM
G'day, I just built my first Piratebox and I just want to change a few superficial things about the homepage (logo, welcome message etc.)

How can I do this?

I am on a mac, and am pretty terminal/html illiterate...

Thanks!
VIVAPB

EDIT: Thanks everyone for all your answers! (unfortunately some are not very useful and not accurate)
In the end, on a mac, it is not possible to mount the PB .IMG (as found on usb storage) just by double clicking, or any other way through disk utility that I could find.

I ended up ssh-ing and navigating to the folder
Quote

cd /opt/piratebox/www/
where I found the "index.html" as well as all the piratebox logos etc.

I ended up extracting that whole folder using
Quote

scb /opt/piratebox/www/* user@nameofmac/~/desktop/piratebox

then i tweaked the html through text edit and replaced the logos and favico, then copied back across via ssh and (after changing permissions by resetting the PB in safemode or something) into the folder with the SCB command again

after replacing the index.html (just changing the text parts while keeping attribution and credit to the original PB project) I and favicon.ico and the piratebox-image.png) I now have a fully tweaked (not completely changed, I'll have to learn html for that!) Piratebox homepage for my specific planned use smiling smiley
Re: Custom Homepage?
June 19, 2014 03:41PM
I don't want to say so much shit, but here is what I saw :

You have to modify directly the files location in the .img file. (located in your USB key). To do this, you have to mount the img file.
I'm not a MAC user, but something is described there (look for Canadian Luke's answer):
[superuser.com]

Then, you will have the possibility to modify the files. I'm at work and can't remember the file tree but I think you can find the index.html easy as there are not really so much files.

We are looking to do heavy modifications on the PB pages but it seems have some parts in Pearl/Python and I don't know how to get further than really-simple html/css modifications.
Re: Custom Homepage?
June 19, 2014 04:47PM
Hi,

So there are few ways to do this. One would be how ogdabou described above. Another way, as you mentioned, would be to SSH into the box using the command 'ssh root@192.168.1.1' with the password you specified when setting up the PB. Once your in you'll need to find you way around. CD = change directory and LS = List. You can list the files/folders where you are and then you can CD into a directory I.E 'CD OPT' or 'CD /OPT' .

This will give you the basics to start looking around your PB. I will get into a tutorial this weekend on how to find the files to make basic changes to your template. I can't teach you all the basic commands but just google what you want to do in linux and it mainly applies to the PB. The only thing you need to know is where the files are. Off the top of my head I think most of the files are located /opt/piratebox/www/ or something like that. When I get home tonight I'll let you know.

Hope that helps for now, or at least gets you started.

--
lnikon
Re: Custom Homepage?
June 19, 2014 06:42PM
Hello,

I spent the better part of a week trying to get this on my box. Here's what I did.

Log into the box via SSH.
ssh root@192.16.1.1

Then CD to the www folder.
cd /opt/piratebox/www

Use the LS command to view files in the folder. To edit any file (in this case the index.html), use the vi editor with the following command.
vi /opt/piratebox/www/index.html

You'll need to be familiar with vi commands, but the basic ones you'll need are "I" to insert, "esc" to exit insert, and ":wq" to exit and save the file. More vi commands can be found here, and ssh commands can be found here. I've never copied images to the box, but I'm sure its easily done with ssh. Also a word of warning, be careful what you edit. I've messed it up quite a few times already tongue sticking out smiley
Re: Custom Homepage?
June 19, 2014 07:30PM
much better written than I smiling smiley

Thanks! You've pretty much written the tutorial on basic "How To: Poke around your PB"

--
lnikon
entity
Re: Custom Homepage?
August 13, 2014 11:56AM
Isn't it possible to use a program like winscp ? there you can browse the files, up and download them... ?
Entity
Re: Custom Homepage?
August 13, 2014 12:37PM
Works fine with WinSCP...
Re: Custom Homepage?
August 27, 2014 07:21AM
I have no access to a Windows machine, and the IMG mounting completely baffles me, but have managed to pretty easily modify my web content directly. Maybe I am missing something, but I just used my USB drive on the MR-3020 to shuttle the files.

I first made a web directpry in my USB drive (by SSHing to the PBOX)

mkdir /opt/piratebox/www/Shared/web

and copied in there the files I knew I wanted to change (I could have grabbed the full directory, but just wanted to test a few changes

cp /opt/piratebox/www/*.html     /opt/piratebox/www/Shared/web
cp /opt/piratebox/www/*.png     /opt/piratebox/www/Shared/web

I then turned off the PB, grabbed the USB, inserted it into my Mac, and copied the /Shared/web director to my computer, where I made changes to the images and HTML files, copied them back to the USB. Turning the PBOX back on, I pretty much reversed the copies back

cp /opt/piratebox/www/Shared/web/*.html     /opt/piratebox/www/
cp /opt/piratebox/www/Shared/web/*.png     /opt/piratebox/www/

It seems to work



There are also HEADER.TXT and README.TXT files on the USB in the Shared folder which seem to be used when generating the indexes, those might need to be edited to match what you changed in index.html (more guesswork).

So I may only be hosed if I update or rebuild the PBOX from the IMG file (?) I am not clear where that gets into the mix. But I think I am off and running to customize the interface.
Re: Custom Homepage?
September 06, 2014 05:13AM
Hi codog,
this is a good manual method.
I tried to automatize the difficult work with the image mount stuff here: [forum.piratebox.cc]

Maybe that makes it a little bit easier.

Matthias


This is only my signature.
Re: Custom Homepage?
September 29, 2014 07:01PM
Hello guys.

I managed to grab the files and copy them to /web directory but i can;t do the opposite ( copy them back to the box )

cp: can't stat '/opt/piratebox/www/style.css/index.html': Not a directory

Any idea ?




Edited 1 time(s). Last edit at 09/29/2014 08:05PM by harisn.
Re: Custom Homepage?
September 29, 2014 11:50PM
copy the output on your screen when your trying to copy so I can determine what your doing wrong exactly.

Are you copying from one Linux machine to another or just hooking the drive into your windows machine?

a few tips for you or someone else who might read this:

To copy from one Linux machine to another try the command 'scp'

scp -r source destination
** use the -r when you want a recursive copy through a folder, drop the -r if your just doing a single file
example:
scp -r /home/piratebox/www root@piratebox:/opt/piratebox/www

Remember to use the command PWD (print working directory) to figure out where you are (full path)

--
lnikon
Re: Custom Homepage?
May 07, 2017 09:01AM
What is the folder /PirateBox/content of the OpenWRT USB stick used for?
Re: Custom Homepage?
May 08, 2017 08:02PM
OK, I got it. It contains the main parts of the piratebay.lan/content page. Browsercache can be a bitch!

How do you rapid prototype with the content folder? Trial and error with booting the box up every time takes too long.

Has anyone a proper environment for that for Linux or Windows?
Re: Custom Homepage?
May 23, 2017 04:01AM
After setting up ssh, you can use sshfs (Linux) or winscp (Windows) for editing.

In addition, I wrote something down about an Linux development environment for the frontend: [piratebox.cc]

Maybe it helps,
best regards
Matthias