14 Commits
1.3 ... 1.3.2

Author SHA1 Message Date
Oscar Krause
164b5ebc44 Merge branch 'dev' into 'main'
1.3.2

See merge request oscar.krause/fastapi-dls!20
2023-01-17 11:36:23 +01:00
Oscar Krause
742fa07ed4 bump version to 1.3.2 2023-01-17 11:18:25 +01:00
Oscar Krause
a758d93970 main.py - fixed empty lease origin response 2023-01-17 11:18:07 +01:00
Oscar Krause
70250f1fca Merge branch 'dev' into 'main'
1.3.1

See merge request oscar.krause/fastapi-dls!19
2023-01-16 13:08:57 +01:00
Oscar Krause
a65687a082 bump version to 1.3.1 2023-01-16 10:34:20 +01:00
Oscar Krause
3e445c80aa fixes 2023-01-16 10:33:52 +01:00
Oscar Krause
20cc984799 FAQ.md 2023-01-16 10:30:55 +01:00
Oscar Krause
3495cc3af5 typos 2023-01-16 10:30:40 +01:00
Oscar Krause
ed13577e82 Dockerfile - updated to python 3.11 2023-01-16 10:30:21 +01:00
Oscar Krause
ca8a9df54c requirements.txt updated 2023-01-16 10:24:08 +01:00
Oscar Krause
5425eec545 .gitlab-ci.yml simplified 2023-01-16 10:23:58 +01:00
Oscar Krause
2f3c7d5433 Merge branch 'main' into dev 2023-01-16 07:00:20 +01:00
Oscar Krause
b551b0e7f9 README.md - added sunsupoorted ubuntu version 2023-01-15 19:47:50 +01:00
Oscar Krause
50dea9ac4e fixes 2023-01-05 14:08:08 +01:00
7 changed files with 35 additions and 22 deletions

View File

@@ -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
@@ -297,7 +287,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

View File

@@ -1,4 +1,4 @@
FROM python:3.10-alpine
FROM python:3.11-alpine
COPY requirements.txt /tmp/requirements.txt

17
FAQ.md Normal file
View File

@@ -0,0 +1,17 @@
# FAQ
## `Failed to acquire license from <ip> (Info: <license> - 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.

View File

@@ -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.
@@ -175,6 +175,11 @@ Successful tested with:
- Debian 12 (Bookworm) (works but not recommended because it is currently in *testing* state)
- 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))
**Run this on your server instance**
First go to [GitLab-Registry](https://git.collinwebdesigns.de/oscar.krause/fastapi-dls/-/packages) and select your

View File

@@ -170,8 +170,9 @@ async def _leases(request: Request, origin: bool = False):
for lease in session.query(Lease).all():
x = lease.serialize()
if origin:
# assume that each lease has a valid origin record
x['origin'] = session.query(Origin).filter(Origin.origin_ref == lease.origin_ref).first().serialize()
lease_origin = session.query(Origin).filter(Origin.origin_ref == lease.origin_ref).first()
if lease_origin is not None:
x['origin'] = lease_origin.serialize()
response.append(x)
session.close()
return JSONr(response)

View File

@@ -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

View File

@@ -1 +1 @@
VERSION=1.3
VERSION=1.3.2