README.md - added configuration variables & implemented support for 'LEASE_EXPIRE_DAYS'

This commit is contained in:
Oscar Krause 2022-12-20 15:05:50 +01:00
parent 7ab5e7b264
commit 8d93c92de4
2 changed files with 9 additions and 1 deletions

View File

@ -16,6 +16,14 @@ openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout $WORKING_DIR/webse
docker run -e DLS_URL=`hostname -i` -e DLS_PORT=443 -p 443:443 -v $WORKING_DIR:/app/cert collinwebdesigns/fastapi-dls:latest docker run -e DLS_URL=`hostname -i` -e DLS_PORT=443 -p 443:443 -v $WORKING_DIR:/app/cert collinwebdesigns/fastapi-dls:latest
``` ```
# Configuration
| Variable | Default | Usage |
|---------------------|-------------|---------------------------------------------------------------------------|
| `DLS_URL` | `localhost` | Used in client-token to tell guest driver where dls instance is reachable |
| `DLS_PORT` | `443` | Used in client-token to tell guest driver where dls instance is reachable |
| `LEASE_EXPIRE_DAYS` | `90` | Lease time in days |
# Installation # Installation
**The token file has to be copied! It's not enough to C&P file contents, because there can be special characters.** **The token file has to be copied! It's not enough to C&P file contents, because there can be special characters.**

View File

@ -31,7 +31,7 @@ def load_key(filename) -> RsaKey:
app, db = FastAPI(), dataset.connect('sqlite:///db.sqlite') app, db = FastAPI(), dataset.connect('sqlite:///db.sqlite')
LEASE_EXPIRE_DELTA = relativedelta(minutes=15) # days=90 LEASE_EXPIRE_DELTA = relativedelta(days=int(getenv('LEASE_EXPIRE_DAYS', 90)))
DLS_URL = str(getenv('DLS_URL', 'localhost')) DLS_URL = str(getenv('DLS_URL', 'localhost'))
DLS_PORT = int(getenv('DLS_PORT', '443')) DLS_PORT = int(getenv('DLS_PORT', '443'))