integrate kontor-angular
This commit is contained in:
@@ -5,7 +5,8 @@ from fastapi import APIRouter, Body, HTTPException, status, Depends, Response
|
||||
from fastapi.security import OAuth2PasswordRequestForm
|
||||
|
||||
from src.core.config import settings
|
||||
from src.core.security import create_access_token, authenticate_user_by_email, get_current_active_user
|
||||
from src.core.log_conf import logger
|
||||
from src.core.security import create_access_token, authenticate_user_by_email, authenticate_user_by_username, get_current_active_user
|
||||
from src.db.models.admin import Profile
|
||||
from src.schema.admin import Token, ProfileModel
|
||||
from src.webapps.auth.forms import LoginForm
|
||||
@@ -16,6 +17,7 @@ router = APIRouter()
|
||||
@router.post("/token")
|
||||
def login_for_access_token(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]) -> Token:
|
||||
user = authenticate_user_by_username(form_data.username, form_data.password)
|
||||
logger.info(f"Request /token: login with {form_data.username}")
|
||||
if not user:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
|
||||
@@ -8,6 +8,7 @@ COPY . /app
|
||||
RUN npm run build
|
||||
|
||||
FROM docker.io/library/nginx:stable-alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
server {
|
||||
listen 8700;
|
||||
# Root-Verzeichnis für den Server setzen (wir kopieren unsere Anwendung hierher)
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# Definieren der Standard-Indexdatei (Angular erstellt die Datei index.html für uns und sie befindet sich im oben genannten Verzeichnis)
|
||||
index index.html;
|
||||
|
||||
# Cache-Header für Medien-ASsets
|
||||
location ~* \.(?:cur|jpe?g|gif|htc|ico|png|xml|otf|ttf|eot|woff|woff2|svg)$ {
|
||||
access_log off;
|
||||
add_header Pragma "must-revalidate, public";
|
||||
add_header Cache-Control "must-revalidate, public";
|
||||
expires max;
|
||||
|
||||
tcp_nodelay off;
|
||||
}
|
||||
|
||||
# Cache-Header für HTML, CSS und JS-Dateien
|
||||
location ~* \.(?:css|js|html)$ {
|
||||
access_log off;
|
||||
add_header Pragma "must-revalidate, public";
|
||||
add_header Cache-Control "must-revalidate, public";
|
||||
expires 2d;
|
||||
|
||||
tcp_nodelay off;
|
||||
}
|
||||
|
||||
# Konfiguration für den /-Pfad
|
||||
location / {
|
||||
# Zunächst versuchen wir die angeforderte URI auzuliefern
|
||||
# Klappt das nicht, versuchen wir es mit einem abschließenden Slash
|
||||
# Klappt auch das nicht, liefern wir die index.html aus.
|
||||
# Das ist nötig, damit Angular-Routen korrekt augeflöst und ausgeliefert werden
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ const API_URL = "http://localhost:8200/";
|
||||
class AuthService {
|
||||
login(user) {
|
||||
return axios
|
||||
.post(API_URL + "login", {
|
||||
email: user.username,
|
||||
.post(API_URL + "api/login/token", {
|
||||
username: user.username,
|
||||
password: user.password,
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.accessToken) {
|
||||
if (response.data.access_token) {
|
||||
localStorage.setItem("user", JSON.stringify(response.data));
|
||||
}
|
||||
return response.data;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ else
|
||||
-p 8400:8400 \
|
||||
-p 8500:8500 \
|
||||
-p 8600:8600 \
|
||||
-p 8700:80 \
|
||||
-p 8700:8700 \
|
||||
-p 8800:8800 \
|
||||
-p 8900:8080 \
|
||||
-p 61616:61616 \
|
||||
|
||||
@@ -9,7 +9,6 @@ cd "$(dirname "$0")/.."
|
||||
echo "==> Stopping and removing pod kontor"
|
||||
if podman pod exists kontor; then
|
||||
podman pod stop kontor
|
||||
podman pod rm kontor
|
||||
fi
|
||||
|
||||
script/cibuild
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-activemq.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-activemq.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-adminer.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-adminer.service
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# container-kontor-angular.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-angular.service
|
||||
Documentation=man:podman-generate-systemd(1)
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
RequiresMountsFor=%t/containers
|
||||
BindsTo=pod-kontor.service
|
||||
After=pod-kontor.service
|
||||
|
||||
[Service]
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=70
|
||||
ExecStart=/usr/bin/podman run \
|
||||
--cidfile=%t/%n.ctr-id \
|
||||
--cgroups=no-conmon \
|
||||
--rm \
|
||||
--pod-id-file %t/pod-kontor.pod-id \
|
||||
--sdnotify=conmon \
|
||||
-d \
|
||||
--replace \
|
||||
--name kontor-angular \
|
||||
--label io.containers.autoupdate=local \
|
||||
--label PODMAN_SYSTEMD_UNIT=container-kontor-angular.service localhost/kontor-angular:0.3.0
|
||||
ExecStop=/usr/bin/podman stop \
|
||||
--ignore -t 10 \
|
||||
--cidfile=%t/%n.ctr-id
|
||||
ExecStopPost=/usr/bin/podman rm \
|
||||
-f \
|
||||
--ignore -t 10 \
|
||||
--cidfile=%t/%n.ctr-id
|
||||
Type=notify
|
||||
NotifyAccess=all
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-kontor-api.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-api.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-kontor-echo.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-echo.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-kontor-fiber.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-fiber.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-kontor-javalin.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-javalin.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-kontor-quarkus.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-quarkus.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-kontor-spring.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-spring.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-kontor-vue.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-kontor-vue.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# container-postgres.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman container-postgres.service
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# pod-kontor.service
|
||||
# autogenerated by Podman 4.9.3
|
||||
# Sun Apr 12 17:24:24 CEST 2026
|
||||
# Sun Apr 19 16:28:14 CEST 2026
|
||||
|
||||
[Unit]
|
||||
Description=Podman pod-kontor.service
|
||||
@@ -8,8 +8,8 @@ Documentation=man:podman-generate-systemd(1)
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
RequiresMountsFor=/run/user/1000/containers
|
||||
Wants=container-activemq.service container-adminer.service container-kontor-api.service container-kontor-echo.service container-kontor-fiber.service container-kontor-javalin.service container-kontor-quarkus.service container-kontor-spring.service container-kontor-vue.service container-postgres.service
|
||||
Before=container-activemq.service container-adminer.service container-kontor-api.service container-kontor-echo.service container-kontor-fiber.service container-kontor-javalin.service container-kontor-quarkus.service container-kontor-spring.service container-kontor-vue.service container-postgres.service
|
||||
Wants=container-activemq.service container-adminer.service container-kontor-angular.service container-kontor-api.service container-kontor-echo.service container-kontor-fiber.service container-kontor-javalin.service container-kontor-quarkus.service container-kontor-spring.service container-kontor-vue.service container-postgres.service
|
||||
Before=container-activemq.service container-adminer.service container-kontor-angular.service container-kontor-api.service container-kontor-echo.service container-kontor-fiber.service container-kontor-javalin.service container-kontor-quarkus.service container-kontor-spring.service container-kontor-vue.service container-postgres.service
|
||||
|
||||
[Service]
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
@@ -28,7 +28,8 @@ ExecStartPre=/usr/bin/podman pod create \
|
||||
-p 8400:8400 \
|
||||
-p 8500:8500 \
|
||||
-p 8600:8600 \
|
||||
-p 8700:80 \
|
||||
-p 8700:8700 \
|
||||
-p 8800:8800 \
|
||||
-p 8900:8080 \
|
||||
-p 61616:61616 \
|
||||
-p 8161:8161 \
|
||||
|
||||
Reference in New Issue
Block a user