aboutsummaryrefslogtreecommitdiffstats
path: root/thallium-backend
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-08-19 14:53:41 +0100
committerGravatar Chris Lovering <[email protected]>2024-08-19 19:26:46 +0100
commit1c1ecd1f54a9cd8aeedf4095979d7893c52204f8 (patch)
tree6c8a9cc091543ba99fd1605b7275c73fe36e44a8 /thallium-backend
parentRender Voucher ID on validation (diff)
Drop static file mount
Diffstat (limited to 'thallium-backend')
-rw-r--r--thallium-backend/src/app.py6
-rw-r--r--thallium-backend/src/static/base.css173
-rw-r--r--thallium-backend/src/static/favicons/README.md23
-rw-r--r--thallium-backend/src/static/favicons/android-chrome-192x192.pngbin2126 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/android-chrome-512x512.pngbin5197 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/apple-touch-icon.pngbin1412 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/browserconfig.xml9
-rw-r--r--thallium-backend/src/static/favicons/favicon-16x16.pngbin459 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/favicon-32x32.pngbin638 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/favicon.icobin15086 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/html_code.html9
-rw-r--r--thallium-backend/src/static/favicons/mstile-144x144.pngbin1572 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/mstile-150x150.pngbin1459 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/mstile-310x150.pngbin1486 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/mstile-310x310.pngbin2522 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/mstile-70x70.pngbin1196 -> 0 bytes
-rw-r--r--thallium-backend/src/static/favicons/safari-pinned-tab.svg1
-rw-r--r--thallium-backend/src/static/favicons/site.webmanifest19
18 files changed, 2 insertions, 238 deletions
diff --git a/thallium-backend/src/app.py b/thallium-backend/src/app.py
index 3f65631..69310a7 100644
--- a/thallium-backend/src/app.py
+++ b/thallium-backend/src/app.py
@@ -7,7 +7,6 @@ from fastapi import FastAPI, Request, Response
from fastapi.exceptions import RequestValidationError
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse, JSONResponse
-from fastapi.staticfiles import StaticFiles
from scalar_fastapi import get_scalar_api_reference
from src.routes import top_level_router
@@ -24,7 +23,6 @@ fastapi_app = FastAPI(
redoc_url=None,
)
fastapi_app.include_router(top_level_router)
-fastapi_app.mount("/static", StaticFiles(directory="src/static"), name="static")
fastapi_app.add_middleware(
CORSMiddleware,
@@ -35,7 +33,7 @@ fastapi_app.add_middleware(
)
-@fastapi_app.get("/heartbeat")
+@fastapi_app.get("/heartbeat", include_in_schema=False)
def health_check() -> JSONResponse:
"""Return basic response, for use as a health check."""
return JSONResponse({"detail": "I am alive!"})
@@ -45,7 +43,7 @@ def build_url(request: Request, path: str = "") -> str:
"""Build a URL from a request, for OpenAPI + Scalar."""
scheme = request.headers.get("x-forwarded-proto", request.url.scheme)
- return f"{scheme}://{request.headers['Host']}{CONFIG.app_prefix}{path}"
+ return f"{scheme}://{request.headers["Host"]}{CONFIG.app_prefix}{path}"
@fastapi_app.get("/docs", include_in_schema=False)
diff --git a/thallium-backend/src/static/base.css b/thallium-backend/src/static/base.css
deleted file mode 100644
index aba5aaf..0000000
--- a/thallium-backend/src/static/base.css
+++ /dev/null
@@ -1,173 +0,0 @@
-:root {
- --docs-light: #2D3134;
- --docs-dark: #23272A;
- --blurple: #7289DA;
- --docs-text-light: #92d6ff;
- --docs-input-background: #0f141a;
- --docs-text-teal: #c1f0f1;
-}
-
-* {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
-}
-
-html {
- height: 100%;
-}
-
-body {
- font-family: "Hind", "Helvetica", "Arial", sans-serif;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
-}
-
-h1,
-p {
- margin: 0;
- padding: 0;
- line-height: 125%;
-}
-
-h1 {
- margin-bottom: 15px;
- font-size: 26px;
-}
-
-a {
- color: var(--blurple);
- text-decoration: none;
-}
-
-.main-box {
- display: flex;
- flex-direction: column;
- max-width: 512px;
- background-color: white;
- border-radius: 15px;
- overflow: hidden;
- box-shadow: 5px 7px 40px rgba(0, 0, 0, 0.432);
-}
-
-.header-box {
- display: flex;
- flex-direction: column;
- justify-content: center;
- height: 120px;
- width: auto;
- padding: 15px;
- background-color: var(--docs-light);
-}
-
-.header-content {
- align-self: center;
-}
-
-.header-content > h1 {
- color: white;
- font-size: 75px;
- font-weight: bold;
- letter-spacing: -1px;
- line-height: 1;
- margin-bottom: -10px;
-}
-
-.header-content > p {
- flex-direction: column;
- color: #CAD6FF;
- font-size: 25px;
- font-weight: bold;
- letter-spacing: -1px;
- line-height: 1;
- text-align: center;
-}
-
-.logo-box > a {
- display: flex;
- justify-content: center;
- height: 120px;
- width: auto;
- padding: 15px;
- background-color: var(--docs-light);
-}
-
-.content-box {
- flex-direction: row;
- height: auto;
- padding: 25px 25px 0 25px;
- background-color: var(--docs-dark);
- color: #fff;
-}
-
-#api-token {
- background-color: var(--docs-input-background);
- font-family: monospace;
- font-size: 18px;
- text-align: center;
- padding: 5px 6px 5px 5px;
- width: 100%;
- color: var(--docs-text-teal);
- border: #758ad4 1px solid;
- border-radius: 5px;
- cursor: pointer;
- transition: 0.3s;
- text-overflow: ellipsis;
-}
-
-#api-token:focus {
- outline: 0 solid white;
-}
-
-button {
- float: right;
- padding: 0 10px 0 20px;
- font-family: monospace;
- font-size: 20px;
- font-weight: 600;
- border-radius: 5px;
- background-color: var(--blurple);
- border: none;
- transition: 0.3s;
- cursor: pointer;
- color: white;
- margin-left: -2.5%;
- clip-path: polygon(10% 0%, 100% 0%, 100% 100%, 10% 100%);
-
-}
-
-#token-div {
- display: flex;
- transition: 0.3s;
-}
-
-#token-div:hover > button {
- background-color: #333c5c;
-}
-
-#token-div:hover > #api-token {
- border-color: #333c5c;
-}
-
-#api-token:focus-visible {
- border-color: forestgreen !important;
-}
-
-#api-token:focus-visible ~ #token-button {
- background-color: forestgreen;
-}
-
-#api-token:focus-visible ~ #token-button > span {
- display: none
-}
-
-#api-token:focus-visible ~ #token-button:after {
- content: "Copied";
-}
-
-
-ul {
- margin: 20px;
-}
diff --git a/thallium-backend/src/static/favicons/README.md b/thallium-backend/src/static/favicons/README.md
deleted file mode 100644
index 054dbcf..0000000
--- a/thallium-backend/src/static/favicons/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# Your Favicon Package
-
-This package was generated with [RealFaviconGenerator](https://realfavicongenerator.net/) [v0.16](https://realfavicongenerator.net/change_log#v0.16)
-
-## Install instructions
-
-To install this package:
-
-Extract this package in <code>&lt;web site&gt;/static/favicons/</code>. If your site is <code>http://www.example.com</code>, you should be able to access a file named <code>http://www.example.com/static/favicons/favicon.ico</code>.
-
-Insert the following code in the `head` section of your pages:
-
- <link rel="apple-touch-icon" sizes="180x180" href="/static/favicons/apple-touch-icon.png?v=9B9vkE5q7O">
- <link rel="icon" type="image/png" sizes="32x32" href="/static/favicons/favicon-32x32.png?v=9B9vkE5q7O">
- <link rel="icon" type="image/png" sizes="16x16" href="/static/favicons/favicon-16x16.png?v=9B9vkE5q7O">
- <link rel="manifest" href="/static/favicons/site.webmanifest?v=9B9vkE5q7O">
- <link rel="mask-icon" href="/static/favicons/safari-pinned-tab.svg?v=9B9vkE5q7O" color="#7289da">
- <link rel="shortcut icon" href="/static/favicons/favicon.ico?v=9B9vkE5q7O">
- <meta name="msapplication-TileColor" content="#7289da">
- <meta name="msapplication-config" content="/static/favicons/browserconfig.xml?v=9B9vkE5q7O">
- <meta name="theme-color" content="#7289da">
-
-*Optional* - Check your favicon with the [favicon checker](https://realfavicongenerator.net/favicon_checker)
diff --git a/thallium-backend/src/static/favicons/android-chrome-192x192.png b/thallium-backend/src/static/favicons/android-chrome-192x192.png
deleted file mode 100644
index 5b8e4de..0000000
--- a/thallium-backend/src/static/favicons/android-chrome-192x192.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/android-chrome-512x512.png b/thallium-backend/src/static/favicons/android-chrome-512x512.png
deleted file mode 100644
index 260d57e..0000000
--- a/thallium-backend/src/static/favicons/android-chrome-512x512.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/apple-touch-icon.png b/thallium-backend/src/static/favicons/apple-touch-icon.png
deleted file mode 100644
index bcee3b3..0000000
--- a/thallium-backend/src/static/favicons/apple-touch-icon.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/browserconfig.xml b/thallium-backend/src/static/favicons/browserconfig.xml
deleted file mode 100644
index c0529c4..0000000
--- a/thallium-backend/src/static/favicons/browserconfig.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<browserconfig>
- <msapplication>
- <tile>
- <square150x150logo src="/static/favicons/mstile-150x150.png?v=9B9vkE5q7O"/>
- <TileColor>#7289da</TileColor>
- </tile>
- </msapplication>
-</browserconfig>
diff --git a/thallium-backend/src/static/favicons/favicon-16x16.png b/thallium-backend/src/static/favicons/favicon-16x16.png
deleted file mode 100644
index 97d9d7e..0000000
--- a/thallium-backend/src/static/favicons/favicon-16x16.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/favicon-32x32.png b/thallium-backend/src/static/favicons/favicon-32x32.png
deleted file mode 100644
index 9acca4b..0000000
--- a/thallium-backend/src/static/favicons/favicon-32x32.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/favicon.ico b/thallium-backend/src/static/favicons/favicon.ico
deleted file mode 100644
index 6f2da14..0000000
--- a/thallium-backend/src/static/favicons/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/html_code.html b/thallium-backend/src/static/favicons/html_code.html
deleted file mode 100644
index 564d5ea..0000000
--- a/thallium-backend/src/static/favicons/html_code.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<link rel="apple-touch-icon" sizes="180x180" href="/static/favicons/apple-touch-icon.png?v=9B9vkE5q7O">
-<link rel="icon" type="image/png" sizes="32x32" href="/static/favicons/favicon-32x32.png?v=9B9vkE5q7O">
-<link rel="icon" type="image/png" sizes="16x16" href="/static/favicons/favicon-16x16.png?v=9B9vkE5q7O">
-<link rel="manifest" href="/static/favicons/site.webmanifest?v=9B9vkE5q7O">
-<link rel="mask-icon" href="/static/favicons/safari-pinned-tab.svg?v=9B9vkE5q7O" color="#7289da">
-<link rel="shortcut icon" href="/static/favicons/favicon.ico?v=9B9vkE5q7O">
-<meta name="msapplication-TileColor" content="#7289da">
-<meta name="msapplication-config" content="/static/favicons/browserconfig.xml?v=9B9vkE5q7O">
-<meta name="theme-color" content="#7289da">
diff --git a/thallium-backend/src/static/favicons/mstile-144x144.png b/thallium-backend/src/static/favicons/mstile-144x144.png
deleted file mode 100644
index 734c4d1..0000000
--- a/thallium-backend/src/static/favicons/mstile-144x144.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/mstile-150x150.png b/thallium-backend/src/static/favicons/mstile-150x150.png
deleted file mode 100644
index c0f2947..0000000
--- a/thallium-backend/src/static/favicons/mstile-150x150.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/mstile-310x150.png b/thallium-backend/src/static/favicons/mstile-310x150.png
deleted file mode 100644
index 6806f40..0000000
--- a/thallium-backend/src/static/favicons/mstile-310x150.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/mstile-310x310.png b/thallium-backend/src/static/favicons/mstile-310x310.png
deleted file mode 100644
index 1be6d14..0000000
--- a/thallium-backend/src/static/favicons/mstile-310x310.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/mstile-70x70.png b/thallium-backend/src/static/favicons/mstile-70x70.png
deleted file mode 100644
index 1916fac..0000000
--- a/thallium-backend/src/static/favicons/mstile-70x70.png
+++ /dev/null
Binary files differ
diff --git a/thallium-backend/src/static/favicons/safari-pinned-tab.svg b/thallium-backend/src/static/favicons/safari-pinned-tab.svg
deleted file mode 100644
index 3206487..0000000
--- a/thallium-backend/src/static/favicons/safari-pinned-tab.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg version="1" xmlns="http://www.w3.org/2000/svg" width="933.333" height="933.333" viewBox="0 0 700.000000 700.000000"><path d="M321.8.5c-.1.1-5.1.6-10.9.9-5.8.4-11.5.8-12.5 1-1 .2-5.5.7-9.9 1.1-4.4.4-8.9.9-10 1-31.2 5.2-44.4 8.9-60.5 16.7-13.5 6.7-22.9 15.5-28.2 26.8-3 6.3-5.4 13.2-4.8 14.2.1.2-.3 1.5-.8 2.9-1.8 4.6-2.5 19.7-2.6 56.1l-.1 35.8 3 .1c1.6 0 39.3.1 83.8.1H349l.1 2.9c0 1.6.1 5.8.1 9.4 0 3.6-.1 7.1-.1 7.8-.1 1-24.3 1.2-118.3 1.3-65.1 0-121.4.3-125.3.7-22.8 2.2-45.8 13.2-62.1 29.5-18.7 18.8-28.9 42.9-36 84.7-1.9 11.8-2.4 14.6-3 19.5-.3 3-.8 7.1-1.1 9-.9 6.9-1 40.7-.2 49 1.6 16.2 4.8 36.3 7.4 47 .8 3 1.6 6.6 1.8 8 2 10.6 7.7 28.1 12.8 38.8C38 492 56 508 81.8 515.2c7.2 2 10.1 2.2 43.2 2.2l35.5.1.2-42.5c.1-23.4.4-44.1.7-46 5.8-39.1 34.7-73.8 71.6-85.8 16.7-5.4 16.2-5.4 119-5.7 50.9-.1 94.1-.6 96-1 7.7-1.5 20.6-6.6 28.1-11.1 18.5-11.2 31.9-29.6 38.1-52.1 2.1-7.7 2.1-9.2 2.3-97.5.2-93.5.1-95.2-4.1-107.6-7.7-22.9-29.1-44.1-54.7-54.4-6.8-2.7-17.3-5.8-21.7-6.3-1.9-.3-5.7-.9-8.5-1.5-2.7-.5-7.2-1.2-10-1.6-2.7-.3-6.1-.7-7.5-.9-1.4-.2-6.1-.7-10.5-1.1-4.4-.4-9.3-.9-11-1.1-3.6-.5-66.2-1.3-66.7-.8zm-59.1 51.9c6.3 1.7 10.7 4.3 14.9 8.8 9.2 9.8 11.4 23.5 5.8 35.5-3.1 6.5-8 11.4-14.9 15.1-4.2 2.2-6.3 2.7-13 2.7s-8.9-.4-13.5-2.7c-9.4-4.6-14.9-11.1-17.3-20.8-4.4-17.1 6.4-34.9 23.7-39.1 4.9-1.1 8.7-1 14.3.5z"/><path d="M538.6 178.9c-.3.4-.6 19.5-.7 42.3-.1 36.1-.4 42.7-2 50.4-3.3 16.1-8.7 28.6-17.7 41.3-6.9 9.7-11.8 14.9-21.2 22.2-4.1 3.3-8 6.3-8.6 6.8-.6.5-5.8 3.2-11.5 5.9-10.7 5.2-21.3 8.5-30.9 9.8-3 .4-46.9.8-97.5.9-50.6.1-93.6.5-95.5.9-22.7 4.5-40 15.1-53.5 32.6-7.9 10.3-14.8 25.5-16 35.7-.4 2.6-.9 5.6-1.1 6.6-1.1 3.7-.5 174.1.6 180.2 1.4 7.7 1.2 7 3.9 14 10.2 27 40.7 48.6 85.7 60.6 12.3 3.3 12.2 3.2 23.4 5.5 25.9 5.3 63.4 6.6 89 3 29.7-4.1 58.5-12.3 79.5-22.6 29.8-14.5 46.8-34.3 51.3-59.5.4-2.2.7-20.4.7-40.5v-36.4l-83.5-.1h-83.5v-9.8c0-5.7.4-10.1 1-10.5.5-.4 59-.7 130-.8 71 0 131-.4 133.4-.8 20.3-3.4 35.2-13.4 47.8-32.4 5.8-8.6 14.4-26.8 18.8-39.5 1.3-4 3.2-9.2 4.1-11.7 4.9-13.7 10.4-40.1 12-57.5.8-9 .8-34.1 0-42.5-1.3-14.1-1.8-17.9-2.6-23-.5-3-1.1-7.1-1.4-9-.8-5.2-4.3-22.3-6.6-32-1.1-4.7-2.3-9.4-2.5-10.5-3.1-13.5-13.8-38-20.9-47.8-6.8-9.6-19.3-21.7-22.4-21.7-.6 0-1.2-.4-1.4-.8-.7-1.9-13.6-6.7-23.3-8.8-4.3-.9-76.4-1.4-76.9-.5zm-81.2 405.7c6.8 3.3 12.5 9.3 15.4 16.4 3.2 7.7 2.6 19.6-1.3 26.9-5.8 10.6-15.5 16.4-27.5 16.5-9 .1-16.7-3-22.5-9.1-9.1-9.3-11.6-24-6.3-35.5 7.5-16.2 26.3-23 42.2-15.2z"/></svg>
diff --git a/thallium-backend/src/static/favicons/site.webmanifest b/thallium-backend/src/static/favicons/site.webmanifest
deleted file mode 100644
index 1c59aa6..0000000
--- a/thallium-backend/src/static/favicons/site.webmanifest
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "Python Discord",
- "short_name": "Python Discord",
- "icons": [
- {
- "src": "/static/favicons/android-chrome-192x192.png?v=9B9vkE5q7O",
- "sizes": "192x192",
- "type": "image/png"
- },
- {
- "src": "/static/favicons/android-chrome-512x512.png?v=9B9vkE5q7O",
- "sizes": "512x512",
- "type": "image/png"
- }
- ],
- "theme_color": "#7289da",
- "background_color": "#7289da",
- "display": "standalone"
-}