Archived
fix: support OpenCode auth in read-only executor
This commit is contained in:
@@ -62,7 +62,7 @@ Commands must begin the comment and are processed only on comment creation. Pull
|
|||||||
- An OpenAI account usable by OpenCode.
|
- An OpenAI account usable by OpenCode.
|
||||||
- A reverse proxy providing HTTPS to the controller.
|
- A reverse proxy providing HTTPS to the controller.
|
||||||
|
|
||||||
The images pin OpenCode CLI and SDK 1.17.18 and Gitea MCP 1.3.0.
|
The images pin OpenCode CLI 1.18.2, OpenCode SDK 1.17.18, and Gitea MCP 1.3.0.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -16,11 +16,10 @@ RUN apk add --no-cache ca-certificates coreutils git openssh-client \
|
|||||||
/var/lib/gitea-agent/state \
|
/var/lib/gitea-agent/state \
|
||||||
/var/lib/gitea-agent/workspaces \
|
/var/lib/gitea-agent/workspaces \
|
||||||
/var/lib/opencode-agent/data \
|
/var/lib/opencode-agent/data \
|
||||||
|
/var/lib/opencode-agent/state \
|
||||||
/var/lib/opencode-agent/cache \
|
/var/lib/opencode-agent/cache \
|
||||||
&& install -d -o root -g root -m 0555 \
|
&& install -d -o root -g root -m 0555 \
|
||||||
/opt/ci-agents \
|
/opt/ci-agents
|
||||||
/opt/ci-agents/empty-config \
|
|
||||||
/opt/ci-agents/empty-config/opencode
|
|
||||||
|
|
||||||
COPY --from=app-build /src/app/dist /opt/ci-agents/dist
|
COPY --from=app-build /src/app/dist /opt/ci-agents/dist
|
||||||
COPY --from=app-build /src/app/node_modules /opt/ci-agents/node_modules
|
COPY --from=app-build /src/app/node_modules /opt/ci-agents/node_modules
|
||||||
@@ -59,12 +58,12 @@ RUN npm install --global --omit=dev "opencode-ai@${OPENCODE_VERSION}" \
|
|||||||
&& rm -f "/tmp/${asset}" /tmp/gitea-mcp
|
&& rm -f "/tmp/${asset}" /tmp/gitea-mcp
|
||||||
|
|
||||||
COPY opencode /opt/ci-agents/opencode
|
COPY opencode /opt/ci-agents/opencode
|
||||||
RUN chmod -R a-w /opt/ci-agents \
|
RUN touch /opt/ci-agents/opencode/.gitignore \
|
||||||
&& chown ci-agent /opt/ci-agents/empty-config/opencode \
|
&& chmod -R a-w /opt/ci-agents
|
||||||
&& chmod u+w /opt/ci-agents/empty-config/opencode
|
|
||||||
|
|
||||||
ENV XDG_DATA_HOME=/var/lib/opencode-agent/data \
|
ENV XDG_DATA_HOME=/var/lib/opencode-agent/data \
|
||||||
XDG_CONFIG_HOME=/opt/ci-agents/empty-config \
|
XDG_CONFIG_HOME=/var/lib/opencode-agent/state \
|
||||||
|
XDG_STATE_HOME=/var/lib/opencode-agent/state \
|
||||||
XDG_CACHE_HOME=/var/lib/opencode-agent/cache \
|
XDG_CACHE_HOME=/var/lib/opencode-agent/cache \
|
||||||
OPENCODE_CONFIG_DIR=/opt/ci-agents/opencode \
|
OPENCODE_CONFIG_DIR=/opt/ci-agents/opencode \
|
||||||
OPENCODE_DISABLE_PROJECT_CONFIG=true \
|
OPENCODE_DISABLE_PROJECT_CONFIG=true \
|
||||||
|
|||||||
+7
-16
@@ -34,16 +34,8 @@ services:
|
|||||||
GITEA_WRITE_TOKEN_FILE: /run/secrets/gitea_write_token
|
GITEA_WRITE_TOKEN_FILE: /run/secrets/gitea_write_token
|
||||||
GITEA_WEBHOOK_SECRET_FILE: /run/secrets/gitea_webhook_secret
|
GITEA_WEBHOOK_SECRET_FILE: /run/secrets/gitea_webhook_secret
|
||||||
secrets:
|
secrets:
|
||||||
- source: gitea_write_token
|
- gitea_write_token
|
||||||
target: gitea_write_token
|
- gitea_webhook_secret
|
||||||
uid: "10001"
|
|
||||||
gid: "10001"
|
|
||||||
mode: 0400
|
|
||||||
- source: gitea_webhook_secret
|
|
||||||
target: gitea_webhook_secret
|
|
||||||
uid: "10001"
|
|
||||||
gid: "10001"
|
|
||||||
mode: 0400
|
|
||||||
networks:
|
networks:
|
||||||
- gitea-common
|
- gitea-common
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@@ -54,6 +46,9 @@ services:
|
|||||||
|
|
||||||
executor:
|
executor:
|
||||||
<<: *common
|
<<: *common
|
||||||
|
tmpfs:
|
||||||
|
- /tmp:rw,nosuid,nodev,mode=1777
|
||||||
|
- /var/lib/opencode-agent/state:rw,nosuid,nodev,noexec,mode=1777
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: deploy/Dockerfile
|
dockerfile: deploy/Dockerfile
|
||||||
@@ -63,19 +58,15 @@ services:
|
|||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
GITEA_READ_TOKEN_FILE: /run/secrets/gitea_read_token
|
GITEA_READ_TOKEN_FILE: /run/secrets/gitea_read_token
|
||||||
XDG_DATA_HOME: /var/lib/opencode-agent/data
|
XDG_DATA_HOME: /var/lib/opencode-agent/data
|
||||||
|
XDG_STATE_HOME: /var/lib/opencode-agent/state
|
||||||
XDG_CACHE_HOME: /var/lib/opencode-agent/cache
|
XDG_CACHE_HOME: /var/lib/opencode-agent/cache
|
||||||
secrets:
|
secrets:
|
||||||
- source: gitea_read_token
|
- gitea_read_token
|
||||||
target: gitea_read_token
|
|
||||||
uid: "10001"
|
|
||||||
gid: "10001"
|
|
||||||
mode: 0400
|
|
||||||
volumes:
|
volumes:
|
||||||
- ${AGENT_STATE_DIR:-./state/server}:/var/lib/gitea-agent/state
|
- ${AGENT_STATE_DIR:-./state/server}:/var/lib/gitea-agent/state
|
||||||
- ${AGENT_WORKSPACE_DIR:-./state/workspaces}:/var/lib/gitea-agent/workspaces
|
- ${AGENT_WORKSPACE_DIR:-./state/workspaces}:/var/lib/gitea-agent/workspaces
|
||||||
- ${OPENCODE_DATA_DIR:-./state/opencode}:/var/lib/opencode-agent/data
|
- ${OPENCODE_DATA_DIR:-./state/opencode}:/var/lib/opencode-agent/data
|
||||||
- ${CACHE_DIR:-./state/cache}:/var/lib/opencode-agent/cache
|
- ${CACHE_DIR:-./state/cache}:/var/lib/opencode-agent/cache
|
||||||
- ${OPENCODE_CONFIG_DIR:-./deploy/opencode-config}:/opt/ci-agents/empty-config/opencode
|
|
||||||
depends_on:
|
depends_on:
|
||||||
controller:
|
controller:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
Reference in New Issue
Block a user