Skip to content

Commit 3f1ee48

Browse files
chore: public-repo install flow and CI fixes
- setup.sh: point the curl one-liner at main, drop the private-repo wording, keep the prebuilt-binary path as an offline fallback - README: install URL now uses main - GIST: curl install is the primary path again - ci.yml: run on main pushes too, and grant SYS_ADMIN to the distro containers so the root-gated bind-mount tests (TestCheckSocketRoundTrip) pass
1 parent 0b628f7 commit 3f1ee48

4 files changed

Lines changed: 24 additions & 30 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: QO2 Multi-Distro CI
22

33
on:
44
push:
5-
branches: [ ctf-improvements ]
5+
branches: [ main, ctf-improvements ]
66
pull_request:
7-
branches: [ ctf-improvements ]
7+
branches: [ main, ctf-improvements ]
88

99
jobs:
1010
unit-tests:
@@ -39,7 +39,9 @@ jobs:
3939

4040
- name: Run Distro Container Build & Test Verification
4141
run: |
42-
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ${{ matrix.distro }} /bin/bash -c "
42+
# SYS_ADMIN lets the root-gated sandbox tests bind-mount /dev/null
43+
# into the chroot (TestCheckSocketRoundTrip); it is not granted by default.
44+
docker run --rm --cap-add SYS_ADMIN -v ${{ github.workspace }}:/workspace -w /workspace ${{ matrix.distro }} /bin/bash -c "
4345
set -e
4446
if command -v apt-get >/dev/null; then
4547
apt-get update && apt-get install -y sqlite3 git tar zip gzip bzip2 curl

GIST.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,36 @@
44
55
## 1. Install `qo`
66

7-
Download the **`qo`** binary and **`setup.sh`** from the drive (see step 2 — the same
8-
folder as `test.enc`), save both in your home folder, then:
7+
Open a terminal and run:
98

109
```bash
11-
cd ~
12-
chmod +x qo setup.sh
13-
./setup.sh ./qo
10+
curl -fsSL https://raw.githubusercontent.com/Open-Source-Community/qo2/main/setup.sh | bash
1411
```
1512

16-
The script installs `qo` to `/usr/local/bin` and creates the `qo-check`,
17-
`qo-setup`, and `qo-reset` aliases it needs.
18-
19-
> No script? Install manually:
20-
>
21-
> ```bash
22-
> chmod +x qo
23-
> sudo mv qo /usr/local/bin/qo
24-
> sudo ln -sf /usr/local/bin/qo /usr/local/bin/qo-check
25-
> sudo ln -sf /usr/local/bin/qo /usr/local/bin/qo-setup
26-
> sudo ln -sf /usr/local/bin/qo /usr/local/bin/qo-reset
27-
> ```
13+
The script detects your distro, installs the required tools (Go, tar, gzip), clones the source, builds `qo` as a static binary, and installs it to `/usr/local/bin/qo` with the `qo-check`, `qo-setup`, and `qo-reset` aliases it needs.
2814

2915
Verify:
3016

3117
```bash
3218
qo --help
3319
```
3420

21+
> No network access? Download the prebuilt **`qo`** binary and **`setup.sh`** from
22+
> the drive folder (step 2), save both in your home folder, then:
23+
>
24+
> ```bash
25+
> cd ~
26+
> chmod +x qo setup.sh
27+
> ./setup.sh ./qo
28+
> ```
29+
3530
## 2. Download the test archive
3631
3732
Get the practice archive from the drive:
3833
3934
**https://drive.google.com/drive/folders/1nhKUefmOJ8FNPSUXz4sXmCMmDvnXtsc3?usp=sharing**
4035
41-
Download `test.enc` (and `qo` + `setup.sh` from step 1, if you haven't) and save
42-
them in your home folder.
36+
Download `test.enc` and save it in your home folder.
4337
4438
## 3. Start the practice session
4539

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A tool for creating customizable sandboxed Linux environments for educational te
2222
Run this command to install `qo`.
2323

2424
```bash
25-
curl -fsSL https://raw.githubusercontent.com/Open-Source-Community/qo2/ctf-improvements/setup.sh | bash
25+
curl -fsSL https://raw.githubusercontent.com/Open-Source-Community/qo2/main/setup.sh | bash
2626
```
2727

2828
## Quick Start

setup.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
# qo-check / qo-setup / qo-reset aliases the sandbox uses.
77
#
88
# Usage:
9-
# curl -fsSL https://raw.githubusercontent.com/Open-Source-Community/qo2/ctf-improvements/setup.sh | bash
9+
# curl -fsSL https://raw.githubusercontent.com/Open-Source-Community/qo2/main/setup.sh | bash
1010
#
1111
# Or from a checkout:
1212
# ./setup.sh
1313
#
14-
# If the qo2 repo is private (it is), the curl/clone path above will not work —
15-
# that flow is for public checkouts only. For private repos, distribute the
16-
# static binary directly (e.g. alongside test.enc) and install it with:
14+
# No network access to the repo? Distribute the static binary directly
15+
# (e.g. alongside test.enc) and install it with:
1716
# ./setup.sh ./qo # path to the downloaded qo binary
1817
# ./setup.sh qo # or any local file
1918
#
@@ -141,8 +140,7 @@ if [ "$1" = "uninstall" ]; then
141140
fi
142141

143142
# Prebuilt binary path: if a local qo binary is given (or present in cwd),
144-
# install it directly. This is the flow for private-repo distribution — the
145-
# clone/curl paths below need the repo to be public.
143+
# install it directly without cloning or building.
146144
if [ -n "$1" ] && [ -f "$1" ]; then
147145
install_binary "$1"
148146
exit 0
@@ -161,7 +159,7 @@ else
161159
TMP_DIR=$(mktemp -d)
162160
trap 'rm -rf "$TMP_DIR"' EXIT
163161
log "cloning $REPO_URL ..."
164-
git clone --depth=1 "$REPO_URL" "$TMP_DIR/qo2" || die "cannot clone $REPO_URLthe repo is private; download the qo binary and run: ./setup.sh ./qo"
162+
git clone --depth=1 "$REPO_URL" "$TMP_DIR/qo2" || die "cannot clone $REPO_URLcheck your network/git access, or download the qo binary and run: ./setup.sh ./qo"
165163
build_and_install "$TMP_DIR/qo2"
166164
fi
167165

0 commit comments

Comments
 (0)