-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86e955b
commit b5a0310
Showing
21 changed files
with
134 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
# Cloudsdale | ||
|
||
The **Cloudsdale** project is an *open-source, light-weight, Jeopardy-style's* CTF platform. | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/elabosak233/cloudsdale)](https://goreportcard.com/report/github.com/elabosak233/cloudsdale) | ||
|
||
The **Cloudsdale** project is an _open-source, light-weight, Jeopardy-style's_ CTF platform. | ||
|
||
You can read more in the [Documentation](https://docs.ctf.e23.dev). | ||
|
||
## Special Thanks | ||
|
||
Thanks to everyone who has contributed to the project! Without you, Cloudsdale would not be what it is today. | ||
|
||
![](https://contrib.rocks/image?repo=ElaBosak233/Cloudsdale) | ||
|
||
The current version of Cloudsdale, while ensuring the originality of the code, largely draws inspiration from [GZ::CTF](https://github.com/GZTimeWalker/GZCTF) in its frontend design. Therefore, I express my highest respect to [GZTimeWalker](https://github.com/GZTimeWalker), the author of GZ::CTF. At the same time, I also thank GZTime for his suggestions on Cloudsdale. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Security Policy |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 题目 | ||
|
||
## 创建第一道题目 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 缓存 | ||
|
||
Cloudsdale 有两种缓存实现方式,一种是基于 `go-cache`,另一种是基于 `go-redis`,如果你有分布式需求,请使用 `go-redis` 保证缓存的正确性。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 数据库 | ||
|
||
Cloudsdale 目前支持三种数据库,PostgreSQL,MySQL 和 SQLite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# 配置文件 | ||
# 配置 | ||
|
||
对于 Cloudsdale 而言,配置文件通常指的是 `application.json` | ||
对于 Cloudsdale 而言,配置通常指的是 `application.json` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 代理与流量捕获 | ||
|
||
Cloudsdale 的代理功能主要是为了流量捕获功能服务的。 | ||
|
||
当然,如果你不希望选手直接通过 IP 地址进入容器,你可以使用平台代理。你只需要保证 Cloudsdale 能够访问容器即可。 | ||
|
||
Clousdale 通过 **TCP over Websocket** 进行代理,简单来说,TCP over Websocket 就是通过一个 Websocket 链接(在 Cloudsdale 中是 `/api/proxies/[UUID]`)作为桥梁,连接靶机。 | ||
|
||
那又产生了一个问题,我是不是需要以 `ws://` 这样的形式来访问题目呢?这时候你就需要连接器。 | ||
|
||
所谓无感交互,就是让连接器在本地开启一个 TCP 端口,做题的时候你只需要向连接器提供 `ws://` 链接,然后访问被分配到的 TCP 端口即可,做题的体验没什么太大的区别。 | ||
|
||
Cloudsdale 推荐使用 [WebsocketReflectorX(简称 WSRX)](https://github.com/XDSEC/WebsocketReflectorX) 作为你的连接器。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Docker + K8s 联合部署 | ||
# Docker + K8s 部署 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,75 @@ | ||
# 纯 Docker 部署 | ||
# Docker 部署 | ||
|
||
!!! info "提示" | ||
如果你在举办一场小型的比赛,纯 Docker 部署可以大大节约你在平台配置上的时间 | ||
本篇将教会你如何快速地部署一个 Cloudsdale 实例。这个实例具有以下特点: | ||
|
||
- 使用 PostgreSQL 作为数据库 | ||
- 使用 Docker 单机实例,承担平台和动态容器后端 | ||
|
||
部署她的方式非常简单,你只需要准备一个 `docker-compose.yml` 即可,当然,你可以直接从仓库中的 [deploys](https://github.com/ElaBosak233/Cloudsdale/blob/main/deploy) 目录中找到你所需要的,一个简单的 `docker-compose.yml` 应该长这样: | ||
|
||
```yaml | ||
version: "3.0" | ||
services: | ||
core: | ||
image: elabosak233/cloudsdale:main | ||
restart: always | ||
ports: | ||
- "8888:8888" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" # 映射 Docker 守护进程,使得 Cloudsdale 可以控制宿主机 Docker | ||
- "./configs:/app/configs" # 映射配置文件夹,里面存放 application.json | ||
- "./media:/app/media" # 映射媒体资源文件夹,里面存放题目附件、用户头像等 | ||
- "./logs:/app/logs" # 映射日志文件夹 | ||
depends_on: | ||
- db # 依赖于 db | ||
|
||
db: | ||
image: postgres:alpine | ||
restart: always | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
POSTGRES_USER: cloudsdale | ||
POSTGRES_PASSWORD: cloudsdale | ||
POSTGRES_DB: cloudsdale | ||
volumes: | ||
- "./db:/var/lib/postgresql/data" | ||
``` | ||
你需要在你的服务器上建一个新的空文件夹,然后将 `docker-compose.yml` 放入其中,然后运行: | ||
|
||
``` | ||
docker compose up | ||
``` | ||
第一次运行大概率是失败的,因为 Cloudsdale 默认生成的配置中,依赖的数据库不是 PostgreSQL,我们需要在初始化后进入 `/configs/application.json` 进行些许修改 | ||
```json | ||
"db": { | ||
"provider": "postgres", // 修改这里 | ||
"postgres": { | ||
"dbname": "cloudsdale", | ||
"host": "db", | ||
"username": "cloudsdale", | ||
"password": "cloudsdale", | ||
"port": 5432, | ||
"sslmode": "disable" | ||
}, | ||
"mysql": { | ||
"dbname": "cloudsdale", | ||
"host": "db", | ||
"username": "cloudsdale", | ||
"password": "cloudsdale", | ||
"port": 3306 | ||
}, | ||
"sqlite": { | ||
"path": "./db/db.sqlite" | ||
} | ||
}, | ||
``` | ||
|
||
修改完成后,再运行一遍 `docker compose up`,如果你看到下面这样的输出,那么恭喜你,Cloudsdale 启动的很成功,此后,你可以使用 `docker compose up -d` 将 Cloudsdale 以后台的形式启动 | ||
|
||
![](./img/1.png) | ||
|
||
然后,你就可以通过 `http://localhost:8888` 进入 Cloudsdale,端口你可以通过编辑 `docker-compose.yml` 中的 `ports` 进行更改 |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# 纯 K8s 部署 | ||
# K8s 部署 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# FAQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 比赛 | ||
|
||
在介绍比赛功能前,需要先捋清一个关系,即用户、团队和比赛之间的关系。 | ||
|
||
用户是比赛的间接参与者,用户可以创建团队,并邀请其他用户加入团队; | ||
|
||
团队是比赛的直接参与者,团队可以参与比赛,且参与比赛必须以团队为单位。 | ||
|
||
也就是说,不论是团队赛还是个人赛,用户都需要创建或者加入一个团队来参赛。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.