Compare commits

..
6 Commits
Author SHA1 Message Date
gg b1795e2f41 Merge origin/main: revert 96c9cea und c1c92d1, behalte bdb4329 (OIDC/Email-Settings)
- 96c9cea (deploy-Prozess-Aenderungen) vollstaendig revertiert:
  lokale Versionen von .gitignore, NGINX_Server/Dockerfile,
  docker-compose.base.yaml, docker-compose.dev.yaml beibehalten,
  App_Server/Dockerfile auf Stand vor 96c9cea zurueckgesetzt.
- c1c92d1 (env-raus) revertiert: lokale env-sample als Basis,
  .env aus Tracking entfernt (bereits in .gitignore).
- bdb4329 behalten: OIDC/Email-Block an lokale env-sample angehaengt.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-12 15:30:09 +02:00
gg 9ee0433c4d feat(auth): Logout-Meldung 1 Sekunde anzeigen vor Weiterleitung
Dedizierte loggedout-Komponente für die Abmeldebestätigung und
Redirect um 1 Sekunde verzögert, damit die Meldung sichtbar bleibt.
Default-Route auf /kundenliste korrigiert.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-11 16:53:54 +02:00
gg 55d03ddeb3 chore: env-sample als Konfigurationsvorlage hinzufügen und .env ignorieren
.env-Dateien mit echten credentials ab sofort über .gitignore ausgeschlossen;
env-sample als kopierbare Vorlage für NGINX-, Python- und Dev-Parameter eingecheckt.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-11 16:40:06 +02:00
gg b6268f7d22 chore(dev): Vibe-Code-Setup in Devcontainer, docker-compose und .gitignore integrieren
- .devcontainer: mistralai.mistral-vibe-code Extension hinzugefügt
- docker-compose.dev: VIBE_HOME auf /usr/opt/pythonapp/.vibe-global gesetzt
- .gitignore: .vibe/ und .vibe-global/ ignoriert, Pfad-Slashes normalisiert

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-11 16:33:08 +02:00
gg ef563bad2f NGINX: Dynamische SSL-Konfiguration über Umgebungsvariable
- Aufteilung des NGINX-Templates in kbp_crm.nossl.conf.template (ohne SSL)
  und kbp_crm.ssl.conf.template (mit SSL)
- Neues Skript 10-select-ssl.sh wählt Template zur Laufzeit basierend auf
  NGINX_USE_SSL (true/false)
- Dockerfile: Vorbereitung für dynamische Template-Auswahl
- docker-compose: Template-Verzeichnis auf /etc/nginx/configtemplates geändert,
  NGINX_USE_SSL als Umgebungsvariable hinzugefügt
- .env: NGINX_USE_SSL=true standardmäßig aktiviert

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-11 14:52:08 +02:00
gg a6876fcc55 oidc-test Verzeichnis zu .gitignore hinzugefuegt
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-11 13:48:08 +02:00
12 changed files with 105 additions and 50 deletions

No files matched your search

+2 -1
View File
@@ -17,7 +17,8 @@
"ms-python.python", "ms-python.python",
"ms-python.vscode-pylance", "ms-python.vscode-pylance",
"dbaeumer.vscode-eslint", "dbaeumer.vscode-eslint",
"esbenp.prettier-vscode" "esbenp.prettier-vscode",
"mistralai.mistral-vibe-code"
], ],
"settings": { "settings": {
"python.defaultInterpreterPath": "/usr/opt/pythonapp/env/bin/python", "python.defaultInterpreterPath": "/usr/opt/pythonapp/env/bin/python",
+7 -5
View File
@@ -1,8 +1,10 @@
__pycache__ __pycache__
env .env
node_modules env/
tsout node_modules/
tsout/
kbp_crm*.js kbp_crm*.js
App_Server/data/ App_Server/data/
.env oidc-test/
kbcrm .vibe/
.vibe-global/
+2 -2
View File
@@ -52,8 +52,8 @@ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \
# --- 9. TypeScript + Rollup installieren --- # --- 9. TypeScript + Rollup installieren ---
# Das Script inittypescriptdev.sh wird in der Entwicklungsumgebung ausgeführt, um die TypeScript-Umgebung zu initialisieren. # Das Script inittypescriptdev.sh wird in der Entwicklungsumgebung ausgeführt, um die TypeScript-Umgebung zu initialisieren.
# Daher ist es nicht notwendig, es hier zu kopieren und auszuführen. # Daher ist es nicht notwendig, es hier zu kopieren und auszuführen.
#COPY ./scripts/inittypescriptdev.sh /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh # COPY ./scripts/inittypescriptdev.sh /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh
#RUN chmod +x /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh # RUN chmod +x /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh
ENTRYPOINT ["sh", "/usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh"] ENTRYPOINT ["sh", "/usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh"]
CMD ["/usr/opt/pythonapp/env/bin/python", "root/runserver.py", "-D"] CMD ["/usr/opt/pythonapp/env/bin/python", "root/runserver.py", "-D"]
+16 -3
View File
@@ -69,7 +69,7 @@ function logout() {
if (result['logout'] == true) {m.route.set("/blankpage")} if (result['logout'] == true) {m.route.set("/blankpage")}
}) })
.finally(() => { .finally(() => {
location.href = "/index.html" setTimeout(() => { location.href = "/index.html" }, 1000)
}) })
} }
@@ -86,6 +86,19 @@ const hello: m.Component = {
} }
} }
const loggedout: m.Component = {
view: () => {
return m("h1", {
style: {
display: "flex",
justifyContent: "center",
alignItems: "center",
height: "100%"
}
}, "Sie sind nicht mehr angemeldet!")
}
}
const hello2: m.Component = { const hello2: m.Component = {
view: (vnode) => { view: (vnode) => {
return m("ul", return m("ul",
@@ -174,8 +187,8 @@ if (check_currentuser() == false) {
m.route.set("/login") m.route.set("/login")
} }
m.route(gridMountpoints.main, "/blankpage", { m.route(gridMountpoints.main, "/kundenliste", {
"/blankpage": hello, "/blankpage": loggedout,
"/usermanagement": appmanagementpage, "/usermanagement": appmanagementpage,
"/changepassword": changepasswordscreen, "/changepassword": changepasswordscreen,
"/login": loginscreen, "/login": loginscreen,
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# Wählt das NGINX-Template abhängig von NGINX_USE_SSL aus.
# Kopiert das passende Template aus dem Staging-Mount (read-only) in das
# container-interne Verzeichnis, das vom envsubst-Skript verarbeitet wird.
# Läuft als 10-… vor dem eingebauten 20-envsubst-on-templates.sh.
src_dir="/etc/nginx/configtemplates"
dst_dir="/etc/nginx/templates"
# Falls noch ein Template aus einem vorherigen Start im dst_dir liegt, entfernen.
rm -f "$dst_dir"/kbp_crm.*.conf.template
if [ "$NGINX_USE_SSL" = "false" ]; then
cp "$src_dir/kbp_crm.nossl.conf.template" "$dst_dir/"
else
cp "$src_dir/kbp_crm.ssl.conf.template" "$dst_dir/"
fi
+3 -21
View File
@@ -1,24 +1,6 @@
ARG NGINX_VERSION ARG NGINX_VERSION
# --- Stage 1: Build the Client (TypeScript -> JS) ---
FROM node:18-slim AS client-builder
WORKDIR /usr/opt/pythonapp
# Wir brauchen die Projekt-Dateien
COPY Client/ ./Client/
COPY App_Server/ ./App_Server/
COPY NGINX_Server/ ./NGINX_Server/
# Abhängigkeiten installieren und bauen
WORKDIR /usr/opt/pythonapp/Client
RUN npm install
RUN npx tsc && npx rollup -c
# --- Stage 2: NGINX Server (Final Image) ---
FROM nginx:${NGINX_VERSION} FROM nginx:${NGINX_VERSION}
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN mkdir /etc/certs RUN mkdir -p /etc/certs /etc/nginx/templates
COPY 10-select-ssl.sh /docker-entrypoint.d/10-select-ssl.sh
# Statischen HTML-Ordner inklusive des frischen JS aus Stage 1 kopieren RUN chmod +x /docker-entrypoint.d/10-select-ssl.sh
COPY --from=client-builder /usr/opt/pythonapp/NGINX_Server/html /usr/share/nginx/html
@@ -0,0 +1,35 @@
# Zunächst wird ein Default-Server definiert.
# Das Standardverhalten von NGINX ist nämlich wie folgt:
# Wenn im Request ein Server-Name reinkommt und NGINX keinen Server-Block findet, in dem dieser
# Servername definiert wird, wird einfach der erste definierte Serverblock genommen.
# Dadurch, dass ein expliziter Default-Server definiert wird, wird dieser verwendet.
# Falls jetzt also ein Servername übergeben wird, den es nicht gibt, gibt NGINX den Error-Code 404 zurück
server {
listen 4430 default_server;
return 404;
}
server {
listen 4430;
server_name ${NGINX_SERVER_NAME};
resolver 127.0.0.11 valid=30s; # notwendig, damit der Upstream (s.u.) nicht direkt den nginx-Server stoppt, falls pythonapp noch nicht soweit ist
# https://sandro-keil.de/blog/let-nginx-start-if-upstream-host-is-unavailable-or-down/
location /static {
root /usr/share/nginx/html;
}
location / {
# Variable muss benutzt werden (s.o. bei resolver Direktive)
set $upstream pythonapp:8080;
proxy_pass http://$upstream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /health-check {
add_header Content-Type text/plain;
return 200 "success $time_iso8601";
}
}
+14 -9
View File
@@ -2,27 +2,32 @@ name: kbpbase
services: services:
nginx-proxy: nginx-proxy:
build: build:
context: . # Build context im root, damit Client/ und NGINX_Server/ verfügbar sind context: NGINX_Server
dockerfile: NGINX_Server/Dockerfile args: # Übergibt die ARGS an das dockerfile
args:
NGINX_VERSION: ${NGINX_VERSION} NGINX_VERSION: ${NGINX_VERSION}
ports: ports:
- ${NGINX_HOST_PORT}:4430 - ${NGINX_HOST_PORT}:4430
volumes: volumes:
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/templates - ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/configtemplates:ro
- ${NGINX_CERTS}:/etc/certs - ${NGINX_CERTS}:/etc/certs
env_file: environment:
- .env - NGINX_USE_SSL=${NGINX_USE_SSL:-true}
- NGINX_CERT=${NGINX_CERT}
- NGINX_CERT_KEY=${NGINX_CERT_KEY}
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME}
pythonapp: pythonapp:
build: build:
context: App_Server context: App_Server
args: # target: kommt aus dem prod oder dev dockerfile
args: # Übergibt die ARGS an das dockerfile
PYTHON_VERSION: ${PYTHON_VERSION} PYTHON_VERSION: ${PYTHON_VERSION}
env_file:
- .env
volumes: volumes:
#- ${PYTHON_APP_DIR}:/usr/opt/pythonapp/root
- ${PYTHON_DB_DIR}:/usr/var/pythonappdb - ${PYTHON_DB_DIR}:/usr/var/pythonappdb
- python-venv:/usr/opt/pythonapp/env - python-venv:/usr/opt/pythonapp/env
# - ${PYTHON_ENV_DIR}:/usr/opt/pythonapp/env
volumes: volumes:
python-venv: python-venv:
+6 -8
View File
@@ -1,23 +1,21 @@
name: kbpdev name: kbpdev
services: services:
nginx-proxy:
extends:
file: docker-compose.base.yaml
service: nginx-proxy
volumes:
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
pythonapp: pythonapp:
extends: extends:
file: docker-compose.base.yaml file: docker-compose.base.yaml
service: pythonapp service: pythonapp
build: build:
target: dev target: dev
args: args: # Übergibt die ARGS an das dockerfile
# PYTHON_VERSION: ${PYTHON_VERSION}
NODE_VERSION: ${NODE_VERSION:-18} NODE_VERSION: ${NODE_VERSION:-18}
NPM_VERSION: ${NPM_VERSION:-8} NPM_VERSION: ${NPM_VERSION:-8}
environment:
# Globales Vibe-Home innerhalb des Workspace-Bind-Mounts, damit es auf dem Host persistiert
- VIBE_HOME=/usr/opt/pythonapp/.vibe-global
volumes: volumes:
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp - ${PYTHON_DEV_DIR}:/usr/opt/pythonapp
# - ${TYPESCRIPT_SRC_DIR}:/usr/opt/typescript
- node-modules:/usr/opt/typescript/node_modules - node-modules:/usr/opt/typescript/node_modules
volumes: volumes:
+2 -1
View File
@@ -9,9 +9,10 @@ services:
- ${NGINX_HOST_PORT}:4430 - ${NGINX_HOST_PORT}:4430
volumes: volumes:
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro - ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/templates - ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/configtemplates:ro
- ${NGINX_CERTS}:/etc/certs - ${NGINX_CERTS}:/etc/certs
environment: environment:
- NGINX_USE_SSL=${NGINX_USE_SSL:-true}
- NGINX_CERT=${NGINX_CERT} - NGINX_CERT=${NGINX_CERT}
- NGINX_CERT_KEY=${NGINX_CERT_KEY} - NGINX_CERT_KEY=${NGINX_CERT_KEY}
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME} - NGINX_SERVER_NAME=${NGINX_SERVER_NAME}
+1
View File
@@ -1,5 +1,6 @@
# Parameter für NGINX-Server # Parameter für NGINX-Server
NGINX_VERSION=mainline-alpine NGINX_VERSION=mainline-alpine
NGINX_USE_SSL=true # true = SSL aktivieren, false = SSL deaktivieren, Port sollte auch angepasst werden
NGINX_HOST_PORT=443 NGINX_HOST_PORT=443
NGINX_SERVER_NAME=kbp_crm.mylocal.de NGINX_SERVER_NAME=kbp_crm.mylocal.de
NGINX_STATIC_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/NGINX_Server/html NGINX_STATIC_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/NGINX_Server/html