aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md41
1 files changed, 35 insertions, 6 deletions
diff --git a/README.md b/README.md
index f4f0d48..4146493 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ The recommended way to pass configuration values to the application is via a
configuration file passed in via the `GN_AUTH_CONF` environment variable. This
variable simply holds the path to the configuration file, e.g.
```sh
-export GN_AUTH_CONF="${HOME}/genenetwork/configs/gn_auth_conf.py"
+export GN_AUTH_CONF="${HOME}/genenetwork/configs/gn_auth_conf.conf"
```
The settings in the file above will override
@@ -146,7 +146,7 @@ $ yoyo new -m "<description of the migration>" ./migrations/auth/
The command will ask whether you want to save the migration configuration, e.g.
```bash
-$ yoyo new --config=yoyo.auth.ini -m "testing a new migration"
+$ yoyo new --database="sqlite:////tmp/test-auth.db" --migration-table=_yoyo_migration -m "testing a new migration" ./migrations/auth/
Error: could not open editor!
Created file ./migrations/auth/20221103_02_HBzwk-testing-a-new-migration.py
Save migration configuration to yoyo.ini?
@@ -186,7 +186,7 @@ If you have previously initialised the yoyo config file, you can put the databas
As a convenience, and to enable the CI/CD to apply the migrations automatically, I have provided a flask cli command that can be run with:
```bash
-$ export FLASK_APP=main.py
+$ export FLASK_APP=wsgi.py
$ flask apply-migrations
```
@@ -205,17 +205,46 @@ following environment variable(s):
### Development
+For initial set up, you need a custom configuration file that will contain
+custom local_settings. At minimum it can contain:
+
+```python
+# contents for local_settings saved at /absolute/path/to/local_settings_file.conf
+SQL_URI = "mysql://user:password@localhost/db_name" # mysql uri
+AUTH_DB = "/absolute/path/to/auth.db/" # path to sqlite db file
+# path to file containings SECRETS key.
+# Note: this path is also used to determine the jwks location
+GN_AUTH_SECRETS = "/home/rookie/gn_data/gn2_files/secrets.conf"
+```
+
+Here's an example `secrets.conf` file:
+
+```python
+SECRET_KEY = "qQIrgiK29kXZU6v8D09y4uw_sk8I4cqgNZniYUrRoUk"
+```
+
+and you set up the oauth clients using:
+
+```
+export FLASK_DEBUG=1 AUTHLIB_INSECURE_TRANSPORT=1 OAUTHLIB_INSECURE_TRANSPORT=1 FLASK_APP=gn_auth/wsgi
+export GN_AUTH_CONF=/absolute/path/to/local_settings_file.conf
+# this sets up a user and client
+flask init-dev-clients --client-uri http://localhost:gn2_port_number
+```
+
To run the application during development:
```sh
export FLASK_DEBUG=1
-export FLASK_APP="main.py"
+export FLASK_APP="wsgi.py"
export AUTHLIB_INSECURE_TRANSPORT=true
-export GN_AUTH_CONF="${HOME}/genenetwork/configs/gn_auth_conf.py"
+export GN_AUTH_CONF="/absolute/path/to/local_settings_file.conf"
flask run --port=8081
```
-replace the `GN_AUTH_CONF` file with the correct path for your environment.
+You can test this by attemptiong to log in to your local GN2 using credentials
+defined by the dummy user you set up (see the function `__init_dev_users__` in
+`/gn_auth/wsgi.py`).
### Production