Skip to content

Commit

Permalink
told python how to get those envs
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Sep 20, 2024
1 parent 034386d commit 5bdf5f0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import subprocess
from configparser import ExtendedInterpolation
from contextlib import asynccontextmanager
from dotenv import load_dotenv
from os.path import exists
from pathlib import Path
from pwd import getpwnam
Expand All @@ -22,6 +21,7 @@
import httpx
import psutil
import uvicorn
from dotenv import load_dotenv
from fastapi import FastAPI, HTTPException, Request
from fastapi.security import HTTPBearer
from flaat.config import AccessLevel
Expand Down Expand Up @@ -99,10 +99,22 @@ async def lifespan(app: FastAPI):
SESSION_STORE_PATH = os.environ.get(
"TEAPOT_SESSIONS", "/var/lib/teapot/webdav/teapot_sessions.json"
)
APP_NAME = os.getenv("APP_NAME")
# one less than the first port that is going to be used by any storm webdav
# instance, should be above 1024, as all ports below this are privileged and
# normal users will not be able to use them to run services.
STARTING_PORT = os.getenv("STARTING_PORT")
# toggle restarting teapot without deleting saved state and without
# terminating running webdav instances.
# N.B. will only consider the value set at startup of this app.
RESTART = os.environ.get("TEAPOT_RESTART", "False") == "True"
# instance timeout, instances are deleted after this time without being
# accessed.
# default: 10 minutes
INSTANCE_TIMEOUT_SEC = os.getenv("INSTANCE_TIMEOUT_SEC")
# interval between instance timeout checks in stop_expired_instances
# default: 3 minutes
CHECK_INTERVAL_SEC = os.getenv("CHECK_INTERVAL_SEC")
# number of times that teapot will try to connect to a recently started
# instance
STARTUP_TIMEOUT = int(os.environ.get("TEAPOT_STARTUP_TIMEOUT", 30))
Expand Down

1 comment on commit 5bdf5f0

@vrbanecd
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
16 16 0 32 50.00 739.349ms

Passed Tests

Name ⏱️ Duration Suite
GET NO TOKEN 0.010 s Teapot-Tests
GET INVALID TOKEN 0.032 s Teapot-Tests
PUT REQUEST INVALID TOKEN 0.010 s Teapot-Tests
PUT REQUEST NO TOKEN 0.009 s Teapot-Tests
GET FILE NO TOKEN 0.009 s Teapot-Tests
GET FILE INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN 0.009 s Teapot-Tests
GET NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET FILE NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET FILE INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
DELETE REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests

Failed Tests

Name Message ⏱️ Duration Suite
GET USER1 Url: https://teapot:8081/default_area Expected status: 500 != 200 0.261 s Teapot-Tests
GET USER2 Url: https://teapot:8081/default_area Expected status: 500 != 200 0.087 s Teapot-Tests
PUT REQUEST USER1 Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 204 0.021 s Teapot-Tests
PUT REQUEST USER2 Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 204 0.020 s Teapot-Tests
GET FILE USER1 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 204 0.020 s Teapot-Tests
GET FILE USER2 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 204 0.020 s Teapot-Tests
DELETE REQUEST USER1 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 0.010 s Teapot-Tests
DELETE REQUEST USER2 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 0.010 s Teapot-Tests
GET USER1 EXTRA_AREA Url: https://teapot:8081/extra_area Expected status: 500 != 200 0.009 s Teapot-Tests
GET USER2 EXTRA_AREA Url: https://teapot:8081/extra_area Expected status: 500 != 200 0.010 s Teapot-Tests
PUT REQUEST USER1 EXTRA_AREA Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 204 0.020 s Teapot-Tests
PUT REQUEST USER2 EXTRA_AREA Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 204 0.020 s Teapot-Tests
GET FILE USER1 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 204 0.021 s Teapot-Tests
GET FILE USER2 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 204 0.023 s Teapot-Tests
DELETE REQUEST USER1 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 0.010 s Teapot-Tests
DELETE REQUEST USER2 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 0.011 s Teapot-Tests

Please sign in to comment.