From efff06bdacf95e3f0496d274b8c00cd78846986b Mon Sep 17 00:00:00 2001
From: Julian Keck <julian.keck9@kit.edu>
Date: Wed, 24 Jul 2024 15:31:31 +0200
Subject: [PATCH] ADD clarifications to middleware documentation

---
 .env.example |  3 +--
 HOWTO.md     |  1 -
 README.md    | 22 +++++++++++++++++-----
 3 files changed, 18 insertions(+), 8 deletions(-)
 delete mode 100644 HOWTO.md

diff --git a/.env.example b/.env.example
index 005c84a..e0e6e2c 100644
--- a/.env.example
+++ b/.env.example
@@ -41,7 +41,6 @@ MAIL_SMARTHOST=""
 
 IP_CONTACT_SEND_MAIL="true"
 # IP_CONTACT_OVERRIDE_MAIL_RECEIVER="somebody@example.com"
-IP_CONTACT_EMAIL_SENDER="noreply@netvs.scc.kit.edu"
+IP_CONTACT_EMAIL_SENDER="noreply@netvs-devel.scc.kit.edu"
 
 WAPI_NETVS_SUPERUSER=""
-
diff --git a/HOWTO.md b/HOWTO.md
deleted file mode 100644
index 70b2ec8..0000000
--- a/HOWTO.md
+++ /dev/null
@@ -1 +0,0 @@
-gunicorn -k uvicorn.workers.UvicornWorker --reload --bind localhost:8000 main:app
diff --git a/README.md b/README.md
index bcb9053..436c117 100644
--- a/README.md
+++ b/README.md
@@ -2,19 +2,19 @@
 
 ## Installation
 
-The NET-SUITE middleware requires ```python3```.
+The NETVS middleware requires ```python3```.
 
 In case you don't want a venv setup, omit steps 1&2.
 1. Create venv:
 
    ```shell
-    virtualenv venv/
+    python3 -m venv venv/
     ```
    
 2. Change into venv:
 
    ```shell
-    source bin/activate
+    source venv/bin/activate
     ```
 
 3. Install dependencies:
@@ -23,9 +23,9 @@ In case you don't want a venv setup, omit steps 1&2.
     pip install -r requirements.txt
     ```
 
-## Generate APLIST/MACFINDER certificate
+## Generate AP-List/MACfinder certificate
 Login as root on `macfinder-1.tmn.scc.kit.edu` and execute `/root/make-devel-cert.sh <certname>`.
-The script will ask for some input. Typically the default and yes are correct.
+The script will ask for some input. Typically, the default values and yes are correct.
 
 ## Productive setup with uwsgi
 
@@ -40,12 +40,24 @@ uwsgi -s /tmp/net-suite.sock --virtualenv <path to env> --manage-script-name --m
 ```shell
 python3 main.py
 ```
+or
+```shell
+gunicorn -k uvicorn.workers.UvicornWorker --reload --bind localhost:8000 main:app
+```
 
 ## systemd
 
 Also take at look at the [uwsgi documentation](http://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd).
 
 ## Configuration
+### Middleware
+`WAPI_NETVS_SUPERUSER` is the superuser for the middleware.
+When queries are required which are not possible as the requesting user (due to permission restrictions), the superuser is used.
+Therefore, the user must have the necessary permissions to execute those queries.
+Typically, a user with `cntl.default_reader` and `wapi.devel_tester` is used.
+
+As the queries are executed directly against the database, no token for the user is required; it will only be used to populate the context of the query.
+
 ### NET-DB
 #### Postgres
 Net-Suite uses different databases depending on the host operation mode defined in ```/usr/local/etc/host_oper_mode_data.cfg```:
-- 
GitLab