docs: initial/basic project docs
This commit is contained in:
parent
3290a9936e
commit
4c0754ee01
46 changed files with 531 additions and 0 deletions
52
docs/narr/auth.rst
Normal file
52
docs/narr/auth.rst
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
==============
|
||||
Authentication
|
||||
==============
|
||||
|
||||
At the moment, the expected user login process is as follows:
|
||||
|
||||
|
||||
First Launch
|
||||
------------
|
||||
|
||||
When you first visit the app, it will not have any user accounts so
|
||||
you will be shown a form to create one.
|
||||
|
||||
The username should ideally match your main (daily driver) username
|
||||
within farmOS. The password you give can be anything though, does not
|
||||
need to (and perhaps should not) match farmOS.
|
||||
|
||||
This account will belong to the Administrator role within WuttaFarm,
|
||||
which means it can "become root" (same concept as ``sudo`` basically).
|
||||
|
||||
Once the account is created you will be shown the normal login page.
|
||||
Go ahead and login with this account using the username and password
|
||||
you gave it. But then you should logout again, for the next step.
|
||||
|
||||
|
||||
OAuth2
|
||||
------
|
||||
|
||||
The assumption (for now) is that users will login via farmOS / OAuth2
|
||||
for normal operations. Doing so will embed the access token within
|
||||
the WuttaFarm app user session, which means the user can actually
|
||||
browse farmOS data within the WuttaFarm views.
|
||||
|
||||
.. note::
|
||||
|
||||
If you login to WuttaFarm directly with username/password, then
|
||||
your user session will not have a farmOS access token and so the
|
||||
farmOS data views in WuttaFarm will not work.
|
||||
|
||||
On the login page, click the "Login via farmOS / OAuth2" button. This
|
||||
will initiate the OAuth2 workflow, at which point you may be asked to
|
||||
login to farmOS (if you're not already) and if you wish to grant
|
||||
access to the 3rd party app (WuttaFarm; if you didn't already).
|
||||
|
||||
If all goes well you should be back in WuttaFarm, logged in as the
|
||||
same username you have in farmOS.
|
||||
|
||||
Note that your first admin user in WuttaFarm ideally *should* have the
|
||||
same username as farmOS, but regardless when you login via OAuth2, a
|
||||
user account will be automatically created if necessary in WuttaFarm,
|
||||
with that same username.
|
||||
21
docs/narr/features.rst
Normal file
21
docs/narr/features.rst
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
========
|
||||
Features
|
||||
========
|
||||
|
||||
Here is the list of features currently supported:
|
||||
|
||||
* login via farmOS / OAuth2 workflows
|
||||
* Authorization Code workflow is supported
|
||||
* (technically, Password Grant workflow is also supported, for now)
|
||||
|
||||
* view some farmOS data directly
|
||||
* limited data is fetched via farmOS API for several views
|
||||
* performance isn't bad, but data is not very "complete"
|
||||
* more data could be fetched, but not sure this is the best way..?
|
||||
|
||||
|
||||
Screenshots
|
||||
-----------
|
||||
|
||||
.. image:: https://wuttaproject.org/images/screenshot.png
|
||||
62
docs/narr/install.rst
Normal file
62
docs/narr/install.rst
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
==============
|
||||
Installation
|
||||
==============
|
||||
|
||||
For now, these instructions mostly reflect my own dev workflow. It
|
||||
uses a Python virtual environment but no (Docker) containers.
|
||||
|
||||
Eventually it may make sense to add production deployment steps using
|
||||
Docker etc. - but that will wait for now.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
WuttaFarm is designed to run on a (Debian-based) Linux machine; YMMV
|
||||
with others.
|
||||
|
||||
|
||||
farmOS
|
||||
~~~~~~
|
||||
|
||||
First you must have a *production* `farmOS`_ instance running
|
||||
somewhere. For more on that see `Hosting farmOS`_.
|
||||
|
||||
.. _farmOS: https://farmos.org
|
||||
.. _Hosting farmOS: https://farmos.org/hosting/
|
||||
|
||||
This must use HTTPS for the OAuth2 workflows to work correctly. (Not
|
||||
sure but it may also need to be at the root of the domain, i.e. no
|
||||
subpath.)
|
||||
|
||||
|
||||
Database
|
||||
~~~~~~~~
|
||||
|
||||
You also must create a PostgreSQL (or MySQL) database for the
|
||||
WuttaFarm app to use. See also :ref:`wuttjamaican:create-appdb`.
|
||||
|
||||
|
||||
App Setup
|
||||
---------
|
||||
|
||||
The short version:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
python3 -m venv ./venv
|
||||
./venv/bin/pip install WuttaFarm
|
||||
./venv/bin/wuttafarm install
|
||||
|
||||
The app installer (last command above) will prompt you for DB
|
||||
credentials, and the farmOS URL.
|
||||
|
||||
One of the questions is about data versioning with
|
||||
:doc:`wutta-continuum:index`. This feature will be leveraged more in
|
||||
the future but for the moment doesn't do a whole lot in this app. You
|
||||
are encouraged to enable it anyway.
|
||||
|
||||
When the installer completes it will output a command you can then use
|
||||
to run the web app. Do that and you can then view the app in a
|
||||
browser at http://localhost:9080
|
||||
Loading…
Add table
Add a link
Reference in a new issue