Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
development [2014/09/13 15:50]
stylesuxx [Developing]
development [2015/02/04 09:06]
matthias [Web Interface] first version of web dev help.
Line 42: Line 42:
  
 ==== Web Interface ==== ==== Web Interface ====
 +The following HowTo is based upong Archlinux and running lighttpd. It also applies only to the development branch (version >= 1.1).
 +The ''​development/​lighttpd_extra.conf''​ is prepared to setup a test environment in you homefolder'​s tmp directory. You can change it to something wich is more suitable. The configuration file ''​development/​lighttpd_inside.conf''​ makes lighttpd run inside the the github repository. Each configuration has a disabled default redirect, because it won't help you much during development.
 + The lighttpd runs with your userid and uses the highport ''​8001''​ and has no 404 redirect enabled per default.
 +
 +The imageboard is currently not tested to run in this environment.
 +
 +The WebUI should run in a configured apache2 environment. You need to setup cgi-bin to use .py files and react on python2 only.
 +The file ''​www/​chat_content.html''​ and ''​www/​cgi-bin/​data.pso''​ must be writeable for the apache user. Unfortunately the directory listing won't work.
 +
 +
 +Requirements are needed to get the UI working:
 +
 +  * Python2
 +  * PHP  including php-cgi (for lighttpd)
 +
 +The following steps need to get the www folder working:
 +
 +Get the latest development branch, if you want to contribute, please exchange the URL with the one of the forked repository.
 +  # git clone git@github.com:​PirateBox-Dev/​PirateBoxScripts_Webserver.git
 +  # cd PirateBoxScripts_Webserver ​
 +  # git checkout development
 +
 +=== Create a dev. environment in an separate folder ===
 +This shows how to create a working web environment in ~/​tmp  ​
 +
 +Create the web development environment for lighttpd in another directory:
 +  # mkdir -p ~/tmp
 +  # cp -rv piratebox/​piratebox/​www ~/tmp 
 +  # cp -rv piratebox/​piratebox/​python_lib/​* ​ ~/​tmp/​www/​cgi-bin
 +  # touch ~/​tmp/​www/​chat_content.html
 +  # mkdir -p  ~/​tmp/​www/​Shared
 +  # mkdir -p  ~/​tmp/​www/​board ​
 +
 +Adjust the following line in the lighttpd configuration file in the PIrateBoxScripts_Webserver folder ''​development/​lighttpd_extra.conf''​. Be sure it is the full non relative path.
 + 
 +  var.basedir=<​change this to your desired folder>
 +
 +Uploaded files will be placed in the Shared folder. Run lighttpd with the following command
 + 
 + # lighttpd -D -f development/​lighttpd_extra.conf
 +
 +Point your browser now to ''​http://​127.0.0.1:​8001/''​. You will find error logs and logs from HTTP-Code 500 in ''/​tmp/​break.log''​ & ''/​tmp/​error.log''​
 +
 +=== Create run lighttpd inside github directory ===
 +You can run lighttpd inside the cloned repository. To do so, you should take care during the commits to not add unwanted files to the repository during working on it.
 +
 +Create the web development environment for lighttpd:
 +  # touch piratebox/​piratebox/​www/​chat_content.html
 +  # mkdir -p  piratebox/​piratebox/​www/​Shared
 +  # mkdir -p  piratebox/​piratebox/​www/​board ​
 +
 +Usually during startup of the PirateBox, ''​HEADER.txt''​ and ''​README.txt''​ two files will be distributed across the directories. ​ We are creating links to the original files, that you can adjust it transparently.
 +
 +  # ln piratebox/​piratebox/​src/​HEADER.txt piratebox/​piratebox/​www/​Shared/​
 +  # ln piratebox/​piratebox/​src/​README.txt piratebox/​piratebox/​www/​Shared/​
 +
 +Uploaded files will be placed in the Shared folder. Run lighttpd with the following command
 +
 +   ​lighttpd -D -f development/​lighttpd_inside.conf
 +
 +Point your browser now to ''​http://​127.0.0.1:​8001/''​. You will find error logs and logs from HTTP-Code 500 in ''/​tmp/​break.log''​ & ''/​tmp/​error.log''​