From ec02c5cb40e54a8c2879af2a2cb1e79c7d558143 Mon Sep 17 00:00:00 2001 From: James Graham <J.Graham@software.ac.uk> Date: Wed, 27 Feb 2019 09:27:56 +0000 Subject: [PATCH] Fill in deployment instructions on admin docs page --- docs/source/guide_administrator.rst | 46 ++++++++++++++++++++++++++++- pedasi/settings.py | 1 + 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/docs/source/guide_administrator.rst b/docs/source/guide_administrator.rst index f4fb934..e8eb3a0 100644 --- a/docs/source/guide_administrator.rst +++ b/docs/source/guide_administrator.rst @@ -19,7 +19,10 @@ Overview A deployment of PEDASI is done automatically to a remote Ubuntu server via a preconfigured Ansible script, which performs the following tasks: - 1. + 1. Install prerequisites + 2. Configure databases + 3. Install PEDASI + 4. Configure and start webserver Prerequisites @@ -52,16 +55,57 @@ On your local machine, first clone the PEDASI repository: Configuration ^^^^^^^^^^^^^ +It it necessary to provide some configuration before deploying PEDASI. + 1. Tell Ansible to which machine PEDASI should be deployed: + + .. code-block:: none + :caption: inventory.yml + + [default] + hostname.domain + + 2. Provide required configuration for Django - the required and optional settings are described in :mod:`pedasi.settings`. + The required settings are: + + .. code-block:: none + :caption: deploy/.env + + SECRET_KEY=<random string> + + SOCIAL_AUTH_GOOGLE_OAUTH2_KEY=<Google OAuth2 key> + SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET=<Google OAuth2 secret> Deployment ^^^^^^^^^^ +You may now deploy PEDASI using the Ansible provisioning script: + +.. code-block:: console + + $ ansible-playbook -v -i inventory.yml playbook.yml -u <your username on the remote host> + + +Post-Deployment +^^^^^^^^^^^^^^^ + +After deploying PEDASI you must create and activate an initial administrator account: + +.. code-block:: console + + $ sudo -s + $ cd /var/www/pedasi + $ source env/bin/activate + $ python manage.py createsuperuser --username <username> --email <email address> + Managing Data Sources --------------------- +In order for users to begin using PEDASI, you should provide access to a range of data sources. +The following sections will walk you through adding and managing your first data source. +We will use the IoTUK Nation Database API (see https://iotuk.org.uk/iotuk-nation-database-api/) as a basic example. Adding a Data Source ^^^^^^^^^^^^^^^^^^^^ diff --git a/pedasi/settings.py b/pedasi/settings.py index 85512f8..abac017 100644 --- a/pedasi/settings.py +++ b/pedasi/settings.py @@ -1,3 +1,4 @@ +# TODO describe all required / optional settings """ Django settings for the PEDASI project. -- GitLab