diff --git a/CHANGELOG.md b/CHANGELOG.md index 259b4f8..f599964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -300,7 +300,7 @@ permanent and empty. This is the first tag carrying binaries. The first release under the cork name. -cork is a fork of [cmgr](https://github.com/picoCTF/cmgr), the challenge manager +cork is a fork of [cmgr](https://github.com/CyLabAcademy/cmgr), the challenge manager from the US Army Cyber Institute, rebuilt around one thing cmgr could not do: run a CTF across many hosts. cmgr holds a single connection to a single docker API, which caps a deployment at one box. cork places challenges across a fleet of @@ -373,7 +373,7 @@ identity, which is deployed and would have to be reissued. orchestrator on an external build plane ignores `CORK_ARTIFACT_DIR` and says so at startup. **This is the one breaking change for an existing deployment.** - **The challenge development commands.** No `test`, `playtest` or `check`, and - no solver framework behind them. Use [cmgr](https://github.com/picoCTF/cmgr) + no solver framework behind them. Use [cmgr](https://github.com/CyLabAcademy/cmgr) or PCM to write and debug challenges; cork reads what they produce. - **Telemetry**, now its own repository: [cork-telemetry](https://github.com/CyLabAcademy/cork-telemetry). @@ -386,7 +386,7 @@ and the same tarball is published under the pre-rename scheduled for removal in **1.2.0**. `CORK_ARTIFACT_DIR` is the one setting another program reads by its old name: -[cmgr-artifact-server](https://github.com/picoCTF/cmgr-artifact-server) looks up +[cmgr-artifact-server](https://github.com/CyLabAcademy/cmgr-artifact-server) looks up `CMGR_ARTIFACT_DIR`. Setting only that name keeps both working today; once the fallback goes, a build plane needs both. @@ -420,11 +420,11 @@ fallback goes, a build plane needs both. 4. A single-host deployment needs no build plane: leave `CORK_BUILD_PLANE` unset and `corkd` builds on its own docker daemon, as cmgr did. -[1.3.0]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.3.0 -[1.2.1]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.2.1 -[1.2.0]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.2.0 -[1.1.2]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.1.2 -[1.1.1]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.1.1 -[1.1.0]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.1.0 -[1.0.1]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.0.1 -[1.0.0]: https://github.com/CyLabAcademy/challenge-orchestrator/releases/tag/v1.0.0 +[1.3.0]: https://github.com/CyLabAcademy/cork/releases/tag/v1.3.0 +[1.2.1]: https://github.com/CyLabAcademy/cork/releases/tag/v1.2.1 +[1.2.0]: https://github.com/CyLabAcademy/cork/releases/tag/v1.2.0 +[1.1.2]: https://github.com/CyLabAcademy/cork/releases/tag/v1.1.2 +[1.1.1]: https://github.com/CyLabAcademy/cork/releases/tag/v1.1.1 +[1.1.0]: https://github.com/CyLabAcademy/cork/releases/tag/v1.1.0 +[1.0.1]: https://github.com/CyLabAcademy/cork/releases/tag/v1.0.1 +[1.0.0]: https://github.com/CyLabAcademy/cork/releases/tag/v1.0.0 diff --git a/README.md b/README.md index cc5e41f..60991e4 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Cork accomplishes these following goals Cmgr produced two binaries: cmgr, which is the challenge development tool, and cmgrd, the challenge hosting daemon. Both relied on the cmgr go module, shared between both. Unfortunately, this is not a flexible or extensible framework, as changes to the daemon will impact the challenge development tool. Thus, the decision was made to separate the two functions. -Challenge development capabilities remain with [cmgr](https://github.com/picoCTF/cmgr) as well as PCM. Cork is compatible with any challenge files and builds compatible with cmgr. +Challenge development capabilities remain with [cmgr](https://github.com/CyLabAcademy/cmgr) as well as PCM. Cork is compatible with any challenge files and builds compatible with cmgr. ### The shape of a deployment @@ -87,7 +87,7 @@ The orchestrator builds with BuildKit, pins its base images by digest, and publi ## Setup -There is no quickstart. This product is meant for deployment in production, not testing. If you're a challenge developer, please follow the readme in [cmgr](https://github.com/picoCTF/cmgr) instead. +There is no quickstart. This product is meant for deployment in production, not testing. If you're a challenge developer, please follow the readme in [cmgr](https://github.com/CyLabAcademy/cmgr) instead. **One box works, and is not what this is for.** Leave `CORK_BUILD_PLANE` unset and `corkd` builds on its own docker daemon and runs what it builds — @@ -106,7 +106,7 @@ dropped cmgr's development commands along with the `cmgr` binary: there is no `test`, `playtest` or `check`, and no solver framework behind them. It wants a docker daemon it can push from, and the multi-host shape wants two CAs and five certificates before anything starts. If you are writing or -debugging a challenge, use [cmgr](https://github.com/picoCTF/cmgr) or PCM — +debugging a challenge, use [cmgr](https://github.com/CyLabAcademy/cmgr) or PCM — cork is compatible with what they produce, and reads the same challenge files. To see the whole fleet run on one machine, `e2e/` holds a docker compose simulation of it (orchestrator, build daemon, registry, two workers with telemetry, real PKI) plus a scenario that drives the launch sequence through corkd and checks every box; see [e2e/README.md](e2e/README.md). @@ -474,7 +474,7 @@ it; on an external build plane they are refused for that reason. Every setting also answers to its pre-rename `CMGR_` name (`CMGR_DB` for `CORK_DB`, and so on), read when the `CORK_` name is unset, and `cork` reads `CMGRD_SERVER` when `CORK_SERVER` is unset. corkd lists the `CMGR_` names it finds at startup. The old names go away two minor releases after the rename, together with the binary aliases. `CORK_DESTINATIONS` arrived with the build plane under that name and has no older spelling. -`CORK_ARTIFACT_DIR` is the one setting another program reads by its old name: [cmgr-artifact-server](https://github.com/picoCTF/cmgr-artifact-server), which publishes the bundles a build plane writes, looks up `CMGR_ARTIFACT_DIR`. Setting only that name keeps both working today; once the fallback is dropped the build plane needs both. +`CORK_ARTIFACT_DIR` is the one setting another program reads by its old name: [cmgr-artifact-server](https://github.com/CyLabAcademy/cmgr-artifact-server), which publishes the bundles a build plane writes, looks up `CMGR_ARTIFACT_DIR`. Setting only that name keeps both working today; once the fallback is dropped the build plane needs both. | Variable | Meaning | Default | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | @@ -547,7 +547,7 @@ from the other role's is the usual way it happens. This repo is a fork of [ArmyCyberInstitute/cmgr](https://github.com/ArmyCyberInstitute/cmgr) with customizations to support our continued usage of cmgr at [picoCTF](https://picoctf.org/). -For specific details regarding changes from the upstream project, see the [release notes](https://github.com/picoCTF/cmgr/releases). +For specific details regarding changes from the upstream project, see the [release notes](https://github.com/CyLabAcademy/cmgr/releases). ## Introduction @@ -569,8 +569,8 @@ identify permissions and other errors and is highly recommended for the first time you use `cmgr` on a system. ```sh -wget https://github.com/picoCTF/cmgr/releases/latest/download/examples.tar.gz -wget https://github.com/picoCTF/cmgr/releases/latest/download/cmgr_`uname -s | tr '[:upper:]' '[:lower:]'`_amd64.tar.gz +wget https://github.com/CyLabAcademy/cmgr/releases/latest/download/examples.tar.gz +wget https://github.com/CyLabAcademy/cmgr/releases/latest/download/cmgr_`uname -s | tr '[:upper:]' '[:lower:]'`_amd64.tar.gz tar xzvf examples.tar.gz cd examples tar xzvf ../cmgr_`uname -s | tr '[:upper:]' '[:lower:]'`_amd64.tar.gz @@ -771,7 +771,7 @@ _cgo_ enabled for at least the initial build where the _sqlite3_ driver is built and installed. To get started, you can run: ```sh -git clone https://github.com/CyLabAcademy/challenge-orchestrator +git clone https://github.com/CyLabAcademy/cork cd challenge-orchestrator go get -v -t -d ./... mkdir bin diff --git a/ci/version.sh b/ci/version.sh index 4d454c5..90d95a6 100755 --- a/ci/version.sh +++ b/ci/version.sh @@ -48,7 +48,7 @@ version=$(git describe --tags --always --dirty 2>/dev/null || echo unknown) case "${1:-}" in --ldflags) [ $# -eq 1 ] || { echo "usage: version.sh [--ldflags]" >&2; exit 2; } - printf -- '-X github.com/CyLabAcademy/challenge-orchestrator/cork.version=%s -X main.version=%s' "$version" "$version" + printf -- '-X github.com/CyLabAcademy/cork/cork.version=%s -X main.version=%s' "$version" "$version" ;; '') printf '%s\n' "$version" diff --git a/cmd/cork-build/build.go b/cmd/cork-build/build.go index 5d711eb..5c929b7 100644 --- a/cmd/cork-build/build.go +++ b/cmd/cork-build/build.go @@ -8,7 +8,7 @@ import ( "slices" "strings" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" "go.yaml.in/yaml/v3" ) diff --git a/cmd/cork-build/build_test.go b/cmd/cork-build/build_test.go index 91a1106..42d71e2 100644 --- a/cmd/cork-build/build_test.go +++ b/cmd/cork-build/build_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) func writeFile(t *testing.T, name, content string) string { diff --git a/cmd/cork-build/challenge_commands.go b/cmd/cork-build/challenge_commands.go index 5b0fd36..7e12d2a 100644 --- a/cmd/cork-build/challenge_commands.go +++ b/cmd/cork-build/challenge_commands.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // The challenge-directory commands: what cmgr's own CLI did with a tree, on diff --git a/cmd/cork-build/handover.go b/cmd/cork-build/handover.go index 2dfc862..dbec41d 100644 --- a/cmd/cork-build/handover.go +++ b/cmd/cork-build/handover.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // serverProbeTimeout bounds the one question asked of an orchestrator before diff --git a/cmd/cork-build/handover_test.go b/cmd/cork-build/handover_test.go index 5949194..7c7919e 100644 --- a/cmd/cork-build/handover_test.go +++ b/cmd/cork-build/handover_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // handOverPayload is a challenge as this plane hands one over: two builds, diff --git a/cmd/cork-build/main.go b/cmd/cork-build/main.go index 35ba241..c9cdccd 100644 --- a/cmd/cork-build/main.go +++ b/cmd/cork-build/main.go @@ -30,7 +30,7 @@ import ( "os" "strings" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) const ( diff --git a/cmd/cork-build/routing.go b/cmd/cork-build/routing.go index 450007d..bfe7c37 100644 --- a/cmd/cork-build/routing.go +++ b/cmd/cork-build/routing.go @@ -5,7 +5,7 @@ import ( "slices" "sort" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // A route is one orchestrator and the schemas it serves. Schemas are grouped diff --git a/cmd/cork-build/routing_test.go b/cmd/cork-build/routing_test.go index c8eb0c7..9c79254 100644 --- a/cmd/cork-build/routing_test.go +++ b/cmd/cork-build/routing_test.go @@ -6,7 +6,7 @@ import ( "sync/atomic" "testing" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) func routedSchema(name, destination, format string, challenges map[cork.ChallengeId][]int) *cork.Schema { diff --git a/cmd/cork-build/schema_commands.go b/cmd/cork-build/schema_commands.go index 003e98d..c3c2c13 100644 --- a/cmd/cork-build/schema_commands.go +++ b/cmd/cork-build/schema_commands.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // removeSchemaCommand takes a schema out of service for good: the diff --git a/cmd/cork-build/schema_commands_test.go b/cmd/cork-build/schema_commands_test.go index e3bf48c..c8bab6f 100644 --- a/cmd/cork-build/schema_commands_test.go +++ b/cmd/cork-build/schema_commands_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // takenRequest is what an orchestrator saw. diff --git a/cmd/corkd/errors_test.go b/cmd/corkd/errors_test.go index 4056d23..bc5eec7 100644 --- a/cmd/corkd/errors_test.go +++ b/cmd/corkd/errors_test.go @@ -6,7 +6,7 @@ import ( "net/http" "testing" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // The response code is a contract the platform reads: a 503 tells a caller to diff --git a/cmd/corkd/main.go b/cmd/corkd/main.go index a7bd93e..556ced7 100644 --- a/cmd/corkd/main.go +++ b/cmd/corkd/main.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) type state struct { diff --git a/cmd/corkd/pins_api.go b/cmd/corkd/pins_api.go index e458d89..c5239aa 100644 --- a/cmd/corkd/pins_api.go +++ b/cmd/corkd/pins_api.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net/http" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // pinsHandler serves the base image pins (see cork/basepins.go). GET reports diff --git a/cmd/corkd/preloads_api.go b/cmd/corkd/preloads_api.go index 97998fe..78fdbf7 100644 --- a/cmd/corkd/preloads_api.go +++ b/cmd/corkd/preloads_api.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) type PreloadAddRequest struct { diff --git a/cmd/corkd/preloads_api_test.go b/cmd/corkd/preloads_api_test.go index cac3593..4739949 100644 --- a/cmd/corkd/preloads_api_test.go +++ b/cmd/corkd/preloads_api_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) // cork preload-add and preload-remove tell an operator's typo (404) from a diff --git a/cmd/corkd/workers_api.go b/cmd/corkd/workers_api.go index bcbb913..1172c2b 100644 --- a/cmd/corkd/workers_api.go +++ b/cmd/corkd/workers_api.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "github.com/CyLabAcademy/challenge-orchestrator/cork" + "github.com/CyLabAcademy/cork/cork" ) type WorkerAddRequest struct { diff --git a/cork/api.go b/cork/api.go index 48ec78f..902fc1e 100644 --- a/cork/api.go +++ b/cork/api.go @@ -7,7 +7,7 @@ import ( "math/rand" "time" - "github.com/CyLabAcademy/challenge-orchestrator/cork/dockerfiles" + "github.com/CyLabAcademy/cork/cork/dockerfiles" ) const manualSchemaPrefix = "manual-" diff --git a/cork/delivery_type_test.go b/cork/delivery_type_test.go index 6c6bf6d..6effbb7 100644 --- a/cork/delivery_type_test.go +++ b/cork/delivery_type_test.go @@ -3,7 +3,7 @@ package cork import ( "testing" - "github.com/CyLabAcademy/challenge-orchestrator/cork/dockerfiles" + "github.com/CyLabAcademy/cork/cork/dockerfiles" ) // TestDeriveDeliveryType covers the single source of truth for delivery-type diff --git a/e2e/cork.Dockerfile b/e2e/cork.Dockerfile index 0897ff8..c3d9a4c 100644 --- a/e2e/cork.Dockerfile +++ b/e2e/cork.Dockerfile @@ -11,10 +11,10 @@ RUN --mount=type=cache,target=/go/pkg/mod go mod download COPY . . ARG CORK_VERSION=e2e RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - CGO_ENABLED=1 go build -v \ - -ldflags "-X github.com/CyLabAcademy/challenge-orchestrator/cork.version=${CORK_VERSION} -X main.version=${CORK_VERSION}" \ - -o /out/ ./cmd/... + --mount=type=cache,target=/root/.cache/go-build \ + CGO_ENABLED=1 go build -v \ + -ldflags "-X github.com/CyLabAcademy/cork/cork.version=${CORK_VERSION} -X main.version=${CORK_VERSION}" \ + -o /out/ ./cmd/... FROM alpine:3.22 # bash/curl/jq/nc are for the e2e scenario, which runs from this same image. diff --git a/e2e/single.Dockerfile b/e2e/single.Dockerfile index c13d471..26c21c8 100644 --- a/e2e/single.Dockerfile +++ b/e2e/single.Dockerfile @@ -28,10 +28,10 @@ RUN --mount=type=cache,target=/go/pkg/mod go mod download COPY . . ARG CORK_VERSION=e2e RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - CGO_ENABLED=1 go build -v \ - -ldflags "-X github.com/CyLabAcademy/challenge-orchestrator/cork.version=${CORK_VERSION} -X main.version=${CORK_VERSION}" \ - -o /out/ ./cmd/corkd ./cmd/cork + --mount=type=cache,target=/root/.cache/go-build \ + CGO_ENABLED=1 go build -v \ + -ldflags "-X github.com/CyLabAcademy/cork/cork.version=${CORK_VERSION} -X main.version=${CORK_VERSION}" \ + -o /out/ ./cmd/corkd ./cmd/cork FROM docker:${DIND_VERSION}-dind # bash/curl/jq/nc for the scenario, python3 to run a challenge's own solve diff --git a/go.mod b/go.mod index 1c81371..d6eaa5f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/CyLabAcademy/challenge-orchestrator +module github.com/CyLabAcademy/cork go 1.26.0