You've already forked agentic-coding-workflow
修复启动问题
This commit is contained in:
+4
-1
@@ -29,7 +29,10 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
WORKDIR /app
|
||||
COPY --from=go /out/server /app/server
|
||||
COPY migrations /app/migrations
|
||||
RUN mkdir -p /data && chown app:app /data
|
||||
RUN mkdir -p /data/uploads && chown -R app:app /data
|
||||
ENV APP_DATA_DIR=/data \
|
||||
APP_WORKSPACE_DATA_DIR=/data \
|
||||
APP_STORAGE_LOCALFS_BASE_PATH=/data/uploads
|
||||
USER app
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/app/server"]
|
||||
|
||||
@@ -23,7 +23,6 @@ services:
|
||||
APP_HTTP_ADDR: ":8080"
|
||||
APP_DB_DSN: "postgres://${POSTGRES_USER:-acw}:${POSTGRES_PASSWORD:-acw}@postgres:5432/${POSTGRES_DB:-acw}?sslmode=disable"
|
||||
APP_MASTER_KEY: "${APP_MASTER_KEY}"
|
||||
APP_DATA_DIR: "/data"
|
||||
APP_BOOTSTRAP_ADMIN_EMAIL: "${APP_BOOTSTRAP_ADMIN_EMAIL:-admin@local}"
|
||||
APP_BOOTSTRAP_ADMIN_PASSWORD: "${APP_BOOTSTRAP_ADMIN_PASSWORD}"
|
||||
ports:
|
||||
|
||||
@@ -42,35 +42,34 @@ func NewHandler(ws WorkspaceService, wt WorktreeService, gop GitOpsService, reso
|
||||
|
||||
// Mount 把所有 workspace / worktree / gitops 路由挂到 r 上,统一装入 Auth 中间件。
|
||||
func (h *Handler) Mount(r chi.Router) {
|
||||
r.Route("/api/v1", func(r chi.Router) {
|
||||
r.Use(middleware.Auth(h.resolver, middleware.AuthOptions{}))
|
||||
r.Route("/projects/{projectSlug}/workspaces", func(r chi.Router) {
|
||||
r.Post("/", h.createWorkspace)
|
||||
r.Get("/", h.listWorkspaces)
|
||||
})
|
||||
r.Route("/workspaces/{wsID}", func(r chi.Router) {
|
||||
r.Get("/", h.getWorkspace)
|
||||
r.Patch("/", h.updateWorkspace)
|
||||
r.Delete("/", h.deleteWorkspace)
|
||||
r.Post("/sync", h.syncWorkspace)
|
||||
r.Put("/credential", h.upsertCredential)
|
||||
r.Get("/credential", h.getCredentialMeta)
|
||||
auth := middleware.Auth(h.resolver, middleware.AuthOptions{})
|
||||
|
||||
r.Get("/main/status", h.statusOnMain)
|
||||
r.Post("/main/commit", h.commitOnMain)
|
||||
r.Post("/main/push", h.pushOnMain)
|
||||
r.With(auth).Route("/api/v1/projects/{projectSlug}/workspaces", func(r chi.Router) {
|
||||
r.Post("/", h.createWorkspace)
|
||||
r.Get("/", h.listWorkspaces)
|
||||
})
|
||||
r.With(auth).Route("/api/v1/workspaces/{wsID}", func(r chi.Router) {
|
||||
r.Get("/", h.getWorkspace)
|
||||
r.Patch("/", h.updateWorkspace)
|
||||
r.Delete("/", h.deleteWorkspace)
|
||||
r.Post("/sync", h.syncWorkspace)
|
||||
r.Put("/credential", h.upsertCredential)
|
||||
r.Get("/credential", h.getCredentialMeta)
|
||||
|
||||
r.Get("/worktrees", h.listWorktrees)
|
||||
r.Post("/worktrees", h.createWorktree)
|
||||
})
|
||||
r.Route("/worktrees/{wtID}", func(r chi.Router) {
|
||||
r.Delete("/", h.deleteWorktree)
|
||||
r.Post("/acquire", h.acquireWorktree)
|
||||
r.Post("/release", h.releaseWorktree)
|
||||
r.Get("/status", h.statusOnWorktree)
|
||||
r.Post("/commit", h.commitOnWorktree)
|
||||
r.Post("/push", h.pushOnWorktree)
|
||||
})
|
||||
r.Get("/main/status", h.statusOnMain)
|
||||
r.Post("/main/commit", h.commitOnMain)
|
||||
r.Post("/main/push", h.pushOnMain)
|
||||
|
||||
r.Get("/worktrees", h.listWorktrees)
|
||||
r.Post("/worktrees", h.createWorktree)
|
||||
})
|
||||
r.With(auth).Route("/api/v1/worktrees/{wtID}", func(r chi.Router) {
|
||||
r.Delete("/", h.deleteWorktree)
|
||||
r.Post("/acquire", h.acquireWorktree)
|
||||
r.Post("/release", h.releaseWorktree)
|
||||
r.Get("/status", h.statusOnWorktree)
|
||||
r.Post("/commit", h.commitOnWorktree)
|
||||
r.Post("/push", h.pushOnWorktree)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user