-
Notifications
You must be signed in to change notification settings - Fork 7
Feat--Add-Dockerfile-and-update #11
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
theepicsaxguy
wants to merge
16
commits into
root-fr:main
Choose a base branch
from
theepicsaxguy:feat--Add-Dockerfile-and-update
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
Feat--Add-Dockerfile-and-update #11
theepicsaxguy
wants to merge
16
commits into
root-fr:main
from
theepicsaxguy:feat--Add-Dockerfile-and-update
Conversation
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
…Node.js version in README
541191e to
581ec72
Compare
…estrict platforms
- Add detailed request logging including URL, auth type - Log full error responses from upstream JMAP server - Include response body in error logs (truncated to 500 chars) - Add stack traces for caught exceptions - Improve error messages with status code and status text This will help debug the 402 Payment Required error from the upstream JMAP server. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Critical fixes for JMAP session handling: 1. **Fix 307 redirect**: Add redirect: 'follow' to fetch options to properly handle Stalwart's 307 redirect from /.well-known/jmap to /jmap/session 2. **Fix mixed content blocking**: Rewrite HTTP URLs to HTTPS in JMAP session response to prevent browser mixed content errors - Rewrites apiUrl, downloadUrl, uploadUrl, eventSourceUrl - Removes :8080 port from URLs (assuming reverse proxy handles this) - Logs each rewrite for debugging This fixes the 402 error which was actually caused by the browser blocking mixed content HTTP requests from an HTTPS page. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Security improvements for production deployment: 1. **Content Security Policy (CSP)**: - Added strict CSP headers to prevent XSS and injection attacks - Allows only trusted sources for scripts, styles, images, and connections - Blocks inline scripts/styles except where needed for functionality - Prevents framing, object embedding, and other attack vectors - Enforces HTTPS upgrade for all insecure requests 2. **Secure URL Rewriting**: - Enhanced URL rewriting logic with hostname validation - Only rewrites URLs from the configured JMAP server domain - Prevents URL injection attacks - Validates URLs before rewriting to prevent malformed URL attacks - Logs refused rewrites for security monitoring 3. **Additional Security Headers** (already present): - X-Frame-Options: DENY - X-Content-Type-Options: nosniff - Referrer-Policy: no-referrer - Strict-Transport-Security with preload - Permissions-Policy to block unnecessary browser features These changes make the application suitable for national security level deployments by implementing defense-in-depth security practices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
containerization and Kubernetes-ready deployment for JMAP Webmail with:
Key Changes
Docker & Container Image
Dockerfile: Multi-stage build (Node 22 Alpine) with:
.dockerignore: Excludes build artifacts, git, node_modules for minimal image size
docker-compose.yml: Complete local testing environment with:
Configuration (No Hardcoded Values)
.env.example: Comprehensive documentation of all 40+ environment variables:
i18n/request.ts: Timezone now uses env vars instead of hardcoded 'Europe/Paris'
Structured Logging
lib/logger.ts: New utility providing:
lib/server-init.ts: Startup logging showing:
api/health/route.ts: Enhanced with:
api/config/route.ts: Added logging for debugging
app/layout.tsx: Imported server-init for startup logging
Kubernetes Deployment
GitHub Actions CI/CD
Documentation
DOCKER.md: 300+ lines covering:
GHCR.md: 250+ lines covering:
Dependencies Updated
Version Bump