diff --git a/config.dev.toml b/config.dev.toml index b48663b4..593a08c7 100755 --- a/config.dev.toml +++ b/config.dev.toml @@ -42,6 +42,11 @@ CloudRuntime = "none" # The filename for the include exclude filter. # Env override: ATHENS_FILTER_FILE +# +# To point Athens to an upstream proxy to fetch modules, +# set GlobalEndpoint to "https://" +# and also ensure that FilterFile is set to a fully qualified file name +# that contains the letter `D` (for "Direct Access") in the first line. FilterFile = "" # Timeout is the timeout for external network calls in seconds @@ -70,6 +75,11 @@ Port = ":3000" # The endpoint for a package registry in case of a proxy cache miss # NOTE: Currently no registries have been implemented # Env override: ATHENS_GLOBAL_ENDPOINT +# +# To point Athens to an upstream proxy to fetch modules, +# set GlobalEndpoint to "https://" +# and also ensure that FilterFile is set to a fully qualified file name +# that contains the letter `D` (for "Direct Access") in the first line. GlobalEndpoint = "http://localhost:3001" # BASIC AUTH OPTIONS diff --git a/docs/content/configuration/_index.md b/docs/content/configuration/_index.md index fcaa5a2e..aa1302ea 100644 --- a/docs/content/configuration/_index.md +++ b/docs/content/configuration/_index.md @@ -16,3 +16,9 @@ There are numerous version control systems available to us as developers. In th In Athens we support many storage options. In this section we'll describe how they can be configured - [Storage](/configuration/storage) + + + ### Upstream proxy + In this section we'll describe how the upstream proxy can be configured to fetch all modules from a Go Modules Repository such as [GoCenter](https://gocenter.io) or another Athens Server. + + - [Upstream](/configuration/upstream) diff --git a/docs/content/configuration/upstream.md b/docs/content/configuration/upstream.md new file mode 100644 index 00000000..85b152ae --- /dev/null +++ b/docs/content/configuration/upstream.md @@ -0,0 +1,28 @@ +--- +title: Configuring Upstream Proxy to use an Upstream Go Modules Repository +description: How to Configure Athens to Fetch Missing Modules From an Upstream Module Repository Like GoCenter, or Another Athens Server +weight: 1 +--- + +By default, Athens fetches module code from an upstream VCS like github.com, but this can be configured to use a Go modules repository like GoCenter or another Athens Server. + +1. Create a filter file (e.g ```/usr/local/lib/FilterForGoCenter```) with letter `D` (stands for "direct access") in first line. For more details, please refer to documentation on - [Filtering Modules](/configuration/filter) + + ``` + # FilterFile for fetching modules directly from upstream + D + ``` +1. If you are not using a config file, create a new config file (based on the sample config.dev.toml) and edit values to match your environment). +Additionally in the current or new config file, set the following parameters as suggested: + + ``` + FilterFile = "/usr/local/lib/FilterForGoCenter" + GlobalEndpoint = "https://" + # To use GoCenter for example, replace with gocenter.io + ``` +1. Restart Athens specifying the updated current or new config file. + + ``` + /proxy -config_file + ``` +1. Verify the new configuration using the steps mentioned in ("Try out Athens" document)[/try-out], and go through the same walkthrough example.