diff --git a/.changeset/short-panthers-float.md b/.changeset/short-panthers-float.md new file mode 100644 index 0000000000..91eafe28aa --- /dev/null +++ b/.changeset/short-panthers-float.md @@ -0,0 +1,5 @@ +--- +'@techdocs/cli': patch +--- + +Adding global-agent to enable the ability to publish through a proxy diff --git a/docs/features/techdocs/cli.md b/docs/features/techdocs/cli.md index b174896d6a..76589de5a8 100644 --- a/docs/features/techdocs/cli.md +++ b/docs/features/techdocs/cli.md @@ -200,6 +200,15 @@ Options: -h, --help display help for command ``` +#### Publishing from behind a proxy + +For users attempting to publish TechDocs content behind a proxy, the TechDocs CLI leverages `global-agent` to navigate the proxy to successfully connect to that location. To enable `global-agent`, the following variables need to be set prior to running the techdocs-cli command: + +```bash +export GLOBAL_AGENT_HTTPS_PROXY=${HTTP_PROXY} +export GLOBAL_AGENT_NO_PROXY=${NO_PROXY} +``` + ### Migrate content for case-insensitive access Prior to the beta version of TechDocs (`v[0.11.0]`), TechDocs were stored in diff --git a/packages/techdocs-cli/README.md b/packages/techdocs-cli/README.md index ae296d2c26..85c0075946 100644 --- a/packages/techdocs-cli/README.md +++ b/packages/techdocs-cli/README.md @@ -40,6 +40,14 @@ yarn start yarn techdocs-cli:dev [...options] ``` +### Connecting behind a proxy + +```sh +# Prior to executing the techdocs-cli command +export GLOBAL_AGENT_HTTPS_PROXY=${HTTP_PROXY} +export GLOBAL_AGENT_NO_PROXY=${NO_PROXY} +``` + ### Using an example docs project For the purpose of local development, we have created an example documentation project. You are of course also free to create your own local test site - all it takes is a `docs/index.md` and an `mkdocs.yml` in a directory. diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index d18213d490..678c73e783 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -69,6 +69,7 @@ "commander": "^9.1.0", "dockerode": "^3.3.1", "fs-extra": "^10.0.1", + "global-agent": "^3.0.0", "http-proxy": "^1.18.1", "react-dev-utils": "^12.0.0-next.60", "serve-handler": "^6.1.3", diff --git a/yarn.lock b/yarn.lock index 1c58cace3f..ee7146e5d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13793,6 +13793,7 @@ __metadata: dockerode: ^3.3.1 find-process: ^1.4.5 fs-extra: ^10.0.1 + global-agent: ^3.0.0 http-proxy: ^1.18.1 nodemon: ^2.0.2 react-dev-utils: ^12.0.0-next.60