Skip to content

Commit 01c7ad6

Browse files
chore: harden repo security controls
1 parent f53c3db commit 01c7ad6

10 files changed

Lines changed: 481 additions & 7 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @jcarlosrodicio

.github/workflows/check.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 24
23+
24+
- name: Repository check
25+
run: npm run check
26+
27+
- name: Install OpenCode tool dependencies
28+
working-directory: opencode
29+
run: npm ci
30+
31+
- name: Audit OpenCode tool dependencies
32+
working-directory: opencode
33+
run: npm audit --omit=dev --audit-level=moderate
34+
35+
- name: Smoke import OpenCode plugin
36+
working-directory: opencode
37+
run: node --input-type=module -e "import('@opencode-ai/plugin').then(() => console.log('plugin import ok'))"

docker/open-design/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ RUN apt-get update \
77
RUN useradd -m -s /bin/bash opencode
88
WORKDIR /app
99

10-
RUN git clone https://github.com/nexu-io/open-design.git /app/open-design
10+
ARG OPEN_DESIGN_REF=1592beb96134f9d49b8a90dc6a359b94a69af57e
11+
ARG OPENCODE_AI_VERSION=1.14.31
12+
13+
RUN git clone https://github.com/nexu-io/open-design.git /app/open-design \
14+
&& cd /app/open-design \
15+
&& git checkout "$OPEN_DESIGN_REF"
1116
WORKDIR /app/open-design
1217

1318
RUN corepack enable \
1419
&& corepack prepare pnpm@10.33.2 --activate \
1520
&& pnpm install --frozen-lockfile=false \
16-
&& npm install -g opencode-ai@latest
21+
&& npm install -g "opencode-ai@$OPENCODE_AI_VERSION"
1722

1823
# Make the daemon listen on OD_HOST when upstream exposes host/port constants.
1924
# This is intentionally best-effort because upstream may change file layout.
@@ -29,7 +34,8 @@ for (const file of candidates) {
2934
}
3035
NODE
3136

32-
RUN pnpm build || pnpm -r build
37+
RUN pnpm --filter @open-design/daemon build \
38+
&& (pnpm build || pnpm -r build)
3339

3440
ENV OD_HOST=0.0.0.0
3541
ENV OD_PORT=7456
@@ -41,4 +47,4 @@ RUN mkdir -p /home/opencode/.config/opencode /home/opencode/.local/share/opencod
4147
USER opencode
4248
EXPOSE 7456
4349

44-
CMD ["sh", "-lc", "node apps/daemon/cli.js --host ${OD_HOST:-0.0.0.0} --port ${OD_PORT:-7456} --no-open || node daemon/cli.js --host ${OD_HOST:-0.0.0.0} --port ${OD_PORT:-7456} --no-open"]
50+
CMD ["sh", "-lc", "node apps/daemon/dist/cli.js --port ${OD_PORT:-7456} --no-open"]

docs/docker-open-design.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ cp .env.example .env
66
docker compose up -d --build
77
```
88

9+
The Docker image pins upstream build inputs by default:
10+
11+
- `OPEN_DESIGN_REF=1592beb96134f9d49b8a90dc6a359b94a69af57e`
12+
- `OPENCODE_AI_VERSION=1.14.31`
13+
14+
Update them intentionally when you want a newer Open Design or OpenCode CLI build:
15+
16+
```bash
17+
docker compose build \
18+
--build-arg OPEN_DESIGN_REF=<commit-sha> \
19+
--build-arg OPENCODE_AI_VERSION=<version>
20+
docker compose up -d
21+
```
22+
923
Authenticate OpenCode inside the container:
1024

1125
```bash

docs/synology.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Recommended setup:
1010
4. Configure Synology reverse proxy with HTTPS if exposing beyond localhost.
1111
5. Protect public access with VPN, Tailscale, WireGuard, or authentication.
1212

13+
The Dockerfile pins Open Design and OpenCode CLI build inputs. To update them,
14+
build with explicit args instead of editing to a floating branch or `latest`:
15+
16+
```bash
17+
docker compose build \
18+
--build-arg OPEN_DESIGN_REF=<commit-sha> \
19+
--build-arg OPENCODE_AI_VERSION=<version>
20+
docker compose up -d
21+
```
22+
1323
Useful operations:
1424

1525
```bash

opencode/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.DS_Store

0 commit comments

Comments
 (0)