- Notifications
You must be signed in to change notification settings - Fork630
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
docs: Explain corp vpn and proxy, fixup FAQ, fixes #7048#7061
base:main
Are you sure you want to change the base?
Conversation
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.
Looks good to me.
To fix this so that applications inside the web container (or other containers) can access the internet, the web image must be adjusted to trust the alternate CA that the VPN provides, so the intermediate system is not rejected as invalid. | ||
Several specific ways to sort this out are listed in the related [Stack Overflow](https://stackoverflow.com/questions/71595327/corporate-network-vpn-ddev-composer-create-results-in-ssl-certificate-proble) question, but the basic answer is: | ||
1. Obtain the CA `.crt` files from your IT department, vendor, or other source. | ||
2. Place the `.crt` files in your `.ddev/web-build` directory. | ||
3. Use a `.ddev/web-build/Dockerfile.vpn` to install the `.crt` files, as shown in this example `.ddev/web-build/Dockerfile.vpn`: | ||
```Dockerfile | ||
COPY <yourcert>*.crt /usr/local/share/ca-certificates/ | ||
RUN update-ca-certificates --fresh | ||
``` | ||
4. To test for success, | ||
```bash | ||
ddev restart | ||
ddev exec curl -I https://www.google.com # Or any URL you need | ||
``` | ||
and you expect a "200 OK" response. |
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.
This assumes you were able to download images in the first place by running Docker without Zscaler. Otherwise, with Colima on MacOS, you must update the CA certificates in the Docker virtual machine or no images will download. Once I did that I did not have to add the CA certificate to the web container. Haven't tried other Docker servers yet.
https://darren.oh.name/node/81
This still needs a bit of work and community review:
|
Co-authored-by: tyler36 <tyler36@users.noreply.github.com>
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
c2b2f12
to92e89ad
CompareRebased to pick up buildkite skip for docs: |
Here is@shelane writeup. Adding Custom CA Certificates to Your DDEV ProjectWhen working with DDEV in environments that require custom CA certificates (e.g., internal networks, VPNs, or corporate proxies), it is essential to properly configure these certificates to ensure secure communication. This guide provides step-by-step instructions for obtaining, converting, and installing custom CA certificates in your DDEV project. Steps to Add Custom CA Certificates
To ensure compatibility, all CA certificates must be in PEM format. PEM format certificates are human-readable and start with
Replace .crt with the path to your DER certificate and .crt with the desired output file name.
Replacehttps://www.google.com with a URL that requires the custom CA certificates. A successful response will include a 200 OK status. TroubleshootingCommon Issues
Debugging Tips
Example Directory Structure After completing the steps above, your .ddev/web-build directory should look like this:
SummaryBy following this guide, you can successfully add and configure custom CA certificates in your DDEV project. Ensuring the certificates are in PEM format and properly installed in the container is critical for secure communication with internal or external services. |
Hello, just my 5 cents here as I was working with DDEV behind corporate proxy for last few months, struggling with no previous experience with proxies at all (long story short: proxy info inside
I was doing all this research this week in my office, but today I was able to reproduce same situation on my personal PC with two VirtualBox machines (one Debian with Squid as proxy, and one Linux Mint with DDEV, connected together via 'internal' network). |
@maciazek thanks for checking in! your comment is about a proxy only, right, not a VPN situation? Was your problem with the ddev-router not becoming ready as in the issue you link to? If so, have you tested DDEV HEAD with the fix mentioned in that issue?https://ddev.readthedocs.io/en/stable/developers/building-contributing/#testing-latest-commits-on-head If you have suggestions for this PR based on your work (and using DDEV HEAD) they would be very welcome! |
maciazek commentedMar 16, 2025
Yes, I'm talking about proxy only, not VPN as I'm working on-site.
If there is some special character, it has to be url-encoded (with double %):
And yes, after setting up my proxy correctly (in
Today I upgraded to 1.24.3 and ddev-router couldn't start again. Then I tried HEAD version (ddev version v1.24.3-25-g419560521) as described in docs and now ddev-router is starting without problems (I was testing in my local reproduced environment). This week I'll try to test it at my workplace, but I assume it will behave the same way. So, in my opinion there are 2 things that should be added to docs (from my environment's perspective, of course):
{"proxies": {"default": {"httpProxy":"http://username:p%%40ssword@192.168.1.10:3128","httpsProxy":"http://username:p%%40ssword@192.168.1.10:3128","noProxy":"localhost,127.0.0.1/8,::1,*.ddev.site,ddev-myapp1-web,ddev-myapp1-phpmyadmin,ddev-myapp2-web,ddev-myapp2-phpmyadmin" } }} Maybe there is some simpler way to set these container names once for all projects? |
Thanks@maciazek -
I've had varying approaches to this, and am a bit confused about it. You're sure that the /etc/systemd stuff is required, as opposed to just putting it in the user's .docker, true?
That seems enormously awkward and wrong of course. One note: I've seen a mention that Thanks so much for your careful work and help on this! |
maciazek commentedMar 16, 2025
I deleted file
I have HTTP_PROXY env vars set in I also tried "Daemon configuration" approachdescribed in the docs, but I was able to pull images only when I set up Config set via both 'rootless modes' described in docs (
I did some more tests (in
Errors are coming from Squid (
|
Thanks. Just a note that DDEV does not support rootless docker. |
The Issue
We occasionally have people with VPN or proxy situations that need help and reference about those
How This PR Solves The Issue
name
info to FAQTODO
name
line to remote-config if it's not already thereddev-proxy-support
can work when pulling new images (it probably can't)Manual Testing Instructions
Review (mostly) athttps://ddev--7061.org.readthedocs.build/en/7061/users/usage/networking/
FAQ is athttps://ddev--7061.org.readthedocs.build/en/7061/users/usage/faq/#i-want-to-use-the-same-code-with-various-project-names
Automated Testing Overview
Release/Deployment Notes