Skip to content

Commit 733edfe

Browse files
todieclaude
andcommitted
feat: initial project scaffold
Cargo workspace with reach-cli and reach-supervisor crates, multi-stage Dockerfile (Ubuntu 24.04 + Chrome + Playwright + Scrapling), Makefile, pre-commit hooks, CI/CD (3 GitHub Actions workflows), docker-compose with optional observability, full documentation (10 files), and lint configs (rustfmt, clippy, cargo-deny, hadolint). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 parents  commit 733edfe

46 files changed

Lines changed: 2523 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUSTFLAGS: -D warnings
12+
13+
jobs:
14+
check:
15+
name: Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: dtolnay/rust-toolchain@stable
20+
with:
21+
components: rustfmt, clippy
22+
- uses: Swatinem/rust-cache@v2
23+
24+
- name: Format
25+
run: cargo fmt --all -- --check
26+
27+
- name: Clippy
28+
run: cargo clippy --workspace -- -D warnings
29+
30+
- name: Install cargo-deny
31+
run: cargo install cargo-deny --locked
32+
- name: Deny check
33+
run: cargo deny check
34+
35+
test:
36+
name: Test
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: dtolnay/rust-toolchain@stable
41+
- uses: Swatinem/rust-cache@v2
42+
- name: Run tests
43+
run: cargo test --workspace
44+
45+
build:
46+
name: Build
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: dtolnay/rust-toolchain@stable
51+
- uses: Swatinem/rust-cache@v2
52+
- name: Build release
53+
run: cargo build --workspace --release
54+
55+
docker:
56+
name: Docker
57+
runs-on: ubuntu-latest
58+
needs: [check, test]
59+
steps:
60+
- uses: actions/checkout@v4
61+
- name: Build image
62+
run: docker build -t reach .
63+
- name: Smoke test
64+
run: |
65+
docker run -d --name reach-test -p 8400:8400 --shm-size=2g reach
66+
sleep 5
67+
curl -f http://localhost:8400/health || exit 1
68+
docker stop reach-test
69+
docker rm reach-test

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
packages: write
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }}
15+
16+
jobs:
17+
build-binaries:
18+
name: Build ${{ matrix.target }}
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
include:
23+
- target: x86_64-unknown-linux-gnu
24+
os: ubuntu-latest
25+
- target: aarch64-unknown-linux-gnu
26+
os: ubuntu-latest
27+
- target: x86_64-apple-darwin
28+
os: macos-latest
29+
- target: aarch64-apple-darwin
30+
os: macos-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: dtolnay/rust-toolchain@stable
34+
with:
35+
targets: ${{ matrix.target }}
36+
- name: Install cross
37+
if: contains(matrix.target, 'aarch64-unknown-linux')
38+
run: cargo install cross --locked
39+
- name: Build
40+
run: |
41+
if command -v cross &> /dev/null && [[ "${{ matrix.target }}" == *"aarch64-unknown-linux"* ]]; then
42+
cross build --release --target ${{ matrix.target }} -p reach-cli
43+
else
44+
cargo build --release --target ${{ matrix.target }} -p reach-cli
45+
fi
46+
- name: Package
47+
run: |
48+
mkdir -p dist
49+
cp target/${{ matrix.target }}/release/reach dist/reach-${{ matrix.target }} || true
50+
- uses: actions/upload-artifact@v4
51+
with:
52+
name: reach-${{ matrix.target }}
53+
path: dist/
54+
55+
docker-image:
56+
name: Docker Image
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: docker/login-action@v3
61+
with:
62+
registry: ${{ env.REGISTRY }}
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
- uses: docker/metadata-action@v5
66+
id: meta
67+
with:
68+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
69+
tags: |
70+
type=semver,pattern={{version}}
71+
type=semver,pattern={{major}}.{{minor}}
72+
- uses: docker/build-push-action@v6
73+
with:
74+
context: .
75+
push: true
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: ${{ steps.meta.outputs.labels }}
78+
79+
github-release:
80+
name: GitHub Release
81+
runs-on: ubuntu-latest
82+
needs: [build-binaries, docker-image]
83+
steps:
84+
- uses: actions/checkout@v4
85+
- uses: actions/download-artifact@v4
86+
with:
87+
path: dist/
88+
merge-multiple: true
89+
- uses: softprops/action-gh-release@v2
90+
with:
91+
files: dist/*
92+
generate_release_notes: true

.github/workflows/security.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Security
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 * * 1" # Weekly Monday 6am UTC
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
audit:
11+
name: Cargo Audit
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: dtolnay/rust-toolchain@stable
16+
- name: Install cargo-audit
17+
run: cargo install cargo-audit --locked
18+
- name: Audit
19+
run: cargo audit
20+
21+
deny:
22+
name: Cargo Deny Advisories
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
27+
- name: Install cargo-deny
28+
run: cargo install cargo-deny --locked
29+
- name: Check advisories
30+
run: cargo deny check advisories
31+
32+
trivy:
33+
name: Trivy Container Scan
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Build image
38+
run: docker build -t reach:scan .
39+
- uses: aquasecurity/trivy-action@master
40+
with:
41+
image-ref: reach:scan
42+
format: table
43+
exit-code: 1
44+
severity: CRITICAL,HIGH

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Rust
2+
/target/
3+
**/*.rs.bk
4+
Cargo.lock
5+
6+
# IDE
7+
.idea/
8+
.vscode/
9+
*.swp
10+
*.swo
11+
*~
12+
13+
# OS
14+
.DS_Store
15+
Thumbs.db
16+
17+
# Docker
18+
.docker/
19+
20+
# Environment
21+
.env
22+
.env.*
23+
!.env.example
24+
25+
# Coverage
26+
*.profraw
27+
lcov.info
28+
tarpaulin-report.html

.hadolint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ignored:
2+
- DL3008 # pin versions in apt-get — we use latest for system packages
3+
- DL3013 # pin versions in pip — managed by requirements

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: cargo-fmt
5+
name: cargo fmt
6+
entry: cargo fmt --all -- --check
7+
language: system
8+
types: [rust]
9+
pass_filenames: false
10+
11+
- id: cargo-clippy
12+
name: cargo clippy
13+
entry: cargo clippy --workspace -- -D warnings
14+
language: system
15+
types: [rust]
16+
pass_filenames: false
17+
18+
- repo: https://github.com/hadolint/hadolint
19+
rev: v2.13.1-beta
20+
hooks:
21+
- id: hadolint-docker
22+
name: hadolint
23+
types: [dockerfile]
24+
25+
- repo: https://github.com/koalaman/shellcheck-precommit
26+
rev: v0.10.0
27+
hooks:
28+
- id: shellcheck
29+
30+
- repo: https://github.com/tamasfe/taplo
31+
rev: 0.9.3
32+
hooks:
33+
- id: taplo
34+
name: taplo fmt
35+
args: [fmt, --check]
36+
37+
- repo: https://github.com/crate-ci/typos
38+
rev: v1.31.1
39+
hooks:
40+
- id: typos

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.0.1] - 2026-04-02
11+
12+
### Added
13+
14+
- Cargo workspace with two crates: reach-cli and reach-supervisor.
15+
- reach-cli with command scaffolds: create, destroy, list, connect, exec, serve, vnc, screenshot.
16+
- reach-supervisor with PID 1 process supervision, health API, and Prometheus metrics endpoint.
17+
- Multi-stage Dockerfile: Rust builder + Ubuntu 24.04 runtime with Xvfb, openbox, x11vnc, noVNC, Chrome, Playwright, Scrapling.
18+
- Docker Compose with observability profile (Prometheus, Grafana).
19+
- GitHub Actions CI: format, clippy, deny, test, Docker build + smoke test.
20+
- GitHub Actions release workflow: cross-compiled binaries (linux x86_64/aarch64, macOS x86_64/aarch64), Docker image push to ghcr.io, GitHub release.
21+
- Security scanning workflow.
22+
- Makefile with build, dev, lint, test, and container targets.
23+
- Pre-commit hook configuration.
24+
- cargo-deny configuration for license and advisory checks.
25+
- Chrome managed policies (disable updates and first-run).
26+
- Openbox window manager configuration.
27+
28+
[Unreleased]: https://github.com/todie/reach/compare/v0.0.1...HEAD
29+
[0.0.1]: https://github.com/todie/reach/releases/tag/v0.0.1

0 commit comments

Comments
 (0)