Skip to content
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

ZEA-3734: Validate Template in Zeabur CLI #101

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/zeabur/cli

go 1.20
go 1.21

toolchain go1.22.5

require (
github.com/AlecAivazis/survey/v2 v2.3.7
Expand All @@ -14,6 +16,7 @@ require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
Expand Down Expand Up @@ -62,7 +65,7 @@ require (
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.9.3 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
Expand Down
16 changes: 14 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
Expand All @@ -75,6 +77,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
Expand Down Expand Up @@ -194,6 +197,7 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
Expand All @@ -206,9 +210,11 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
Expand All @@ -230,8 +236,10 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
Expand All @@ -252,9 +260,12 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw=
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
Expand Down Expand Up @@ -357,6 +368,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -477,8 +489,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/template/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"gopkg.in/yaml.v3"

"github.com/zeabur/cli/internal/cmdutil"
"github.com/zeabur/cli/pkg/util"
)

type Options struct {
Expand Down Expand Up @@ -70,6 +71,10 @@ func runCreate(f *cmdutil.Factory, opts Options) error {
}
}

if err := util.ValidateTemplate(file); err != nil {
return fmt.Errorf("validate template: %w", err)
}

type RawTemplate struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Expand Down
7 changes: 6 additions & 1 deletion internal/cmd/template/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/spf13/cobra"
"github.com/zeabur/cli/internal/cmdutil"
"github.com/zeabur/cli/pkg/model"
"github.com/zeabur/cli/pkg/util"
"gopkg.in/yaml.v3"
)

Expand All @@ -28,7 +29,7 @@ func NewCmdDeploy(f *cmdutil.Factory) *cobra.Command {

cmd := &cobra.Command{
Use: "deploy",
Short: "Deploy a template",
Short: "Validate and deploy a template",
RunE: func(cmd *cobra.Command, args []string) error {
return runDeploy(f, opts)
},
Expand Down Expand Up @@ -76,6 +77,10 @@ func runDeploy(f *cmdutil.Factory, opts *Options) error {
}
}

if err := util.ValidateTemplate(file); err != nil {
return fmt.Errorf("validate template: %w", err)
}

if _, err := f.ParamFiller.ProjectCreatePreferred(&opts.projectID); err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/template/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"gopkg.in/yaml.v3"

"github.com/zeabur/cli/internal/cmdutil"
"github.com/zeabur/cli/pkg/util"
)

type Options struct {
Expand Down Expand Up @@ -76,6 +77,10 @@ func runUpdate(f *cmdutil.Factory, opts Options) error {
}
}

if err := util.ValidateTemplate(file); err != nil {
return fmt.Errorf("validate template: %w", err)
}

type RawTemplate struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Expand Down
86 changes: 86 additions & 0 deletions pkg/util/testdata/01-valid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: zeabur.com/v1
kind: Template
metadata:
name: Kafka
spec:
description: An open-source distributed event streaming platform
icon: https://cdn.zeabur.com/kafka.png
tags:
- Database
- Event
- Data
readme: |
# Apache Kafka

[Apache Kafka](https://kafka.apache.org) is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.

Note that for _external_ connections to the broker, i.e., those from outside the Zeabur private networking, you may need to adjust the configuration. This could be from your local machine or a more complicated setup. If the latter is true, you will need to change the value `localhost` in `KAFKA_ADVERTISED_LISTENERS` to the forwarded hostname and port, which you can find in the "Networking" tab. For _internal_ connections between services within the project, please use `kafka.zeabur.internal:29092`.
services:
- name: zookeeper
template: PREBUILT
spec:
source:
image: confluentinc/cp-zookeeper:latest
ports:
- id: service
port: 2181
type: TCP
env:
ZOOKEEPER_CLIENT_PORT:
default: "2181"
ZOOKEEPER_TICK_TIME:
default: "2000"
- name: kafka
template: PREBUILT
icon: https://cdn.zeabur.com/kafka.png
spec:
source:
image: confluentinc/cp-kafka:latest
ports:
- id: broker
port: 9092
type: TCP
- id: internal
port: 29092
type: TCP
volumes:
- id: data
dir: /var/lib/kafka/data
env:
KAFKA_BROKER_ID:
default: "1"
KAFKA_ZOOKEEPER_CONNECT:
default: "zookeeper.zeabur.internal:2181"
KAFKA_ADVERTISED_LISTENERS:
default: "PLAINTEXT://kafka.zeabur.internal:29092,PLAINTEXT_HOST://localhost:9092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP:
default: "PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME:
default: "PLAINTEXT"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR:
default: "1"
localization:
zh-TW:
description: 開源的分散式事件串流平台
readme: |
# Apache Kafka

[Apache Kafka](https://kafka.apache.org) 是一個開源的分散式事件串流平台,數以千計的公司使用它來建構高效能資料管道、串流分析、資料整合以及用在關鍵任務上的應用程式。

注意:如果是從 **外部** 連接到 broker,比如從 Zeabur 網路以外(如本機或更複雜的多叢集設定)存取,你需要將 `KAFKA_ADVERTISED_LISTENERS` 中的 `localhost` 值更改為轉送的主機名稱和連線埠,可以在「Networking」標籤中看到。如果是專案中服務之間的內部連線,請使用 `kafka.zeabur.internal:29092`。
ja-JP:
description: オープンソースの分散イベントストリーミングプラットフォーム
readme: |
# Apache Kafka

[Apache Kafka](https://kafka.apache.org) はオープンソースの分散イベントストリーミングプラットフォームで、数千社の企業が高性能データパイプライン、ストリーミング分析、データ統合、およびミッションクリティカルなアプリケーションのために使用しています。

注意:**外部** から broker への接続、例えば Zeabur ネットワーク外(ローカルホストや、より複雑なマルチクラスター設定など)からアクセスする場合、`KAFKA_ADVERTISED_LISTENERS` の `localhost` 値を転送先のホスト名とポートに変更する必要があります。「Networking」タブで確認できます。プロジェクト内のサービス間の内部接続の場合も、`kafka.zeabur.internal:29092` を使用してください。
zh-CN:
description: 开源的分布式事件流平台
readme: |
# Apache Kafka

[Apache Kafka](https://kafka.apache.org) 是一个开源的分布式事件流平台,数以千计的公司使用它来构建高性能数据管道、流分析、数据集成以及关键任务应用程序。

注意:如果是从 **外部** 连接到 broker,比如从 Zeabur 网络以外(如本地或更复杂的多集群设置)访问,你需要将 `KAFKA_ADVERTISED_LISTENERS` 中的 `localhost` 值更改为转发的主机名和端口,可以在“Networking”标签中看到。如果是项目中服务之间的内部连接,请使用 `kafka.zeabur.internal:29092`。
35 changes: 35 additions & 0 deletions pkg/util/testdata/02-invalid-chinese.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: zeabur.com/v1
kind: Template
metadata:
name: 實體 CTF
spec:
description: 大地遊戲實體 Flag 回報網站。平常 Code 太久,該出去摸草了。
icon: https://raw.githubusercontent.com/SCAICT/physical-CTF/main/public/logo.png
coverImage: https://raw.githubusercontent.com/SCAICT/physical-CTF/main/demo/home.png
variables:
- key: ADMIN_PASSWORD
type: STRING
name: 管理員密碼
description: 管理員後臺密碼
tags:
- Website
- Starter
readme: |-
# 實體 CTF

大地遊戲實體 Flag 回報網站。平常 Code 太久,該出去摸草了。

歡迎使用 Physical CTF 回報網站。這個網頁應用程式讓用戶可以提交和蒐集旗子 (flags),並且在後台管理旗子。

這個遊戲通常的玩法是印出數個帶有 QRCode 的旗子(通常使用 A4 紙列印並黏貼在竹筷上),然後關主或是兩隊互相將旗子藏在指定範圍內的角落。於時間內搜集最多旗子的隊伍獲勝。

完整說明:<https://github.com/SCAICT/physical-CTF>
services:
- name: 網站
template: GIT
spec:
source:
source: GITHUB
repo: 823136585
branch: main
domainKey: ""
35 changes: 35 additions & 0 deletions pkg/util/testdata/03-invalid-yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: zeabur.com/v1
kind: Template
metadata:
name: 實體 CTF
spec:
description: 大地遊戲實體 Flag 回報網站。平常 Code 太久,該出去摸草了。
icon: https://raw.githubusercontent.com/SCAICT/physical-CTF/main/public/logo.png
coverImage: https://raw.githubusercontent.com/SCAICT/physical-CTF/main/demo/home.png
variables:
- key: ADMIN_PASSWORD
type: STRING
name: 管理員密碼
description: 管理員後臺密碼
tags:
- Website
- Starter
readme: |-
# 實體 CTF

大地遊戲實體 Flag 回報網站。平常 Code 太久,該出去摸草了。

歡迎使用 Physical CTF 回報網站。這個網頁應用程式讓用戶可以提交和蒐集旗子 (flags),並且在後台管理旗子。

這個遊戲通常的玩法是印出數個帶有 QRCode 的旗子(通常使用 A4 紙列印並黏貼在竹筷上),然後關主或是兩隊互相將旗子藏在指定範圍內的角落。於時間內搜集最多旗子的隊伍獲勝。

完整說明:<https://github.com/SCAICT/physical-CTF>
services:
- name 網站
template: GIT
spec:
source:
source: GITHUB
repo: 823136585
branch: main
domainKey: ""
34 changes: 34 additions & 0 deletions pkg/util/testdata/04-invalid-missing-field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: zeabur.com/v1
kind: Template
metadata:
spec:
description: 大地遊戲實體 Flag 回報網站。平常 Code 太久,該出去摸草了。
icon: https://raw.githubusercontent.com/SCAICT/physical-CTF/main/public/logo.png
coverImage: https://raw.githubusercontent.com/SCAICT/physical-CTF/main/demo/home.png
variables:
- key: ADMIN_PASSWORD
type: STRING
name: 管理員密碼
description: 管理員後臺密碼
tags:
- Website
- Starter
readme: |-
# 實體 CTF

大地遊戲實體 Flag 回報網站。平常 Code 太久,該出去摸草了。

歡迎使用 Physical CTF 回報網站。這個網頁應用程式讓用戶可以提交和蒐集旗子 (flags),並且在後台管理旗子。

這個遊戲通常的玩法是印出數個帶有 QRCode 的旗子(通常使用 A4 紙列印並黏貼在竹筷上),然後關主或是兩隊互相將旗子藏在指定範圍內的角落。於時間內搜集最多旗子的隊伍獲勝。

完整說明:<https://github.com/SCAICT/physical-CTF>
services:
- name: website
template: GIT
spec:
source:
source: GITHUB
repo: 823136585
branch: main
domainKey: ""
Loading
Loading