summaryrefslogtreecommitdiff
path: root/topics/authentication
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-05-30 12:47:59 +0300
committerFrederick Muriuki Muriithi2023-05-30 12:47:59 +0300
commit0911c243764a3a2a2860e585a044127c1cc6afab (patch)
tree32a7948fd1aa4bc6cdf9772a084204fc7ded60bb /topics/authentication
parent370963d7b1582c1ca73c339f2ed0115b5e7bb211 (diff)
downloadgn-gemtext-0911c243764a3a2a2860e585a044127c1cc6afab.tar.gz
Update docs on registering/setting user as sysadmin
Diffstat (limited to 'topics/authentication')
-rw-r--r--topics/authentication/cli_utility_scripts.gmi31
1 files changed, 24 insertions, 7 deletions
diff --git a/topics/authentication/cli_utility_scripts.gmi b/topics/authentication/cli_utility_scripts.gmi
index 65d93e0..9206a5e 100644
--- a/topics/authentication/cli_utility_scripts.gmi
+++ b/topics/authentication/cli_utility_scripts.gmi
@@ -29,15 +29,32 @@ Commands:
shell session and then just run the commands without prepending with the
`FLASK_APP="main.py"` declaration.
-## Setting a User as System Administrator
+## Registering/Setting a User as System Administrator
-Once you have registered the user with the new (as of 2023-05-26)
-auth(entic|oris)ation system, you can then proceed to specify that the user is
-going to be a system administrator of the system.
+You can register an new user and set them as the system administrator with:
+```sh
+FLASK_APP="main.py" flask register-admin
+```
+
+A typical session might go something like:
+```sh
+$ FLASK_APP="main.py" flask register-admin
+Enter the user's name: CLI SysAdmin
+Enter the administrator's email: someadmin@gmail.com
+Enter password:
+Confirm password:
+$
+```
+
+You can also run the script directly (without flask) with:
+```sh
+$ python3 -m scripts.register_sys_admin /home/frederick/genenetwork/gn3_files/db/auth.db
+```
+changing "/home/frederick/genenetwork/gn3_files/db/auth.db" to the path to your database file.
+
+### Setting an Existing User to System Administrator
-You will need to retrieve the users identifier (UUID) from the system; say the
-UUID you get for the user is `5b15ef01-a9d7-4ee4-9a38-fe9dd1d871b8`, you can
-then set that user as a system administrator by running:
+If a user already exists in your system, and you want to make that user system admin, you could do it with:
```sh
FLASK_APP="main.py" flask assign-system-admin 5b15ef01-a9d7-4ee4-9a38-fe9dd1d871b8