From 50dea9ac4e46ae2157d3d10da6802ac191f77c07 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Thu, 5 Jan 2023 14:08:08 +0100 Subject: [PATCH 1/8] fixes --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d87f25d..8274c25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -297,7 +297,7 @@ release: script: - echo "Running release-job for $VERSION" release: - name: $CI_PROJECT_TITLE $version + name: $CI_PROJECT_TITLE $VERSION description: Release of $CI_PROJECT_TITLE version $VERSION tag_name: $VERSION ref: $CI_COMMIT_SHA From 5425eec545b2cd59bd39029c0d1ae0ba50bea898 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 16 Jan 2023 10:23:58 +0100 Subject: [PATCH 2/8] .gitlab-ci.yml simplified --- .gitlab-ci.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8274c25..89db932 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,7 +97,7 @@ build:pacman: - "*.pkg.tar.zst" test: - image: python:3.10-slim-bullseye + image: python:3.11-slim-bullseye stage: test rules: - if: $CI_COMMIT_BRANCH @@ -113,6 +113,9 @@ test: - cd test script: - pytest main.py + artifacts: + reports: + dotenv: version.env .test:linux: stage: test @@ -271,24 +274,11 @@ deploy:pacman: - 'echo "EXPORT_NAME: ${EXPORT_NAME}"' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${EXPORT_NAME} "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${PACKAGE_VERSION}/${EXPORT_NAME}"' -release:prepare: - stage: .pre - rules: - - if: $CI_COMMIT_TAG - when: never - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - script: - - source version.env - - echo $VERSION - artifacts: - reports: - dotenv: version.env - release: image: registry.gitlab.com/gitlab-org/release-cli:latest stage: .post needs: - - job: release:prepare + - job: test artifacts: true rules: - if: $CI_COMMIT_TAG From ca8a9df54c138080efb03063a1e89b8803b4b3ed Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 16 Jan 2023 10:24:08 +0100 Subject: [PATCH 3/8] requirements.txt updated --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e505de0..4c25d3f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -fastapi==0.88.0 +fastapi==0.89.1 uvicorn[standard]==0.20.0 python-jose==3.3.0 pycryptodome==3.16.0 From ed13577e8266477b80fb8c8dfac9b3f1172772ea Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 16 Jan 2023 10:30:21 +0100 Subject: [PATCH 4/8] Dockerfile - updated to python 3.11 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6ffaee6..e92f5dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10-alpine +FROM python:3.11-alpine COPY requirements.txt /tmp/requirements.txt From 3495cc3af55e4fd5e76506b53256ae7e878387eb Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 16 Jan 2023 10:30:40 +0100 Subject: [PATCH 5/8] typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e301f67..20caf9b 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ volumes: dls-db: ``` -## Debian/Ubuntu (manual method using `git clone`) +## Debian/Ubuntu (manual method using `git clone` and python virtual environment) Tested on `Debian 11 (bullseye)`, Ubuntu may also work. From 20cc984799965a3fec0deec8c4d15886d377a957 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 16 Jan 2023 10:30:55 +0100 Subject: [PATCH 6/8] FAQ.md --- FAQ.md | 17 +++++++++++++++++ README.md | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 FAQ.md diff --git a/FAQ.md b/FAQ.md new file mode 100644 index 0000000..4ddd379 --- /dev/null +++ b/FAQ.md @@ -0,0 +1,17 @@ +# FAQ + +## `Failed to acquire license from (Info: - Error: The allowed time to process response has expired)` + +- Did your timezone settings are correct on fastapi-dls **and your guest**? + +- Did you download the client-token more than an hour ago? + +Please download a new client-token. The guest have to register within an hour after client-token was created. + + +## `jose.exceptions.JWTError: Signature verification failed.` + +- Did you recreated `instance.public.pem` / `instance.private.pem`? + +Then you have to download a **new** client-token on each of your guests. + diff --git a/README.md b/README.md index 20caf9b..49062da 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ Successful tested with: - Ubuntu 22.10 (Kinetic Kudu) Not working with: + - Debian 11 (Bullseye) and lower (missing `python-jose` dependency) - Ubuntu 22.04 (Jammy Jellyfish) (not supported as for 15.01.2023 due to [fastapi - uvicorn version missmatch](https://bugs.launchpad.net/ubuntu/+source/fastapi/+bug/1970557)) @@ -249,6 +250,16 @@ After first success you have to replace `--issue` with `--renew`. every 4.8 hours. If network connectivity is lost, the loss of connectivity is detected during license renewal and the client has 19.2 hours in which to re-establish connectivity before its license expires. +```python +from datetime import timedelta + +LEASE_RENEWAL_PERIOD=0.2 # 20% +delta = timedelta(days=1) +renew = delta.total_seconds() * LEASE_RENEWAL_PERIOD +renew = timedelta(seconds=renew) +expires = delta - renew # 19.2 +``` + \*2 Always use `https`, since guest-drivers only support secure connections! \*3 If you recreate instance keys you need to **recreate client-token for each guest**! From 3e445c80aa256fd300bc0930916a412533d26cd8 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 16 Jan 2023 10:33:52 +0100 Subject: [PATCH 7/8] fixes --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index 49062da..86f27ce 100644 --- a/README.md +++ b/README.md @@ -250,16 +250,6 @@ After first success you have to replace `--issue` with `--renew`. every 4.8 hours. If network connectivity is lost, the loss of connectivity is detected during license renewal and the client has 19.2 hours in which to re-establish connectivity before its license expires. -```python -from datetime import timedelta - -LEASE_RENEWAL_PERIOD=0.2 # 20% -delta = timedelta(days=1) -renew = delta.total_seconds() * LEASE_RENEWAL_PERIOD -renew = timedelta(seconds=renew) -expires = delta - renew # 19.2 -``` - \*2 Always use `https`, since guest-drivers only support secure connections! \*3 If you recreate instance keys you need to **recreate client-token for each guest**! From a65687a082afd9a55fa9e6329de269815314db71 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 16 Jan 2023 10:34:20 +0100 Subject: [PATCH 8/8] bump version to 1.3.1 --- version.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.env b/version.env index 5be527b..f406e04 100644 --- a/version.env +++ b/version.env @@ -1 +1 @@ -VERSION=1.3 +VERSION=1.3.1