Skip to content
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
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).
Expand All @@ -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.

Expand Down Expand Up @@ -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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 —
Expand All @@ -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).
Expand Down Expand Up @@ -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 |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"slices"
"strings"

"github.com/CyLabAcademy/challenge-orchestrator/cork"
"github.com/CyLabAcademy/cork/cork"
"go.yaml.in/yaml/v3"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/challenge_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/handover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/handover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"os"
"strings"

"github.com/CyLabAcademy/challenge-orchestrator/cork"
"github.com/CyLabAcademy/cork/cork"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/schema_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/cork-build/schema_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"testing"

"github.com/CyLabAcademy/challenge-orchestrator/cork"
"github.com/CyLabAcademy/cork/cork"
)

// takenRequest is what an orchestrator saw.
Expand Down
2 changes: 1 addition & 1 deletion cmd/corkd/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/corkd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strconv"
"strings"

"github.com/CyLabAcademy/challenge-orchestrator/cork"
"github.com/CyLabAcademy/cork/cork"
)

type state struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/corkd/pins_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/corkd/preloads_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"strings"

"github.com/CyLabAcademy/challenge-orchestrator/cork"
"github.com/CyLabAcademy/cork/cork"
)

type PreloadAddRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/corkd/preloads_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/corkd/workers_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"strings"

"github.com/CyLabAcademy/challenge-orchestrator/cork"
"github.com/CyLabAcademy/cork/cork"
)

type WorkerAddRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion cork/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"math/rand"
"time"

"github.com/CyLabAcademy/challenge-orchestrator/cork/dockerfiles"
"github.com/CyLabAcademy/cork/cork/dockerfiles"
)

const manualSchemaPrefix = "manual-"
Expand Down
2 changes: 1 addition & 1 deletion cork/delivery_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions e2e/cork.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions e2e/single.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/CyLabAcademy/challenge-orchestrator
module github.com/CyLabAcademy/cork

go 1.26.0

Expand Down
Loading