Skip to content

fixed Create proxy and websocket configuration configmap for wrongsecrets-balancer #252 #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v5.0.0
hooks:
- id: check-yaml
exclude: ^(helm/wrongsecrets-ctf-party/templates/|helm/test.tmp.yaml|azure/k8s/)
Expand All @@ -12,7 +12,7 @@ repos:
exclude: ^(src/test/resources/yourkey.txt|src/test/resources/secondkey.txt)
- id: trailing-whitespace
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.71.0
rev: v1.96.2
hooks:
- id: terraform_fmt
- id: terraform_tflint
Expand All @@ -32,7 +32,7 @@ repos:
- "--args=--only=terraform_workspace_remote"
- id: terraform_docs
- repo: https://github.com/norwoodj/helm-docs
rev: v1.2.0
rev: v1.14.2
hooks:
- id: helm-docs
args:
Expand All @@ -46,7 +46,7 @@ repos:
# A base filename makes it relative to each chart directory found
- --template-files=README.md.gotmpl
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
rev: v9.18.0
hooks:
- id: commitlint
stages: [commit-msg]
8 changes: 8 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
modules = ["python-3.12", "nodejs-20", "bash"]
run = "node index.js"

[nix]
channel = "stable-24_05"

[deployment]
run = ["sh", "-c", "node index.js"]
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,32 @@ data:
"affinity": {{ .Values.wrongsecrets.affinity | toJson }},
"tolerations": {{ .Values.wrongsecrets.tolerations | toJson }},
"runtimeClassName": {{ .Values.wrongsecrets.runtimeClassName | toJson }}
},
"websocket": {
"servicename1:8080": [
"incomingurl1",
"incomingurl2",
"incomingurl3"
],
"serviname2:3000": [
"incomingurl4",
"incomingurl5"
]
},
"proxy": {
"servicename1:8080": [
"incomingurl6",
"incomingurl7"
],
"servicename2:3000": [
"incomingurl8withwildcard"
],
"servicename3(CTFD)": [
"incomingurl9",
"incomingurl10"
],
"servicename4(grafana)": [
"incomingurl10"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@ spec:
securityContext:
{{- omit .Values.balancer.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.balancer.volumeMounts }}
volumeMounts:
{{- toYaml .Values.balancer.volumeMounts | nindent 12 }}
{{- end }}
- name: proxy-config
mountPath: /etc/config
resources:
{{- toYaml .Values.balancer.resources | nindent 12 }}
volumes:
- name: proxy-config
configMap:
name: proxy-config
{{- if .Values.balancer.volumes }}
volumes:
{{- toYaml .Values.balancer.volumes | nindent 8 }}
{{- toYaml .Values.balancer.volumes | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand All @@ -83,4 +85,4 @@ spec:
{{- with .Values.balancer.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: proxy-config
data:
# Example, adjust according to your needs
websocket: |
servicename1:8080:
incomingurl1
incomingurl2
incomingurl3
servicename2:3000
incomingurl4
incomingurl5
proxy: |
servicename1:8080:
incomingurl6
incomingurl7
servicename2:3000:
incomingurl8withwildcard
servicename3(CTFD):
incomingurl9
incomingurl10
servicename4(grafana):
incomingurl11
6 changes: 6 additions & 0 deletions replit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{pkgs}: {
deps = [
pkgs.kubernetes-helm
pkgs.k3s_1_28
];
}
18 changes: 18 additions & 0 deletions wrongsecrets-balancer/src/proxy/proxy-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: proxy-config
data:
proxy-config.yaml: |
websocket:
servicename1:8080:
- /guaclite
- /files/socket.io/
servicename2:3000:
- /another-path
proxy:
servicename1:8080:
- /path1
- /path2
servicename2:3000:
- /another-path
Loading
Loading