Migrate configuration from environment variables to YAML file
- Add YAML-based configuration loaded from config.yaml (CONFIG_LOCATION env var) - Add PyYAML dependency and install requirements in Dockerfile - Replace Config.from_env() with get_config() singleton pattern - Remove server_header from config (now randomized from wordlists only) - Update docker-compose.yaml to mount config.yaml read-only - Update Helm chart: restructure values.yaml, generate config.yaml in ConfigMap - Update Kubernetes manifests: ConfigMap now contains config.yaml, deployments mount it - Remove Helm secret.yaml (dashboard path now auto-generated in config.yaml)
This commit is contained in:
@@ -38,18 +38,16 @@ spec:
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.config.port }}
|
||||
containerPort: {{ .Values.config.server.port }}
|
||||
protocol: TCP
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "krawl.fullname" . }}-config
|
||||
env:
|
||||
- name: DASHBOARD_SECRET_PATH
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "krawl.fullname" . }}
|
||||
key: dashboard-path
|
||||
- name: CONFIG_LOCATION
|
||||
value: "config.yaml"
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /app/config.yaml
|
||||
subPath: config.yaml
|
||||
readOnly: true
|
||||
- name: wordlists
|
||||
mountPath: /app/wordlists.json
|
||||
subPath: wordlists.json
|
||||
@@ -63,6 +61,9 @@ spec:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "krawl.fullname" . }}-config
|
||||
- name: wordlists
|
||||
configMap:
|
||||
name: {{ include "krawl.fullname" . }}-wordlists
|
||||
|
||||
Reference in New Issue
Block a user