Skip to content

Commit

Permalink
feat(config): custom k8s config
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Jul 23, 2023
1 parent 248f074 commit 31e177b
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 196 deletions.
21 changes: 20 additions & 1 deletion docs/pages/config/appsettings.zh.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ import { Callout } from "nextra-theme-docs";
SwarmMode: false,
Uri: "unix:///var/run/docker.sock",
},
K8sConfig: {
// optional
Namespace: "gzctf-challenges",
ConfigPath: "k8sconfig.yaml",
AllowCIDR: [
// allow the cluster CIDR for LB
"10.0.0.0/8",
],
DNS: [
// custom DNS to avoid cluster DNS
"8.8.8.8",
"223.5.5.5",
],
},
},
RequestLogging: false,
DisableRateLimit: false,
Expand Down Expand Up @@ -121,7 +135,12 @@ GZCTF 仅支持 PostgreSQL 作为数据库,不支持 MySQL 等其他数据库

#### Kubernetes

请将集群连接配置放入 `k8sconfig.yaml` 文件中,并将其挂载到 `/app` 目录下
- **Namespace:** Kubernetes 命名空间,用于创建题目实例的命名空间,默认为 `gzctf-challenges`
- **ConfigPath:** Kubernetes 配置文件路径,用于连接集群,默认为 `k8sconfig.yaml`
- **AllowCIDR:** [实验功能] 允许访问 Pod 的 CIDR 白名单
- **DNS:** [实验功能] 避免使用集群 DNS 的自定义 DNS 服务器列表

默认行为请将集群连接配置放入 `k8sconfig.yaml` 文件中,并将其挂载到 `/app` 目录下。实验功能若非了解行为请勿更改。

<Callout type="info">

Expand Down
8 changes: 4 additions & 4 deletions src/GZCTF/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"prismjs": "^1.29.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-pdf": "^7.1.3",
"react-pdf": "^7.2.0",
"react-router": "^6.14.2",
"react-router-dom": "^6.14.2",
"swr": "^2.2.0",
Expand All @@ -46,10 +46,10 @@
"devDependencies": {
"@babel/eslint-parser": "^7.22.9",
"@nabla/vite-plugin-eslint": "^1.5.0",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/katex": "^0.16.1",
"@types/marked": "^5.0.1",
"@types/node": "20.4.2",
"@types/node": "20.4.4",
"@types/prismjs": "^1.26.0",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
Expand All @@ -67,7 +67,7 @@
"swagger-typescript-api": "^13.0.0",
"tslib": "^2.6.0",
"typescript": "5.1.6",
"vite": "^4.4.4",
"vite": "^4.4.6",
"vite-plugin-pages": "^0.31.0",
"vite-plugin-prismjs": "^0.0.8",
"vite-plugin-webfont-dl": "^3.7.6"
Expand Down
Loading

0 comments on commit 31e177b

Please sign in to comment.