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
Previous revision
development [2014/09/13 15:50]
stylesuxx [Developing]
development [2018/01/20 08:02] (current)
matthias [Development] some notes about the goals
Line 7: Line 7:
 With this toolchain you can easily build your own OpenWRT images which allows for developing and quickly building images for testing on a **real** system. With this toolchain you can easily build your own OpenWRT images which allows for developing and quickly building images for testing on a **real** system.
  
 +The ongoing development is following the [[goals|Goals of the PirateBox project]]. As an result of these goals, some features will stays in the wiki as an Step-by-Step DIY features, others will be included and/or stay optional in the package.
 ===== PirateBox structure ===== ===== PirateBox structure =====
 PirateBox is based on OpenWRT and thus is able to use its build helpers. One very powerful feature of the OpenWRT build system are [[http://​wiki.openwrt.org/​doc/​devel/​feeds|feeds]]. Feeds basically are collections of packages, they can be local or remote. This allows to easily add new package repositories to be included in the OpenWRT build. PirateBox is based on OpenWRT and thus is able to use its build helpers. One very powerful feature of the OpenWRT build system are [[http://​wiki.openwrt.org/​doc/​devel/​feeds|feeds]]. Feeds basically are collections of packages, they can be local or remote. This allows to easily add new package repositories to be included in the OpenWRT build.
Line 12: Line 13:
 PirateBox has its own [[https://​github.com/​PirateBox-Dev/​openwrt-piratebox-feed|feed]],​ which means all you need is the OpenWRT build system and the [[https://​github.com/​PirateBox-Dev/​openwrt-piratebox-feed|PirateBox feed]] and you are good to go. PirateBox has its own [[https://​github.com/​PirateBox-Dev/​openwrt-piratebox-feed|feed]],​ which means all you need is the OpenWRT build system and the [[https://​github.com/​PirateBox-Dev/​openwrt-piratebox-feed|PirateBox feed]] and you are good to go.
  
 +A detailed overview of the different github repositories can found on [[:​development:​git_repositories|this page]].
 ===== Helpers ===== ===== Helpers =====
 To give you a kickstart, there are some helper scripts that will set up the development environment for you, help building images and remastering them. To give you a kickstart, there are some helper scripts that will set up the development environment for you, help building images and remastering them.
Line 42: Line 44:
  
 ==== 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''​