fix(ingress): make certbot dependencies measured - #117
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The Dockerfile timestamp normalization can unintentionally mutate symlink targets (hurting reproducibility), and certman.py’s new failure mode can surface as a generic “Unexpected error” rather than a clear, boolean failure.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR moves certbot (and DNS plugin) dependency installation from runtime to image build time, using hash-pinned Python requirements so certificate-related code paths are included in the measured image.
Changes:
- Removed runtime
pip installbootstrapping in ingress scripts and replaced it with “measured env must already contain deps” checks. - Simplified
certman.pyto stop attempting runtime plugin/certbot installation. - Added hash-pinned
requirements.txt/requirements.inand installed them during the Docker build for reproducible, measured layers.
File summaries
| File | Description |
|---|---|
| custom-domain/dstack-ingress/scripts/tlsalpn.sh | Removes runtime pip bootstrapping; validates the venv already contains required modules. |
| custom-domain/dstack-ingress/scripts/dns01.sh | Removes runtime pip bootstrapping; validates certbot + AWS deps are present in the measured venv. |
| custom-domain/dstack-ingress/scripts/certman.py | Removes runtime installation logic and shifts toward “dependency must already exist” behavior. |
| custom-domain/dstack-ingress/requirements.txt | Adds hash-pinned Python dependency lock for deterministic installs. |
| custom-domain/dstack-ingress/requirements.in | Adds the high-level dependency input list for generating the pinned lock. |
| custom-domain/dstack-ingress/Dockerfile | Installs Python deps into /opt/app-venv at build time and normalizes timestamps for reproducibility. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Install certbot and DNS plugins at image build time with hash-pinned requirements. Remove runtime PyPI installation paths so TLS key-generation code is covered by image measurement. Verified two clean linux/amd64 OCI builds produce identical archive digest.