freedomboneeee/doc/EN/devguide.org

101 lines
4.5 KiB
Org Mode
Raw Normal View History

#+TITLE:
#+AUTHOR: Bob Mottram
2016-10-31 17:24:49 +01:00
#+EMAIL: bob@freedombone.net
2018-04-12 14:01:49 +02:00
#+KEYWORDS: freedombone, developers
#+DESCRIPTION: Freedombone developers guide
#+OPTIONS: ^:nil toc:nil
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="freedombone.css" />
2018-04-12 14:01:49 +02:00
#+attr_html: :width 80% :height 10% :align center
[[file:images/logo.png]]
2018-04-12 14:01:49 +02:00
* Developers Guide
2016-10-13 00:03:59 +02:00
* Introduction
2018-02-06 23:30:44 +01:00
Freedombone consists of a set of bash scripts. There are a lot of them, but they're not very complicated. If you're familiar with the GNU/Linux commandline and can hack a bash script then you can probably add a new app or fix a bug in the system. There are no trendy development frameworks to learn or to get in your way. You might also want to consult the [[./codeofconduct.html][Code of Conduct]], and there is a Matrix room at *#fbone:matrix.freedombone.net*
* Adding extra apps
2016-10-12 18:17:28 +02:00
Suppose you have some internet application which you want to add to the system. To do this you need to create an app script which tells the system how to install/remove and also backup/restore. The script should be designed to work with the current stable version of Debian.
2018-02-06 22:56:15 +01:00
There's a command which you can use to generate scripts for new apps. Some examples are as follows:
2018-05-14 20:45:13 +02:00
To create a script for a generic PHP plus MySql/MariaDB web app with a couple of extra packages:
#+begin_src bash
2018-02-06 23:00:15 +01:00
freedombone-template --app [name] -e [email] -r [repo url] \
2018-05-14 20:45:13 +02:00
--packages "cowsay libssl-dev" \
2018-02-06 23:00:15 +01:00
-c [commit] --php yes -d mariadb > \
src/freedombone-app-myappname
#+end_src
2018-02-06 22:56:15 +01:00
For a Nodejs app with MySql/MariaDB database:
#+begin_src bash
2018-02-06 23:00:15 +01:00
freedombone-template --app [name] -e [email] -r [repo url] \
-c [commit] --node yes -d mariadb \
--dir /etc/myappname --daemon yes > \
src/freedombone-app-myappname
#+end_src
2018-02-06 22:56:15 +01:00
For a Python app with Postgresql database:
#+begin_src bash
2018-02-06 23:00:15 +01:00
freedombone-template --app [name] -e [email] -r [repo url] \
-c [commit] -d postgresql \
--dir /etc/myappname --daemon yes > \
src/freedombone-app-myappname
2018-02-06 22:56:15 +01:00
#+end_src
2018-02-07 11:17:23 +01:00
For a Python app without any database, communicating between the daemon and the web server on port 1234:
2018-02-06 22:56:15 +01:00
#+begin_src bash
2018-02-06 23:00:15 +01:00
freedombone-template --app [name] -e [email] -r [repo url] \
-c [commit] --dir /etc/myappname \
2018-02-07 11:17:23 +01:00
--daemon yes --portinternal 1234 > \
2018-02-06 23:00:15 +01:00
src/freedombone-app-myappname
#+end_src
2018-02-07 11:48:03 +01:00
For an app without any database which communicates directly on a particular port through the firewall:
#+begin_src bash
freedombone-template --app [name] -e [email] -r [repo url] \
-c [commit] --dir /etc/myappname \
--daemon yes --port 5000 > \
src/freedombone-app-myappname
#+end_src
A generic PHP plus MySql/MariaDB web app which is only available on an onion address:
#+begin_src bash
freedombone-template --app [name] -e [email] -r [repo url] \
-c [commit] --php yes -d mariadb \
--onion yes > \
src/freedombone-app-myappname
#+end_src
2018-02-06 22:56:15 +01:00
For more details see the manpage:
#+begin_src bash
2018-02-06 22:56:15 +01:00
man freedombone-template
#+end_src
2018-02-07 11:27:50 +01:00
The template command won't give you a fully working app, but it will give you a big head start and avoid a lot of potential mistakes. It's highly likely that you'll still need to add extra configuration for your particular app, especially within the *install_app* function.
2018-02-06 22:56:15 +01:00
When your new script is ready for testing you can install it with:
#+begin_src bash
2018-02-06 22:56:15 +01:00
make install
#+end_src
2018-02-06 22:56:15 +01:00
Then run the administrator control panel and you should see the new app within *Add/Remove apps*.
Submit your working app to *https://code.freedombone.net/bashrc/freedombone/issues*, create a pull request or if you don't have an account there you can send patches via email to bob@freedombone.net.
2016-10-13 00:03:59 +02:00
* Customising mesh images
If you want to make your own specially branded version of the mesh images, such as for a particular event, then to change the default desktop backgrounds edit the images within *img/backgrounds* and to change the available avatars and desktop icons edit the images within *img/avatars*. Re-create disk images using the instructions shown previously.
If you need particular /dconf/ commands to alter desktop appearance or behavior then see the function /mesh_client_startup_applications/ within *src/freedombone-image-customise*.
2018-04-12 18:33:16 +02:00
#+attr_html: :width 10% :height 2% :align center
2018-04-12 19:26:01 +02:00
[[file:fdl-1.3.txt][file:images/gfdl.png]]