Skip to content

Commit a3cc30f

Browse files
committed
Add server env var
1 parent 76c00e7 commit a3cc30f

5 files changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ docker run -d \
3535
-e DB_FILE=/config/api.db `#optional` \
3636
-e INVALIDATE_HOURS=24 `#optional` \
3737
-e PAT=token `#optional` \
38+
-e URL=http://localhost:8000 `#optional` \
3839
-p 8000:8000 \
3940
-v /path/to/lsio-api/config:/config \
4041
--restart unless-stopped \

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ full_custom_readme: |
4040
-e DB_FILE=/config/api.db `#optional` \
4141
-e INVALIDATE_HOURS=24 `#optional` \
4242
-e PAT=token `#optional` \
43+
-e URL=http://localhost:8000 `#optional` \
4344
-p 8000:8000 \
4445
-v /path/to/lsio-api/config:/config \
4546
--restart unless-stopped \

root/app/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
from models import ImagesResponse
77
from pydantic import ValidationError
88
import json
9+
import os
910
import traceback
1011

11-
api = FastAPI(docs_url=None, redoc_url=None, version="1.0", title="LinuxServer API")
12+
URL = os.environ.get("URL", "http://localhost:8000")
13+
api = FastAPI(docs_url=None, redoc_url=None, version="1.0", title="LinuxServer API", servers=[{"url": URL}])
1214
api.mount("/static", StaticFiles(directory="static"), name="static")
1315

1416

root/app/lsio_github.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
GH_AUTH = Auth.Token(PAT) if PAT else None
99
GH = Github(auth=GH_AUTH)
1010

11+
1112
def get_repos():
1213
org = GH.get_organization("linuxserver")
1314
return org.get_repos()

root/app/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Increment when updating schema
44
IMAGES_SCHEMA_VERSION = 1
55

6+
67
class Tag(BaseModel):
78
tag: str
89
desc: str

0 commit comments

Comments
 (0)