letzter stand

This commit is contained in:
Bast 2026-10-31 19:20:50 -05:00
parent a250fa2d62
commit a4e31beb21
8 changed files with 197 additions and 14 deletions

View file

@ -22,7 +22,8 @@ boday-it.ch {
# 5. Sicherheits-Header setzen (Optional, aber dringend empfohlen) # 5. Sicherheits-Header setzen (Optional, aber dringend empfohlen)
header { header {
# Verhindert, dass die Seite in einem fremden Frame geladen wird (Schutz vor Clickjacking) # Verhindert, dass die Seite in einem fremden Frame geladen wird (Schutz vor Clickjacking)
X-Frame-Options "DENY" #X-Frame-Options "DENY"
X-Frame-Options "SAMEORIGIN"
# Aktiviert den Cross-Site-Scripting-Schutz im Browser # Aktiviert den Cross-Site-Scripting-Schutz im Browser
X-XSS-Protection "1; mode=block" X-XSS-Protection "1; mode=block"
# Verhindert das automatische Erraten des Inhaltstyps (MIME-Sniffing) # Verhindert das automatische Erraten des Inhaltstyps (MIME-Sniffing)
@ -31,3 +32,8 @@ boday-it.ch {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
} }
} }
# 2. Die www-Subdomain (Automatische Zertifizierung + Weiterleitung)
www.boday-it.ch {
redir https://boday-it.ch{uri} permanent
}

View file

@ -1,29 +1,25 @@
# 1. Verwende das offizielle Python 3.8.18 Image auf minimaler Debian-Basis # 1. Das normale, vollständige Python-Image nutzen
FROM python:3.8.18-slim FROM python:3.8.18
# 2. Setze Umgebungsvariablen für Python # 2. Setze Umgebungsvariablen für Python
# Verhindert, dass Python .pyc-Dateien schreibt
ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONDONTWRITEBYTECODE=1
# Verhindert, dass Python Ausgaben puffert (wichtig für Echtzeit-Docker-Logs)
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
# 3. Setze das Arbeitsverzeichnis im Container # 3. Setze das Arbeitsverzeichnis im Container
WORKDIR /code WORKDIR /code
# 4. Installiere System-Abhängigkeiten # 4. Installiere System-Abhängigkeiten
# gcc und libpq-dev werden für PostgreSQL (psycopg2) und einige Python-Pakete benötigt # 'gcc' wird hier nicht mehr benötigt, da es im Image schon enthalten ist
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \ libpq-dev \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# 5. Installiere die Python-Abhängigkeiten # 5. Installiere die Python-Abhängigkeiten
# Zuerst requirements.txt kopieren, um den Docker-Cache optimal zu nutzen
COPY requirements.txt /code/ COPY requirements.txt /code/
RUN pip install --upgrade pip && pip install -r requirements.txt RUN pip install --upgrade pip && pip install -r requirements.txt
# 6. Kopiere den restlichen Django-Quellcode in den Container # 6. Kopiere den restlichen Django-Quellcode in den Container
COPY . /code/ COPY . /code/
# 7. Erstelle die Ordner für statische Medien (wichtig für die Caddy-Anbindung) # 7. Erstelle die Ordner für statische Medien
RUN mkdir -p /code/staticfiles /code/mediafiles RUN mkdir -p /code/staticfiles /code/mediafiles

39
Dockerfile.old Normal file
View file

@ -0,0 +1,39 @@
# 1. Verwende das offizielle Python 3.8.18 Image auf minimaler Debian-Basis
FROM python:3.8.18-slim
# 2. Setze Umgebungsvariablen für Python
# Verhindert, dass Python .pyc-Dateien schreibt
ENV PYTHONDONTWRITEBYTECODE=1
# Verhindert, dass Python Ausgaben puffert (wichtig für Echtzeit-Docker-Logs)
ENV PYTHONUNBUFFERED=1
# 3. Setze das Arbeitsverzeichnis im Container
WORKDIR /code
# 4. Installiere System-Abhängigkeiten
RUN sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list && \
sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list && \
sed -i '/stretch-updates/d' /etc/apt/sources.list && \
apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# 4. Installiere System-Abhängigkeiten
# gcc und libpq-dev werden für PostgreSQL (psycopg2) und einige Python-Pakete benötigt
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# 5. Installiere die Python-Abhängigkeiten
# Zuerst requirements.txt kopieren, um den Docker-Cache optimal zu nutzen
COPY requirements.txt /code/
RUN pip install --upgrade pip && pip install -r requirements.txt
# 6. Kopiere den restlichen Django-Quellcode in den Container
COPY . /code/
# 7. Erstelle die Ordner für statische Medien (wichtig für die Caddy-Anbindung)
RUN mkdir -p /code/staticfiles /code/mediafiles

View file

@ -60,12 +60,12 @@ USE_TZ = True
STATIC_URL = '/static/' STATIC_URL = '/static/'
MEDIA_URL = '/media/' MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(DATA_DIR, 'media') MEDIA_ROOT = os.path.join(DATA_DIR, 'mediafiles')
#STATIC_ROOT = os.path.join(DATA_DIR, 'static') STATIC_ROOT = os.path.join(DATA_DIR, 'staticfiles')
STATIC_ROOT = "/var/www/boday_it/static" #STATIC_ROOT = "/static"
STATICFILES_DIRS = ( STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'boday_it', 'static'), os.path.join(BASE_DIR, 'boday_it/static'),
) )
SITE_ID = 1 SITE_ID = 1
@ -214,3 +214,9 @@ THUMBNAIL_PROCESSORS = (
'filer.thumbnail_processors.scale_and_crop_with_subject_location', 'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters' 'easy_thumbnails.processors.filters'
) )
# 1. Sagt Django, dass die Verbindung über Caddy (HTTPS) sicher ist
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# 2. Erlaubt Django CMS das Laden von internen Bearbeitungs-Iframes
X_FRAME_OPTIONS = 'SAMEORIGIN'

View file

@ -1,3 +1,11 @@
body {
font-family: Roboto, "Helvetica Neue", Helvetica, sans-serif;
font-size: 18px;
line-height: 1.6;
color: #666;
font-weight: 500; /* Macht die Linien dicker */
}
body#page-top { body#page-top {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -125,4 +133,4 @@ footer.footer li.back-top--hidden {
span.caret.caret_up { span.caret.caret_up {
transform: rotate(180deg); transform: rotate(180deg);
} }

128
custom_overwrites.css Normal file
View file

@ -0,0 +1,128 @@
body#page-top {
display: flex;
flex-direction: column;
min-height: 100vh;
}
body>div.container {
flex: 1;
}
a {
color: rgb(28, 146, 204);
}
.navbar-main .nav>.active>a>span, .navbar-main .nav>li:hover>a>span {
border-color: rgb(28, 146, 204);
}
.feature-visual img, .feature-visual-narrow img {
left: auto;
right: 0;
}
.navbar-head-narrow .navbar-brand, .navbar-head-narrow .navbar-brand a {
background-size: 168px 64px;
}
.nav>ul a,
.nav>ul a:active,
.nav>ul a:hover {
cursor: pointer;
}
a:focus,
a:-moz-focusring {
outline: 0 none;
cursor: pointer;
}
div.leadText {
font-size: 20px;
}
div.blue-box {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
div.blue-box-child {
background: rgb(28, 146, 204);
color: #fff;
margin: 12px;
width: 100%;
padding: 2%;
}
@media (min-width:768px) {
div.blue-box-child {
margin: 12px 0;
width: calc(50% - 12px);
}
}
div.blue-box-child p,
div.blue-box-child ul {
line-height: 1.2;
margin: 0;
}
div.blue-box-child ul {
list-style: none;
padding-left: 12px;
}
div.footer-copyright {
height: 100%;
}
div.footer-copyright li.pull-right a {
color: #fff;
}
div.page--contact a {
color: inherit;
}
div.page--contact a:focus,
div.page--contact a:hover {
color: rgb(28, 146, 204);
cursor: pointer !important;
text-decoration: none;
}
div.page--contact {
display: flex;
justify-content: space-between;
position: relative;
margin: 12px 0 24px 0;
}
div.page--contact div.contact-child {
margin: 0;
}
div.page--contact div.contact-child:nth-of-type(2) {
text-align: right;
}
@media (max-width:767px) {
div.page--contact {
margin: 12px 12px 24px 12px;
}
}
@media (max-width:439px) {
div.page--contact div.contact-child {
font-size: 10px;
}
}
footer.footer li.back-top--hidden {
visibility: hidden;
}
span.caret.caret_up {
transform: rotate(180deg);
}

Binary file not shown.

BIN
project.db2 Normal file

Binary file not shown.