From 81de1d11993aff21c3d58c28df0b852b3139723a Mon Sep 17 00:00:00 2001 From: Francis Chuang Date: Mon, 11 Nov 2024 15:12:29 +1100 Subject: [PATCH 1/2] Fix quote escaping in command to configure Docker DNS --- .github/workflows/pull-requests.yml | 1 + .github/workflows/tests.yml | 1 + lib/setup-cloudflare-warp.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index d7b9605..b7e4b82 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -36,4 +36,5 @@ jobs: organization: ${{ secrets.CLOUDFLARE_ACCESS_ORGANIZATION }} auth_client_id: ${{ secrets.CLOUDFLARE_ACCESS_CLIENT_ID }} auth_client_secret: ${{ secrets.CLOUDFLARE_ACCESS_CLIENT_SECRET }} + configure_docker_dns: true - run: curl -I https://www.google.com diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c80fe7..b581d71 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,4 +24,5 @@ jobs: organization: ${{ secrets.CLOUDFLARE_ACCESS_ORGANIZATION }} auth_client_id: ${{ secrets.CLOUDFLARE_ACCESS_CLIENT_ID }} auth_client_secret: ${{ secrets.CLOUDFLARE_ACCESS_CLIENT_SECRET }} + configure_docker_dns: true - run: curl -I https://www.google.com diff --git a/lib/setup-cloudflare-warp.js b/lib/setup-cloudflare-warp.js index a413aab..caf1abf 100644 --- a/lib/setup-cloudflare-warp.js +++ b/lib/setup-cloudflare-warp.js @@ -124,7 +124,7 @@ async function configureLinuxDockerDNS() { `/bin/bash -c "echo "DNSStubListenerExtra=172.17.0.1" | sudo tee -a /etc/systemd/resolved.conf"`, ); await exec.exec( - `/bin/bash -c "cat /etc/docker/daemon.json | jq '.dns=["172.17.0.1"]' | sudo tee /etc/docker/daemon.json"`, + `/bin/bash -c "cat /etc/docker/daemon.json | jq '.dns=[\\"172.17.0.1\\"]' | sudo tee /etc/docker/daemon.json"`, ); await exec.exec("sudo systemctl restart systemd-resolved"); await exec.exec("sudo systemctl restart docker"); From 9808df24bab95220d2c6e0064e33343b86054e00 Mon Sep 17 00:00:00 2001 From: Francis Chuang Date: Mon, 11 Nov 2024 15:15:54 +1100 Subject: [PATCH 2/2] Update readme to note that `configure_docker_dns` currently only works on Linux --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e46f8b..d9ed5f8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ with: - `organization` - (required) The name of your Cloudflare Zero Trust organization. - `auth_client_id` - (required) The service token client id. - `auth_client_secret` - (required) The service token client secret. -- `configure_docker_dns` - (optional) Configure Docker to use Cloudflare WARP for DNS resolution. Defaults to `false`. +- `configure_docker_dns` - (optional) *Linux Only* Configure Docker to use Cloudflare WARP for DNS resolution. Defaults to `false`. ## Cloudflare Permissions > [!TIP]