|
|
Re2o provides a setup script that is used to highly ease the initial installation and configuration process of the project but also reinstall, reset and updates some components of the project. The script is the `install_re2o.sh` ([see the file](https://gitlab.federez.net/federez/re2o/blob/master/install_re2o.sh)).
|
|
|
|
|
|
This page describes the different uses of this script.
|
|
|
|
|
|
|
|
|
# Usage
|
|
|
The usage can be found by launching the script without any options:
|
|
|
```
|
|
|
./install_re2o.sh
|
|
|
```
|
|
|
which outputs this rather self-explanatory description:
|
|
|
```
|
|
|
Usage: install_re2o [subcommand [options]]
|
|
|
|
|
|
The 'install_re2o' script is a utility script to setup, configure, reset and update
|
|
|
some components of re2o. Please refer to the following details for more.
|
|
|
|
|
|
Sub-commands:
|
|
|
* [no subcommand] - Display this quick usage documentation
|
|
|
* {help} ---------- Display this quick usage documentation
|
|
|
* {setup} --------- Launch the full interactive guide to setup entirely
|
|
|
re2o from scratch
|
|
|
* {update} -------- Collect frontend statics, install the missing APT
|
|
|
and pip packages and apply the migrations to the DB
|
|
|
* {update-django} - Apply Django migration and collect frontend statics
|
|
|
* {update-packages} Install the missing APT and pip packages
|
|
|
* {update-settings} Interactively rewrite the settings file
|
|
|
* {reset-db} ------ Erase the previous local database, setup a new empty
|
|
|
one and apply the Django migrations on it and collect
|
|
|
Django statics.
|
|
|
Parameters:
|
|
|
* <db_password> -- the clear-text password to connect to the database
|
|
|
* [db_engine_type] the SQL engine to use ('mysql' or 'postgresql').
|
|
|
Default is 'mysql'.
|
|
|
* [db_name] ------ the name of the database itself.
|
|
|
Default is 're2o'.
|
|
|
* [db_username] -- the username to connect to the database.
|
|
|
Default is 're2o'.
|
|
|
* {reset-ldap} ---- Erase the previous local LDAP and setup a new empty one
|
|
|
Parameters:
|
|
|
* <ldap_password> the clear-text password for the admin user of the
|
|
|
LDAP
|
|
|
* <local_domain> the domain extension to use for the LDAP structure
|
|
|
in LDAP notation
|
|
|
```
|
|
|
|
|
|
|
|
|
# Subcommands
|
|
|
|
|
|
|
|
|
## help
|
|
|
**Usage**: ```install_re2o [help]```
|
|
|
|
|
|
This command will display the usage message with a quick description of the possible arguments.
|
|
|
|
|
|
|
|
|
## setup
|
|
|
**Usage**: ```install_re2o setup```
|
|
|
|
|
|
This command will start the interactive guide to help you setup from scratch.
|
|
|
|
|
|
This guide consist of a series of question asked to the user about how some preferences and configuration for this setup (such as usernames, password, local or remote databases, web egine, ...). And only after all the questions are answered, the script will start taking some actions. Depending on the coices made, at some point, the user may be asked to perform some commands on the remote databse or LDAP servers.
|
|
|
|
|
|
The only other input needed from the user during the setup is to enter some credentials and basic information to create the first user of the project. This user will is called a [superuser](https://docs.djangoproject.com/en/2.0/ref/contrib/auth/#django.contrib.auth.models.User.is_superuser) because it has all the rights. It is needed at the beginning. Once you will have setup the [groups and permissions](User Documentation/Permissions) on re2o, this user can be removed from the superusers and be a regular user.
|
|
|
|
|
|
If everything went well, you should be able to access Re2o website at the URL you gave when asked.
|
|
|
|
|
|
*:warning: Even if it should not fail or completely mess up things, it is recommend to only use this command on completely new setup.*
|
|
|
|
|
|
|
|
|
## update
|
|
|
**Usage**: ```install_re2o update```
|
|
|
|
|
|
This command will perform some updates on the project. It is equivalent of doing:
|
|
|
```
|
|
|
install_re2o update-packages
|
|
|
install_re2o update-django
|
|
|
```
|
|
|
See the corresponding commands below for more details ont the effects. This command is highly suited to be performed after a pull of the project.
|
|
|
|
|
|
|
|
|
## update-packages
|
|
|
**Usage**: ```install_re2o update-packages```
|
|
|
|
|
|
This command will reinstall and/or update all the required packages for the project. It will install both *APT* and *PyPi* missing packages but won't delete the old and unused anymore ones.
|
|
|
|
|
|
|
|
|
## update-django
|
|
|
**Usage**: ```install_re2o update-django```
|
|
|
|
|
|
This command will update the Django related components. It will first aplly the non-applied migrations on the database and then collect the non-collected static files. Those are standard Django actions but should be done after each pull of the project.
|
|
|
|
|
|
|
|
|
## update-settings
|
|
|
**Usage**: ```install_re2o update-settings```
|
|
|
|
|
|
This command will interactively rewrite the settings file based on the example provided by the project. It will ask the user for some details of the configuration to use (username, passwords, ...) and will use the template for creating a new settings file. This is intention here is to use an up-to-date version of the settings and being sure that all new options are included.
|
|
|
|
|
|
:warning: The side effect of this command is that it will erase the previous configuration, which is good to get rid of out-dated configuraiton, but the generated one is probably far less precise and it is highly probably needed to complete the newly generated settings to get the same behaviour as before.
|
|
|
|
|
|
|
|
|
## reset-db
|
|
|
**Usage**: ```install_re2o reset-db <db_password> [db_engine_type] [db_name] [db_username]```
|
|
|
|
|
|
This command will reset the **local** database to its original empty state (or create a **local** one if there is none). In order to get the database in an up-to-date state, the Django's migrations will also be applied rigth after the creation of the database. This means that the given parameters should be reflected in the settings file (username, password, hostname, ...) to run properly.
|
|
|
|
|
|
*:warning: This command is not meant to be used on production server (whose database should not be hosted locally ideally) but more on developpement environnement where it might be usefull to fully reset the database and get back to a stable state.*
|
|
|
|
|
|
|
|
|
### db_password
|
|
|
**Value**: *Any string that can be a password*
|
|
|
|
|
|
This paramater indicates the password that will be used to connect to the local database.
|
|
|
|
|
|
|
|
|
### db_engine_type
|
|
|
**Value**: `mysql` or `postgresql` (Default: `mysql`)
|
|
|
|
|
|
This paramaters indicates whether to use a MySQL or a PostgreSQL for the local database.
|
|
|
|
|
|
|
|
|
### db_name
|
|
|
**Value**: *Any string that can be a database name* (Default: `re2o`)
|
|
|
|
|
|
This parameter indicates the name of the database that will be used to store re2o data on the local database.
|
|
|
|
|
|
|
|
|
### db_username
|
|
|
**Value**: *Any string that can be a user name* (Default: `re2o`)
|
|
|
|
|
|
This parameter indicates the username that will be used to connect to the local database.
|
|
|
|
|
|
|
|
|
## reset-ldap
|
|
|
**Usage**: ```install_re2o reset-ldap <ldap_password> <local_domain>```
|
|
|
|
|
|
This command will reset the **local** LDAP to its original empty state (or create a **local** one if there is none). The given parameters should be reflected in the settings file (username, password, hostname, ...) after the changement.
|
|
|
|
|
|
*:warning: This command is not meant to be used on production server (whose LDAP should not be hosted locally ideally) but more on developpement environnement where it might be usefull to fully reset the LDAP and get back to a stable state.*
|
|
|
|
|
|
|
|
|
### ldap_password
|
|
|
**Value**: *Any string that can be a password*
|
|
|
|
|
|
This parameter indicates the password that will be used to connect the local LDAP.
|
|
|
|
|
|
|
|
|
### local_domain
|
|
|
**Value**: *Any valid DN entry in LDAP notations* (e.g. `dc=example,dc=net`)
|
|
|
|
|
|
This parameter indicates the root DN entry to use in the LDAP that should reflect a domain name extension helb by the user. |
|
|
\ No newline at end of file |