Skip to content

Implement DockPilot application stack#1

Open
baou9 wants to merge 17 commits into
mainfrom
codex/build-secure-docker-app-control-center
Open

Implement DockPilot application stack#1
baou9 wants to merge 17 commits into
mainfrom
codex/build-secure-docker-app-control-center

Conversation

@baou9

@baou9 baou9 commented Nov 8, 2025

Copy link
Copy Markdown
Owner

Summary

  • build the Fastify + PostgreSQL backend with secure auth, Docker container discovery, health monitoring, and optional AI insights
  • create the Nuxt dashboard with authentication flow, container management UI, theming, and detail editing experience
  • add database schema, docker-compose stack, environment template, and project documentation updates

Testing

  • Not run (npm dependencies not installed in this environment)

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +39 to +53
export async function requireAuth(req: FastifyRequest, reply: FastifyReply) {
const user = await resolveSessionUser(req);
if (!user) {
reply.code(401);
throw new Error('Unauthorized');
}
return user;
}

export async function requireOwner(req: FastifyRequest, reply: FastifyReply) {
const user = await requireAuth(req, reply);
if (!user.is_owner) {
reply.code(403);
throw new Error('Forbidden');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Return 401/403 from auth guard instead of 500

requireAuth and requireOwner set the reply status before throwing a plain Error. Fastify’s default error handler ignores reply.code() when an error is thrown and uses the error’s statusCode, so unauthenticated or non‑owner requests will respond with HTTP 500 instead of the intended 401/403. This breaks client side control flow and leaks stack traces on simple auth failures. Throw an error with an explicit statusCode (e.g. fastify.httpErrors.unauthorized()/forbidden()) or send the response directly rather than throwing.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant