Skip to content

Commit

Permalink
chore: rename to cdsctf
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaBosak233 committed Oct 25, 2024
1 parent edaad51 commit 38b187d
Show file tree
Hide file tree
Showing 64 changed files with 419 additions and 629 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4
with:
repository: elabosak233/cloudsdale
repository: elabosak233/cdsctf
ref: ${{ github.ref }}

- name: Set up Docker Buildx
Expand All @@ -40,8 +40,8 @@ jobs:
id: meta
with:
images: |
ghcr.io/${{ github.repository_owner }}/cloudsdale
docker.io/${{ github.repository_owner }}/cloudsdale
ghcr.io/${{ github.repository_owner }}/cdsctf
docker.io/${{ github.repository_owner }}/cdsctf
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
tags: |
Expand Down
15 changes: 7 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "cloudsdale"
name = "cdsctf"
version = "0.0.1"
edition = "2021"
description = "The Cloudsdale project is an open-source, high-performance, Jeopardy-style's CTF platform."
description = "The CdsCTF project is an open-source, high-performance, Jeopardy-style's CTF platform."

[dependencies]
# Async
async-trait = { version = "0.1" }
tokio = { version = "1.39", features = ["full"] }
tokio = { version = "1.41", features = ["full"] }
futures = { version = "^0.3" }
futures-util = { version = "^0.3" }
tower = { version = "0.5" }
Expand Down Expand Up @@ -42,8 +42,8 @@ jsonwebtoken = { version = "9.3.0" }
argon2 = { version = "0.5" }

# Data Handling
uuid = { version = "1.8", features = ["v4", "fast-rng", "macro-diagnostics"] }
regex = { version = "1.10" }
uuid = { version = "1.11", features = ["v4", "fast-rng", "macro-diagnostics"] }
regex = { version = "1.11" }
chrono = { version = "0.4" }
toml = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
Expand Down Expand Up @@ -79,7 +79,7 @@ sea-orm-migration = { version = "1.1" }
async-nats = { version = "0.37" }

# Cache
fred = { version = "9.2", features = [
fred = { version = "9.3", features = [
"enable-rustls",
"dns",
"mocks",
Expand All @@ -90,7 +90,6 @@ fred = { version = "9.2", features = [
] }

# Containerization & Orchestration
bollard = { version = "*" }
kube = { version = "0.96", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.23", features = ["latest"] }

Expand All @@ -107,5 +106,5 @@ reqwest = { version = "0.12", features = [
chrono = { version = "0.4" }

[[bin]]
name = "cloudsdale"
name = "cdsctf"
path = "src/main.rs"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ COPY --from=frontend /app/dist ./dist

EXPOSE 8888

CMD ["./cloudsdale"]
CMD ["./cdsctf"]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Cloudsdale
# CdsCTF

The **Cloudsdale** project is an _open-source, high-performance, Jeopardy-style's_ CTF platform.
The **CdsCTF** project is an _open-source, high-performance, Jeopardy-style's_ CTF platform.

You can read more in the [Documentation](https://docs.ctf.e23.dev).

## Contributors

Thanks to everyone who has contributed to the project! Without you, Cloudsdale would not be what it is today.
Thanks to everyone who has contributed to the project! Without you, CdsCTF would not be what it is today.

![](https://contrib.rocks/image?repo=ElaBosak233/Cloudsdale)
![](https://contrib.rocks/image?repo=ElaBosak233/cdsctf)

## Stars

![](https://starchart.cc/ElaBosak233/Cloudsdale.svg)
![](https://starchart.cc/ElaBosak233/cdsctf.svg)

## License

This project is licensed under the [GNU General Public License v3.0](https://github.com/ElaBosak233/Cloudsdale/blob/main/LICENSE).
This project is licensed under the [GNU General Public License v3.0](./LICENSE).
2 changes: 1 addition & 1 deletion assets/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

Commit: {{git_commit}}
Build At: {{build_at}}
GitHub: https://github.com/elabosak233/cloudsdale
GitHub: https://github.com/elabosak233/cdsctf
File renamed without changes.
3 changes: 1 addition & 2 deletions deploys/docker-compose.yml → deploys/compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
version: "3.0"
services:
core:
image: elabosak233/cloudsdale:main
image: elabosak233/cdsctf:main
restart: always
ports:
- "8888:8888"
volumes:
- "./application.toml:/app/application.toml:ro"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./assets:/app/assets"
- "./captures:/app/captures"
- "./media:/app/media"
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/contribution/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ cd cloudsdale
使用 Docker Compose 运行开发时的依赖服务(数据库、消息队列、缓存)

```bash
docker compose -f deploys/docker-compose.dev.yml up
docker compose -f deploys/compose.dev.yml up
```

### 使用 Cargo 编译/运行后端
Expand Down
22 changes: 8 additions & 14 deletions example/application.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[site]
title = "Cloudsdale"
title = "CdsCTF"
description = "Hack for fun not for profit."
color = "#0C4497"
favicon = "" # The favicon's path, such as "./arts/favicon.webp".
Expand Down Expand Up @@ -39,31 +39,25 @@ site_key = ""
secret_key = ""
threshold = 0.5

[container]
provider = "docker" # The container provider, can be "docker" or "k8s".
[cluster]
entry = "127.0.0.1" # The public entry of containers.

[container.docker]
uri = "unix:///var/run/docker.sock" # DO NOT EDIT if you are using docker-compose.

[container.k8s]
namespace = "cloudsdale" # The namespace of k8s cluster.
namespace = "default" # The namespace of k8s cluster.
path = "./k8s-config.yml" # The k8s config file's path, such as "./k8s-config.yml".

[container.proxy]
[cluster.proxy]
enabled = false # Enable or disable TCP over WebSocket proxy.
traffic_capture = false # Enable or disable traffic capture.

[container.strategy]
[cluster.strategy]
parallel_limit = 1 # The maximum number of parallel containers. (Does not affect the settings in game)
request_limit = 0

[db]
host = "db"
port = 5432
dbname = "cloudsdale"
username = "cloudsdale"
password = "cloudsdale"
dbname = "cdsctf"
username = "cdsctf"
password = "cdsctf"
sslmode = "disable"

[queue]
Expand Down
16 changes: 8 additions & 8 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
merge_derives = true
fn_params_layout = "Compressed"
max_width = 100
tab_spaces = 4
reorder_imports = true

# unstable_features = true
# hex_literal_case = "Upper"
# condense_wildcard_suffixes = true
# imports_granularity = "Crate"
# brace_style = "PreferSameLine"
# group_imports = "StdExternalCrate"
unstable_features = true
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
brace_style = "PreferSameLine"
wrap_comments = true
condense_wildcard_suffixes = true
hex_literal_case = "Upper"
enum_discrim_align_threshold = 20
6 changes: 2 additions & 4 deletions src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ fn get_client() -> &'static RedisClient {

pub async fn get<T>(key: impl Into<RedisKey> + Send + Display) -> Result<Option<T>, CacheError>
where
T: for<'de> Deserialize<'de>,
{
T: for<'de> Deserialize<'de>, {
let result = get_client().get::<Option<Value>, _>(key).await?;
match result {
Some(value) => Ok(Some(serde_json::from_value(value)?)),
Expand All @@ -31,8 +30,7 @@ where

pub async fn getdel<T>(key: impl Into<RedisKey> + Send + Display) -> Result<Option<T>, CacheError>
where
T: for<'de> Deserialize<'de>,
{
T: for<'de> Deserialize<'de>, {
let result = get_client().getdel::<Option<Value>, _>(key).await?;
match result {
Some(value) => return Ok(Some(serde_json::from_value(value)?)),
Expand Down
6 changes: 1 addition & 5 deletions src/captcha/turnstile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ struct TurnstileRequest {
impl Turnstile {
pub fn new() -> Self {
return Turnstile {
url: crate::config::get_config()
.captcha
.turnstile
.url
.clone(),
url: crate::config::get_config().captcha.turnstile.url.clone(),
secret_key: crate::config::get_config()
.captcha
.turnstile
Expand Down
Loading

0 comments on commit 38b187d

Please sign in to comment.