Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1795e2f41 | ||
|
|
9ee0433c4d | ||
|
|
55d03ddeb3 | ||
|
|
b6268f7d22 | ||
|
|
ef563bad2f | ||
|
|
a6876fcc55 |
No files matched your search
@@ -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
@@ -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/
|
||||||
@@ -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
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
+6
-24
@@ -1,24 +1,6 @@
|
|||||||
ARG NGINX_VERSION
|
ARG NGINX_VERSION
|
||||||
|
FROM nginx:${NGINX_VERSION}
|
||||||
# --- Stage 1: Build the Client (TypeScript -> JS) ---
|
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
|
||||||
FROM node:18-slim AS client-builder
|
RUN mkdir -p /etc/certs /etc/nginx/templates
|
||||||
WORKDIR /usr/opt/pythonapp
|
COPY 10-select-ssl.sh /docker-entrypoint.d/10-select-ssl.sh
|
||||||
|
RUN chmod +x /docker-entrypoint.d/10-select-ssl.sh
|
||||||
# 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}
|
|
||||||
|
|
||||||
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
|
|
||||||
RUN mkdir /etc/certs
|
|
||||||
|
|
||||||
# Statischen HTML-Ordner inklusive des frischen JS aus Stage 1 kopieren
|
|
||||||
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
+38
-38
@@ -1,38 +1,38 @@
|
|||||||
ssl_certificate /etc/certs/${NGINX_CERT};
|
ssl_certificate /etc/certs/${NGINX_CERT};
|
||||||
ssl_certificate_key /etc/certs/${NGINX_CERT_KEY};
|
ssl_certificate_key /etc/certs/${NGINX_CERT_KEY};
|
||||||
|
|
||||||
# Zunächst wird ein Default-Server definiert.
|
# Zunächst wird ein Default-Server definiert.
|
||||||
# Das Standardverhalten von NGINX ist nämlich wie folgt:
|
# 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
|
# 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.
|
# Servername definiert wird, wird einfach der erste definierte Serverblock genommen.
|
||||||
# Dadurch, dass ein expliziter Default-Server definiert wird, wird dieser verwendet.
|
# 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
|
# Falls jetzt also ein Servername übergeben wird, den es nicht gibt, gibt NGINX den Error-Code 404 zurück
|
||||||
server {
|
server {
|
||||||
listen 4430 ssl default_server;
|
listen 4430 ssl default_server;
|
||||||
return 404;
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 4430 ssl;
|
listen 4430 ssl;
|
||||||
server_name ${NGINX_SERVER_NAME};
|
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
|
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/
|
# https://sandro-keil.de/blog/let-nginx-start-if-upstream-host-is-unavailable-or-down/
|
||||||
|
|
||||||
location /static {
|
location /static {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# Variable muss benutzt werden (s.o. bei resolver Direktive)
|
# Variable muss benutzt werden (s.o. bei resolver Direktive)
|
||||||
set $upstream pythonapp:8080;
|
set $upstream pythonapp:8080;
|
||||||
proxy_pass http://$upstream;
|
proxy_pass http://$upstream;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /health-check {
|
location /health-check {
|
||||||
add_header Content-Type text/plain;
|
add_header Content-Type text/plain;
|
||||||
return 200 "success $time_iso8601";
|
return 200 "success $time_iso8601";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+33
-28
@@ -1,28 +1,33 @@
|
|||||||
name: kbpbase
|
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_CERTS}:/etc/certs
|
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/configtemplates:ro
|
||||||
env_file:
|
- ${NGINX_CERTS}:/etc/certs
|
||||||
- .env
|
environment:
|
||||||
pythonapp:
|
- NGINX_USE_SSL=${NGINX_USE_SSL:-true}
|
||||||
build:
|
- NGINX_CERT=${NGINX_CERT}
|
||||||
context: App_Server
|
- NGINX_CERT_KEY=${NGINX_CERT_KEY}
|
||||||
args:
|
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME}
|
||||||
PYTHON_VERSION: ${PYTHON_VERSION}
|
pythonapp:
|
||||||
env_file:
|
build:
|
||||||
- .env
|
context: App_Server
|
||||||
volumes:
|
# target: kommt aus dem prod oder dev dockerfile
|
||||||
- ${PYTHON_DB_DIR}:/usr/var/pythonappdb
|
args: # Übergibt die ARGS an das dockerfile
|
||||||
- python-venv:/usr/opt/pythonapp/env
|
PYTHON_VERSION: ${PYTHON_VERSION}
|
||||||
|
volumes:
|
||||||
volumes:
|
#- ${PYTHON_APP_DIR}:/usr/opt/pythonapp/root
|
||||||
python-venv:
|
- ${PYTHON_DB_DIR}:/usr/var/pythonappdb
|
||||||
|
- python-venv:/usr/opt/pythonapp/env
|
||||||
|
# - ${PYTHON_ENV_DIR}:/usr/opt/pythonapp/env
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
python-venv:
|
||||||
+22
-24
@@ -1,24 +1,22 @@
|
|||||||
name: kbpdev
|
name: kbpdev
|
||||||
services:
|
services:
|
||||||
nginx-proxy:
|
pythonapp:
|
||||||
extends:
|
extends:
|
||||||
file: docker-compose.base.yaml
|
file: docker-compose.base.yaml
|
||||||
service: nginx-proxy
|
service: pythonapp
|
||||||
volumes:
|
build:
|
||||||
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
|
target: dev
|
||||||
|
args: # Übergibt die ARGS an das dockerfile
|
||||||
pythonapp:
|
# PYTHON_VERSION: ${PYTHON_VERSION}
|
||||||
extends:
|
NODE_VERSION: ${NODE_VERSION:-18}
|
||||||
file: docker-compose.base.yaml
|
NPM_VERSION: ${NPM_VERSION:-8}
|
||||||
service: pythonapp
|
environment:
|
||||||
build:
|
# Globales Vibe-Home innerhalb des Workspace-Bind-Mounts, damit es auf dem Host persistiert
|
||||||
target: dev
|
- VIBE_HOME=/usr/opt/pythonapp/.vibe-global
|
||||||
args:
|
volumes:
|
||||||
NODE_VERSION: ${NODE_VERSION:-18}
|
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp
|
||||||
NPM_VERSION: ${NPM_VERSION:-8}
|
# - ${TYPESCRIPT_SRC_DIR}:/usr/opt/typescript
|
||||||
volumes:
|
- node-modules:/usr/opt/typescript/node_modules
|
||||||
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp
|
|
||||||
- node-modules:/usr/opt/typescript/node_modules
|
volumes:
|
||||||
|
node-modules:
|
||||||
volumes:
|
|
||||||
node-modules:
|
|
||||||
@@ -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}
|
||||||
|
|||||||
+2
-1
@@ -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
|
||||||
@@ -55,4 +56,4 @@ ZITADEL_SCOPES=openid,profile,email
|
|||||||
# SMTP_USERNAME=
|
# SMTP_USERNAME=
|
||||||
# SMTP_PASSWORD=
|
# SMTP_PASSWORD=
|
||||||
# SMTP_USE_TLS=true
|
# SMTP_USE_TLS=true
|
||||||
# EMAIL_FROM=formeleon@yourdomain.com
|
# EMAIL_FROM=formeleon@yourdomain.com
|
||||||
Reference in new issue
Block a user