Caddy HTTPS#2129
Open
Pythoniasm wants to merge 1 commit intogetumbrel:masterfrom
Open
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
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.
Caddy HTTPS Proxy Integration for Umbrel
Summary
This merge request adds HTTPS support to Umbrel using Caddy as a reverse proxy server. The implementation enables secure, encrypted connections to all self-hosted apps on the local network, protecting against man-in-the-middle attacks even in untrusted local network environments.
Problem Statement
Umbrel currently serves all apps over unencrypted HTTP, which is vulnerable to:
This is particularly concerning for users on:
Solution
Integrate Caddy reverse proxy to provide:
Architecture
Changes
New Files
Core Module
packages/umbreld/source/modules/caddy/index.ts- Main Caddy modulepackages/umbreld/source/modules/caddy/schema.ts- Settings schema with Zod validationpackages/umbreld/source/modules/caddy/config-builder.ts- Caddyfile and JSON config generationpackages/umbreld/source/modules/caddy/README.md- Comprehensive documentationContainer
containers/caddy/Dockerfile- Caddy container buildcontainers/caddy/Caddyfile.template- Base Caddyfile templateDocker Compose
packages/umbreld/source/modules/apps/legacy-compat/docker-compose.caddy.yml- Caddy service definitionTests
packages/umbreld/source/modules/caddy/config-builder.test.ts- Unit tests for config generationcontainers/caddy/test/docker-compose.yml- Integration test setupcontainers/caddy/test/Caddyfile.test- Test Caddyfilecontainers/caddy/test/test.sh- Test runner scriptModified Files
Core Integration
packages/umbreld/source/index.ts- Initialize Caddy module on startuppackages/umbreld/source/modules/apps/app.ts- Add lifecycle hooks for app registrationpackages/umbreld/source/modules/apps/legacy-compat/app-environment.ts- Add Caddy environment variablespackages/umbreld/source/modules/apps/legacy-compat/docker-compose.app_proxy.yml- Enable PROXY_TRUST_UPSTREAMFeatures
Automatic Certificate Generation
${UMBREL_DATA_DIR}/caddy/certs/Dynamic App Routing
https://umbrel.local/{app-id}/*Security Headers
All responses include:
Configuration Options
enabledfalsedomainumbrel.localhttpPort80httpsPort443forceHttpstrueUsage
Enable via API
Access Apps
Once enabled, all apps are accessible via HTTPS:
Testing
Unit Tests
Integration Tests
cd containers/caddy/test ./test.shThe integration test:
Backward Compatibility
Security Considerations
Self-Signed Certificates
Network Security
Future Enhancements
myapp.umbrel.local)Performance
Migration Path
For New Installations
For Existing Installations
Known Limitations
Future Work
Short-term
Medium-term
Long-term
Testing Performed
✅ TypeScript compilation - No errors
✅ Module initialization - Successful
✅ Certificate generation - Working
✅ App registration/unregistration - Working
✅ HTTP to HTTPS redirect - Working
✅ Security headers - Present
✅ Dynamic config reload - Working
✅ Container lifecycle - Clean start/stop
Documentation
packages/umbreld/source/modules/caddy/README.mdcontainers/caddy/test/Dependencies
License
Part of the Umbrel project. Same license as main repository.
Checklist
Related Issues
This addresses the need for HTTPS support on untrusted local networks, protecting against MITM attacks and credential theft.
Questions?
See
packages/umbreld/source/modules/caddy/README.mdfor detailed usage instructions and troubleshooting guide.