-
Notifications
You must be signed in to change notification settings - Fork 70
fix(cli): route all pino logs to stderr to prevent stdout pollution in stdio transport #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sithu015
wants to merge
9
commits into
fdmtl:main
Choose a base branch
from
sithu015:fix-stdio-logging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dea1cd5
fix(cli): route all pino logs to stderr to prevent stdout pollution i…
sithu015 134f35a
fix(docker): build from source to include latest auth features
sithu015 489194a
fix(docker): update to bun 1.x and fix pipx installation
sithu015 a3b2ebb
fix(docker): use apt-get to install pipx to avoid PEP668
sithu015 ee9ba81
feat(auth): add DISABLE_SIGNUPS env var to prevent public registration
sithu015 2dc680f
chore: add authCheck for debugging
sithu015 482a537
fix(docker): symlink director binary to fix dokploy execution
sithu015 35a9328
fix: replace director symlink with wrapper script
sithu015 d8c02b0
fix: update docker CMD to run gateway server instead of cli serve
sithu015 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,43 @@ | ||
| FROM node:20-slim | ||
| FROM oven/bun:1-slim AS builder | ||
|
|
||
| # Update dependencies | ||
| RUN apt-get update | ||
| WORKDIR /app | ||
|
|
||
| # Install dependencies | ||
| RUN apt-get install -y \ | ||
| # Copy the monorepo source code | ||
| COPY . . | ||
|
|
||
| # Install dependencies and build | ||
| RUN bun install | ||
| RUN bun run build | ||
|
|
||
| FROM oven/bun:1-slim AS runner | ||
| WORKDIR /app | ||
|
|
||
| # Install system dependencies that might be needed by MCP servers | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl \ | ||
| git \ | ||
| python3-pip \ | ||
| pipx | ||
| python3-venv \ | ||
| pipx \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Used by many MCP servers | ||
| # Install uv for Python MCP servers using pipx | ||
| RUN pipx install uv | ||
|
|
||
| # Add pipx bin directory to PATH so uvx is available | ||
| ENV PATH="/root/.local/bin:${PATH}" | ||
|
|
||
| # Create director directory for volume mounting | ||
| # Create director directory | ||
| RUN mkdir -p /root/.director | ||
|
|
||
| # Install Director CLI globally | ||
| RUN npm install -g @director.run/cli@latest | ||
| # Copy built files and dependencies from builder | ||
| COPY --from=builder /app /app | ||
|
|
||
| # Set default port | ||
| ENV GATEWAY_PORT=8080 | ||
|
|
||
| # Expose the gateway port | ||
| EXPOSE ${GATEWAY_PORT} | ||
|
|
||
| # Create a simple healthcheck | ||
| # HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ | ||
| # CMD curl -f http://localhost:${GATEWAY_PORT}/health || exit 1 | ||
| # Create a wrapper script for the director executable | ||
| RUN echo '#!/bin/sh' > /usr/local/bin/director && \ | ||
| echo 'exec bun run /app/apps/cli/bin/cli.ts "$@"' >> /usr/local/bin/director && \ | ||
| chmod +x /usr/local/bin/director | ||
|
|
||
| # Run director serve | ||
| CMD ["sh", "-c", "director serve"] | ||
| # Run the gateway server | ||
| CMD ["bun", "run", "/app/apps/gateway/bin/server.ts"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CLI applications, using asynchronous logging can lead to lost log messages if the process exits unexpectedly or crashes before the internal buffer is flushed. Since this logger is used in a CLI context (e.g., MCP stdio transport), it is highly recommended to configure
pino.destinationto write synchronously by settingsync: true.