doc: Add developer documentation using Sphinx

- This is completely reworked but based on /Developer page in the FreedomBox
  Manual.

- This documentation can be made available as static site on
  https://docs.freedombox.org and the /Developer page in the FreedomBox Manual
  can be dropped.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-11-02 13:51:14 -04:00
1 parent 108f7b8d46
commit 80498919fb
32 files changed
+1655

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Action Utils
^^^^^^^^^^^^
Several utilities to help with the implementation of actions and diagnostic
tests are implemented in this module.
.. automodule:: plinth.action_utils
:members:
+16
View File
@@ -0,0 +1,16 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Actions
^^^^^^^
FreedomBox's web front does not directly change any aspect of the underlying
operating system. Instead, it calls upon **actions**, as shell commands. Actions
live in ``/usr/share/plinth/actions`` directory. They require no interaction
beyond passing command line arguments or taking sensitive arguments via stdin.
They change the operation of the services and apps of the FreedomBox and nothing
else. These actions are also directly usable by a skilled administrator.
The following documentation for the ``actions`` module.
.. automodule:: plinth.actions
:members: run, superuser_run, run_as_user, _run
+7
View File
@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
App
---
.. autoclass:: plinth.app.App
:members:
+37
View File
@@ -0,0 +1,37 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
App Module
----------
These methods are optionally provided by the module in which an app is
implemented and FreedomBox calls/uses them if they are present.
<app-module>.init()
^^^^^^^^^^^^^^^^^^^
Optional. This method is called by FreedomBox soon after all the applications
are loaded. The ``init()`` call order guarantees that other applications that
this application depends on will be initialized before this application is
initialized.
<app-module>.diagnose()
^^^^^^^^^^^^^^^^^^^^^^^
Optional. Called when the user invokes system-wide diagnostics by visiting
**System -> Diagnositcs**. This method must return an array of diagnostic
results. Each diagnostic result must be a two-tuple with first element as a
string that is shown to the user as name of the test and second element is the
result of the test. It must be one of ``passed``, ``failed``, ``error``. Example
return value:
.. code-block:: python3
[('Check http://localhost/app is reachable', 'passed'),
('Check configuration is sane', 'passed')]
<app-module>.depends
^^^^^^^^^^^^^^^^^^^^
Optional. This module property must contain a list of all apps that this
application depends on. The application is specified as string containing the
full module load path. For example, ``names``.
+7
View File
@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Daemon
^^^^^^
.. autoclass:: plinth.daemon.Daemon
:members:
+10
View File
@@ -0,0 +1,10 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Domain Name
^^^^^^^^^^^
.. autoclass:: plinth.modules.names.components.DomainName
:members:
.. autoclass:: plinth.modules.names.components.DomainType
:members:
@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Firewall
^^^^^^^^
.. autoclass:: plinth.modules.firewall.components.Firewall
:members:
@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Frontpage
^^^^^^^^^
.. autoclass:: plinth.frontpage.Shortcut
:members:
+27
View File
@@ -0,0 +1,27 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Components
----------
.. toctree::
:caption: Available components:
menu
daemon
firewall
webserver
frontpage
domain
letsencrypt
Base Classes
^^^^^^^^^^^^
.. autoclass:: plinth.app.Component
:members:
.. autoclass:: plinth.app.LeaderComponent
:members:
.. autoclass:: plinth.app.FollowerComponent
:members:
@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Let's Encrypt
^^^^^^^^^^^^^
.. autoclass:: plinth.modules.letsencrypt.components.LetsEncrypt
:members:
+7
View File
@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Menu
^^^^
.. autoclass:: plinth.menu.Menu
:members:
@@ -0,0 +1,10 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Webserver
^^^^^^^^^
.. autoclass:: plinth.modules.apache.components.Webserver
:members:
.. autoclass:: plinth.modules.apache.components.Uwsgi
:members:
+13
View File
@@ -0,0 +1,13 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Forms
-----
.. autoclass:: plinth.forms.AppForm
:members:
.. autoclass:: plinth.forms.DomainSelectionForm
:members:
.. autoclass:: plinth.forms.CheckboxSelectMultipleWithReadOnly
:members:
+23
View File
@@ -0,0 +1,23 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
=========
Reference
=========
This section describes the FreedomBox API that is most frequently used by apps.
Note that since FreedomBox is under development and has not yet declared a
stable API, this API is subject to change. This is not usually a problem because
all the FreedomBox apps currently reside in FreedomBox source repository itself
and are updated when the API is updated.
.. toctree::
app
components/index
app_module
actions
action_utils
views
forms
.. automodule:: plinth.modules.ttrss
+7
View File
@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Views
-----
.. autoclass:: plinth.views.AppView
:members: