rmk: remove nginx configmaps and hardcoded secrets

- delete configmap-nginx-configmap and its volume/volumeMounts
  in comparisons, django, notes frontends (use image-bundled config)
- clear hardcoded DJANGO_TOKEN and KAFKA_PASSWORD defaults
  in issues/configmap-production-configmap (values come from Vault)
- clear hardcoded Django SECRET_KEY in django/configmap-django-configmap
This commit is contained in:
emelinda 2026-11-17 19:27:47 +03:00
parent e96944aee3
commit 32d408107f
8 changed files with 3 additions and 212 deletions

View File

@ -1,46 +0,0 @@
apiVersion: v1
data:
nginx.conf: |
user nginx;
worker_processes auto;
error_log stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
client_header_buffer_size 16k;
large_client_header_buffers 4 16k;
listen 80;
server_name localhost;
root /dist;
expires off;
location = /ping {
return 200 '{"result": "ok"}';
}
}
}
kind: ConfigMap
metadata:
name: nginx-configmap
namespace: comparisons

View File

@ -85,19 +85,7 @@ spec:
fieldPath: metadata.namespace
- name: OTEL_RESOURCE_ATTRIBUTES
value: k8s.pod.uid=$(K8S_POD_UID),k8s.pod.name=$(K8S_POD_NAME),k8s.namespace.name=$(K8S_NAMESPACE)
volumeMounts:
- name: nginx-configmap
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
resources:
requests:
memory: 100Mi
cpu: 25m
volumes:
- name: nginx-configmap
configMap:
name: nginx-configmap
items:
- key: nginx.conf
path: nginx.conf

View File

@ -25,7 +25,7 @@ data:
/vault/secrets/django-jwt-public\")\n\nALLOWED_HOSTS = [\"*\"]\nFILE_UPLOAD_PERMISSIONS\
\ = 0o644\nDEBUG = False\nCSRF_COOKIE_SECURE = True\nCSRF_TRUSTED_ORIGINS = [\"\
https://sarex.stand.sarex.tech\", \"http://sarex.stand.sarex.tech\"]\nSESSION_COOKIE_SECURE\
\ = True\nSECURE_SSL_REDIRECT = False\n\nSECRET_KEY = 't2=9+($2f%7ptsdy4!rby$)mcfl1l%o2e@vs^d(g&(wwi&%k1v'\n\
\ = True\nSECURE_SSL_REDIRECT = False\n\nSECRET_KEY = ''\n\
\nCORS_ORIGIN_ALLOW_ALL = True\nSERVERSETTINGS.cache_enabled = True\nINSTALLED_APPS\
\ = list(INSTALLED_APPS) + ['corsheaders']\n\nCORS_ALLOW_METHODS = (\n 'DELETE',\n\
\ 'GET',\n 'OPTIONS',\n 'PATCH',\n 'POST',\n 'PUT',\n)\nBASIC_USER_ID\

View File

@ -1,82 +0,0 @@
apiVersion: v1
data:
nginx.conf: "worker_processes auto;\n\npid /var/run/nginx.pid;\n\nevents {\n \
\ use epoll;\n worker_connections 1024;\n}\n\nhttp {\n\n # Basic Settings\n\
\ large_client_header_buffers 8 128k;\n sendfile on;\n tcp_nopush on;\n\
\ tcp_nodelay on;\n keepalive_timeout 300;\n types_hash_max_size 2048;\n\
\ client_max_body_size 5000M;\n client_header_buffer_size 5M;\n # server_tokens\
\ off;\n # server_names_hash_bucket_size 64;\n # server_name_in_redirect\
\ off;\n include /etc/nginx/mime.types;\n default_type application/octet-stream;\n\
\n # Logging Settings\n access_log /var/log/nginx/access.log;\n error_log\
\ /var/log/nginx/error.log;\n\n # GZIP Settings\n gzip on;\n gzip_vary\
\ on;\n gzip_proxied any;\n gzip_comp_level 6;\n gzip_buffers 16 8k;\n\
\ gzip_http_version 1.1;\n gzip_types text/plain text/css application/json\
\ application/javascript text/xml application/xml application/xml+rss text/javascript;\n\
\n log_format main '$remote_addr - $remote_user [$time_local] \"$request\"\
\ '\n '$status $body_bytes_sent \"$http_referer\" '\n \
\ '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n\n server\
\ {\n listen 80;\n listen [::]:80;\n root /opt/react_client/;\n\
\n add_header 'Access-Control-Allow-Origin' '*' always;\n add_header\
\ 'Access-Control-Allow-Methods' '*' always;\n add_header 'Access-Control-Allow-Headers'\
\ '*' always;\n\n location = /static/index.bundle.js {\n add_header\
\ Cache-Control 'no-store no-cache, must-revalidate, proxy-revalidate, max-age=0';\n\
\ if_modified_since off;\n expires off;\n }\n\n \
\ location ~^/api/pm/ {\n #rewrite /api/(.+) /$1 break;\n \
\ proxy_http_version 1.1;\n proxy_set_header Connection \"\"\
;\n proxy_set_header Host $host;\n proxy_pass http://backend-svc.pm.svc.cluster.local:8000;\n\
\ }\n\n location ~^/api/v1/documents/ {\n proxy_http_version\
\ 1.1;\n #rewrite /api/(.+) /$1 break;\n proxy_set_header\
\ Host $host;\n proxy_pass http://backend-filestream-svc.documentations.svc.cluster.local:80;\n\
\ }\n\n location ~^/(api|admin)/ {\n proxy_http_version\
\ 1.1;\n proxy_set_header Connection \"\";\n proxy_set_header\
\ Host $host;\n proxy_pass http://backend-svc.django.svc.cluster.local:80;\n\
\ }\n \n\n location = /static/pdf-runtime/assets/mupdf-wasm.wasm\
\ {\n alias /opt/react_client/static/pdf-runtime/assets/mupdf-wasm.wasm;\n\
\ add_header Content-Type application/wasm always;\n add_header\
\ Cache-Control \"public, max-age=31536000, immutable\" always;\n add_header\
\ Access-Control-Allow-Origin \"*\" always;\n add_header Access-Control-Allow-Methods\
\ \"GET, OPTIONS\" always;\n add_header Access-Control-Allow-Headers\
\ \"DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization\"\
\ always;\n }\n\n location = /workspaces-v2/worker/static/viewer-pdf/mupdf-wasm.js\
\ {\n alias /opt/react_client/static/viewer-pdf/mupdf-wasm.js;\n \
\ add_header Content-Type application/javascript always;\n \
\ add_header Cache-Control \"public, max-age=31536000, immutable\" always;\n\
\ add_header Access-Control-Allow-Origin \"*\" always;\n \
\ add_header Access-Control-Allow-Methods \"GET, OPTIONS\" always;\n \
\ add_header Access-Control-Allow-Headers \"DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization\"\
\ always;\n }\n\n location = /workspaces-v2/worker/mupdf.worker-3.3.9.js\
\ {\n alias /opt/react_client/static/pdf-runtime/mupdf.worker-3.3.9.js;\n\
\ add_header Content-Type application/javascript always;\n \
\ add_header Cache-Control \"public, max-age=31536000, immutable\" always;\n\
\ add_header Access-Control-Allow-Origin \"*\" always;\n \
\ add_header Access-Control-Allow-Methods \"GET, OPTIONS\" always;\n \
\ add_header Access-Control-Allow-Headers \"DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization\"\
\ always;\n }\n\n location = /workspaces-v2/worker/static/viewer-pdf/mupdf.js\
\ {\n alias /opt/react_client/static/viewer-pdf/mupdf.js;\n \
\ add_header Content-Type application/javascript always;\n add_header\
\ Cache-Control \"public, max-age=31536000, immutable\" always;\n add_header\
\ Access-Control-Allow-Origin \"*\" always;\n add_header Access-Control-Allow-Methods\
\ \"GET, OPTIONS\" always;\n add_header Access-Control-Allow-Headers\
\ \"DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization\"\
\ always;\n }\n\n location = /workspaces-v2/worker/static/viewer-pdf/mupdf-wasm.wasm\
\ {\n add_header Content-Type application/wasm always;\n \
\ alias /opt/react_client/static/viewer-pdf/mupdf-wasm.wasm;\n }\n\n \
\ location ~^/workspaces-v2/(.+).js {\n proxy_http_version 1.1;\n\
\ proxy_set_header Connection \"\";\n rewrite /workspaces-v2/(.+)\
\ /$1 break;\n proxy_pass http://frontend-svc.workspaces.svc.cluster.local:80;\n\
\ }\n\n location ~^/workspaces-v2/(.+)\\.wasm$ {\n proxy_http_version\
\ 1.1;\n proxy_set_header Connection \"\";\n rewrite ^/workspaces-v2/(.+)\
\ /$1 break;\n proxy_pass http://frontend-svc.workspaces.svc.cluster.local:80;\n\
\ }\n\n location @index {\n add_header Cache-Control\
\ 'no-cache, must-revalidate, proxy-revalidate, max-age=0';\n if_modified_since\
\ off;\n expires off;\n try_files /static/index.html =404;\n\
\ }\n \n location ~^/workflows/(.+).js {\n proxy_http_version\
\ 1.1;\n proxy_set_header Connection \"\";\n rewrite /workflows/(.+)\
\ /$1 break;\n proxy_pass http://frontend-svc.processing.svc.cluster.local:80;\n\
\ }\n location /service-worker.js {\n try_files /static/$uri\
\ @index;\n }\n\n location / {\n try_files $uri @index;\n\
\ }\n }\n}\n"
kind: ConfigMap
metadata:
name: nginx-configmap
namespace: django

View File

@ -68,10 +68,6 @@ spec:
- name: OTEL_RESOURCE_ATTRIBUTES
value: k8s.pod.uid=$(K8S_POD_UID),k8s.pod.name=$(K8S_POD_NAME),k8s.namespace.name=$(K8S_NAMESPACE)
volumeMounts:
- name: nginx-configmap
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
- name: zitadel-configmap
mountPath: /opt/react_client/static/config.json
subPath: config.json
@ -81,12 +77,6 @@ spec:
memory: 100Mi
cpu: 25m
volumes:
- name: nginx-configmap
configMap:
name: nginx-configmap
items:
- key: nginx.conf
path: nginx.conf
- name: zitadel-configmap
configMap:
name: zitadel-configmap

View File

@ -17,7 +17,7 @@ data:
SECRET_KEY = "FromToMuchLoveOfLiving" # Delete after Test
# -----------------------------------------------------------------------------
DJANGO_TOKEN = os.getenv("DJANGO_TOKEN", "aGFnZW4wMTM6emVhbG90MDk2")
DJANGO_TOKEN = os.getenv("DJANGO_TOKEN", "")
# ALLOWED HOSTS START
# -----------------------------------------------------------------------------
@ -46,7 +46,7 @@ data:
RESOURCES_API_HOST = os.getenv("RESOURCES_API_HOST", default="http://resources-service.resources.svc.cluster:8000")
KAFKA_HOST = os.getenv("KAFKA_HOST", "wb-stage-kafka-bootstrap.kafka.svc.cluster.local:9093")
KAFKA_USERNAME = os.getenv("KAFKA_USERNAME", "sarex")
KAFKA_PASSWORD = os.getenv("KAFKA_PASSWORD", "nK36sasvSfoItJnXQ4qxav2OUWIPX5ZC")
KAFKA_PASSWORD = os.getenv("KAFKA_PASSWORD", "")
KAFKA_SSL_CAFILE = os.getenv("KAFKA_SSL_CAFILE", "/usr/local/share/ca-certificates/kafka.crt")
KAFKA_EAV_ASSETS_TOPIC = os.getenv("KAFKA_EAV_ASSETS_TOPIC", "sarex")
KAFKA_ISSUES_TOPIC = os.getenv("KAFKA_ISSUES_TOPIC", "sarex-issues")

View File

@ -1,46 +0,0 @@
apiVersion: v1
data:
nginx.conf: |
user nginx;
worker_processes auto;
error_log stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
client_header_buffer_size 16k;
large_client_header_buffers 4 16k;
listen 80;
server_name localhost;
root /dist;
expires off;
location = /ping {
return 200 '{"result": "ok"}';
}
}
}
kind: ConfigMap
metadata:
name: nginx-configmap
namespace: notes

View File

@ -67,20 +67,7 @@ spec:
fieldPath: metadata.namespace
- name: OTEL_RESOURCE_ATTRIBUTES
value: k8s.pod.uid=$(K8S_POD_UID),k8s.pod.name=$(K8S_POD_NAME),k8s.namespace.name=$(K8S_NAMESPACE)
volumeMounts:
- name: nginx-configmap
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
resources:
requests:
memory: 100Mi
cpu: 25m
volumes:
- name: nginx-configmap
configMap:
name: nginx-configmap
items:
- key: nginx.conf
path: nginx.conf
defaultMode: 420