diff options
-rw-r--r-- | Dockerfile | 11 | ||||
-rwxr-xr-x | manage.py | 2 | ||||
-rw-r--r-- | pydis_site/static/css/base/base.css | 8 | ||||
-rw-r--r-- | pydis_site/static/css/error_pages.css | 66 | ||||
-rw-r--r-- | pydis_site/templates/404.html | 34 | ||||
-rw-r--r-- | pydis_site/templates/500.html | 29 | ||||
-rw-r--r-- | pydis_site/templates/base/footer.html | 2 |
7 files changed, 145 insertions, 7 deletions
@@ -3,14 +3,10 @@ FROM python:3.8-slim-buster # Allow service to handle stops gracefully STOPSIGNAL SIGQUIT -# Set Git SHA build argument -ARG git_sha="development" - # Set pip to have cleaner logs and no saved cache ENV PIP_NO_CACHE_DIR=false \ PIPENV_HIDE_EMOJIS=1 \ - PIPENV_NOSPIN=1 \ - GIT_SHA=$git_sha + PIPENV_NOSPIN=1 # Install git RUN apt-get -y update \ @@ -31,6 +27,11 @@ COPY . . # Install project dependencies RUN pipenv install --system --deploy + +# Set Git SHA environment variable +ARG git_sha="development" +ENV GIT_SHA=$git_sha + # Run web server through custom manager ENTRYPOINT ["python", "manage.py"] CMD ["run"] @@ -163,7 +163,7 @@ class SiteManager: "-b", "0.0.0.0:8000", "pydis_site.wsgi:application", "--threads", "8", - "-w", "4", + "-w", "2", "--max-requests", "1000", "--max-requests-jitter", "50", "--statsd-host", "graphite.default.svc.cluster.local:8125", diff --git a/pydis_site/static/css/base/base.css b/pydis_site/static/css/base/base.css index b53ff5d4..a1d325f9 100644 --- a/pydis_site/static/css/base/base.css +++ b/pydis_site/static/css/base/base.css @@ -69,6 +69,14 @@ main.site-content { background-color: transparent; } +#linode-logo { + padding-left: 15px; + background: url(https://www.linode.com/wp-content/uploads/2021/01/Linode-Logo-Black.svg) no-repeat center; + filter: invert(1) grayscale(1); + background-size: 60px; + color: #00000000; +} + #django-logo { padding-bottom: 2px; background: url(https://static.djangoproject.com/img/logos/django-logo-negative.png) no-repeat center; diff --git a/pydis_site/static/css/error_pages.css b/pydis_site/static/css/error_pages.css new file mode 100644 index 00000000..77bb7e2b --- /dev/null +++ b/pydis_site/static/css/error_pages.css @@ -0,0 +1,66 @@ +html { + height: 100%; +} + +body { + background-color: #7289DA; + background-image: url("https://raw.githubusercontent.com/python-discord/branding/master/logos/banner_pattern/banner_pattern.svg"); + background-size: 128px; + font-family: "Hind", "Helvetica", "Arial", sans-serif; + display: flex; + align-items: center; + justify-content: center; + height: 100%; +} + +h1, +p { + color: black; + padding: 0; + margin: 0; + margin-bottom: 10px; +} + +h1 { + margin-bottom: 15px; + font-size: 26px; +} + +p, +li { + line-height: 125%; +} + +a { + color: #7289DA; +} + +ul { + margin-bottom: 0; +} + +li { + margin-top: 10px; +} + +.error-box { + display: flex; + flex-direction: column; + max-width: 512px; + background-color: white; + border-radius: 20px; + overflow: hidden; + box-shadow: 5px 7px 40px rgba(0, 0, 0, 0.432); +} + +.logo-box { + display: flex; + justify-content: center; + height: 80px; + padding: 15px; + background-color: #758ad4; +} + +.content-box { + padding: 25px; +} diff --git a/pydis_site/templates/404.html b/pydis_site/templates/404.html new file mode 100644 index 00000000..42e317d2 --- /dev/null +++ b/pydis_site/templates/404.html @@ -0,0 +1,34 @@ +{% load static %} + +<!DOCTYPE html> +<html lang="en"> + +<head> + <title>Python Discord | 404</title> + + <meta charset="UTF-8"> + + <link rel="preconnect" href="https://fonts.gstatic.com"> + <link href="https://fonts.googleapis.com/css2?family=Hind:wght@400;600&display=swap" rel="stylesheet"> + <link rel="stylesheet" href="{% static "css/error_pages.css" %}"> +</head> + +<body> + <div class="error-box"> + <div class="logo-box"> + <img src="https://raw.githubusercontent.com/python-discord/branding/b67897df93e572c1576a9026eb78c785a794d226/logos/logo_banner/logo_site_banner.svg" + alt="Python Discord banner" /> + </div> + <div class="content-box"> + <h1>404 — Not Found</h1> + <p>We couldn't find the page you're looking for. Here are a few things to try out:</p> + <ul> + <li>Double check the URL. Are you sure you typed it out correctly? + <li>Come join <a href="https://discord.gg/python">our Discord Server</a>. Maybe we can help you out over + there + </ul> + </div> + </div> +</body> + +</html> diff --git a/pydis_site/templates/500.html b/pydis_site/templates/500.html new file mode 100644 index 00000000..869892ec --- /dev/null +++ b/pydis_site/templates/500.html @@ -0,0 +1,29 @@ +{% load static %} + +<!DOCTYPE html> +<html lang="en"> + +<head> + <title>Python Discord | 500</title> + + <meta charset="UTF-8"> + + <link rel="preconnect" href="https://fonts.gstatic.com"> + <link href="https://fonts.googleapis.com/css2?family=Hind:wght@400;600&display=swap" rel="stylesheet"> + <link rel="stylesheet" href="{% static "css/error_pages.css" %}"> +</head> + +<body> + <div class="error-box"> + <div class="logo-box"> + <img src="https://raw.githubusercontent.com/python-discord/branding/b67897df93e572c1576a9026eb78c785a794d226/logos/logo_banner/logo_site_banner.svg" + alt="Python Discord banner" /> + </div> + <div class="content-box"> + <h1>500 — Internal Server Error</h1> + <p>Something went wrong at our end. Please try again shortly, or if the problem persists, please let us know <a href="https://discord.gg/python">on Discord</a>.</p> + </div> + </div> +</body> + +</html> diff --git a/pydis_site/templates/base/footer.html b/pydis_site/templates/base/footer.html index 90f06f3c..bca43b5d 100644 --- a/pydis_site/templates/base/footer.html +++ b/pydis_site/templates/base/footer.html @@ -1,7 +1,7 @@ <footer class="footer has-background-dark has-text-light"> <div class="content has-text-centered"> <p> - Built with <a href="https://www.djangoproject.com/"><span id="django-logo">django</span></a> and <a href="https://bulma.io"><span id="bulma-logo">Bulma</span></a> <br/> © {% now "Y" %} <span id="pydis-text">Python Discord</span> + Powered by <a href="https://www.linode.com/?r=3bc18ce876ff43ea31f201b91e8e119c9753f085"><span id="linode-logo">Linode</span></a><br>Built with <a href="https://www.djangoproject.com/"><span id="django-logo">django</span></a> and <a href="https://bulma.io"><span id="bulma-logo">Bulma</span></a> <br/> © {% now "Y" %} <span id="pydis-text">Python Discord</span> </p> </div> </footer> |