chore: use variable for static.ietf.org references (#5692)

This commit is contained in:
Nicolas Giard 2023-05-25 18:23:18 -04:00 committed by GitHub
parent 5f4dfb87b6
commit 0a11892414
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 7 deletions

View file

@ -66,7 +66,7 @@
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 5432, 5433],
"forwardPorts": [3000, 5432, 5433, 8000, 8001],
"portsAttributes": {
"3000": {
@ -84,6 +84,10 @@
"8000": {
"label": "Datatracker",
"onAutoForward": "notify"
},
"8001": {
"label": "Static",
"onAutoForward": "silent"
}
},

View file

@ -59,6 +59,12 @@ services:
volumes:
- ./docker/configs/pgadmin-servers.json:/pgadmin4/servers.json
static:
image: ghcr.io/ietf-tools/static:latest
restart: unless-stopped
ports:
- 8001:80
mq:
image: rabbitmq:3-alpine
restart: unless-stopped

View file

@ -55,3 +55,5 @@ NOMCOM_PUBLIC_KEYS_DIR = 'data/nomcom_keys/public_keys/'
SLIDE_STAGING_PATH = 'test/staging/'
DE_GFM_BINARY = '/usr/local/bin/de-gfm'
STATIC_IETF_ORG = "http://localhost:8001"

View file

@ -627,7 +627,7 @@ class DocumentInfo(models.Model):
stylesheets.append(finders.find("ietf/css/document_html_txt.css"))
else:
text = self.htmlized()
stylesheets.append("https://static.ietf.org/fonts/noto-sans-mono/import.css")
stylesheets.append(f'{settings.STATIC_IETF_ORG}/fonts/noto-sans-mono/import.css')
cache = caches["pdfized"]
cache_key = name.split(".")[0]

View file

@ -137,7 +137,6 @@ IETF_NOTES_URL = 'https://notes.ietf.org/' # HedgeDoc base URL
# Absolute path to the directory static files should be collected to.
# Example: "/var/www/example.com/static/"
SERVE_CDN_PHOTOS = True
SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE = True
@ -157,6 +156,8 @@ STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
STATIC_IETF_ORG = "https://static.ietf.org"
WSGI_APPLICATION = "ietf.wsgi.application"
AUTHENTICATION_BACKENDS = ( 'ietf.ietfauth.backends.CaseInsensitiveModelBackend', )

View file

@ -15,8 +15,8 @@
{% block title %}No title{% endblock %}
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://static.ietf.org/fonts/inter/import.css" rel="stylesheet">
<link href="https://static.ietf.org/fonts/noto-sans-mono/import.css" rel="stylesheet">
<link href="{{ settings.STATIC_IETF_ORG }}/fonts/inter/import.css" rel="stylesheet">
<link href="{{ settings.STATIC_IETF_ORG }}/fonts/noto-sans-mono/import.css" rel="stylesheet">
<link rel="stylesheet" href="{% static 'ietf/css/ietf.css' %}">
<link rel="stylesheet" href="{% static 'ietf/css/select2.css' %}">
<style>

View file

@ -18,8 +18,8 @@
{% endif %}
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://static.ietf.org/fonts/inter/import.css" rel="stylesheet">
<link href="https://static.ietf.org/fonts/noto-sans-mono/import.css" rel="stylesheet">
<link href="{{ settings.STATIC_IETF_ORG }}/fonts/inter/import.css" rel="stylesheet">
<link href="{{ settings.STATIC_IETF_ORG }}/fonts/noto-sans-mono/import.css" rel="stylesheet">
{% if request.COOKIES.pagedeps == 'inline' %}
<script>{{ js|safe }}</script>
<style>{{ css|safe }}</style>