mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
Rename config.dev.toml to config-example.toml
This commit is contained in:
@@ -15,7 +15,7 @@ build-image:
|
||||
|
||||
.PHONY: run
|
||||
run:
|
||||
cd ./cmd/proxy && go run . -config_file ../../config.dev.toml
|
||||
go run ./cmd/proxy -config_file config-example.toml
|
||||
|
||||
.PHONY: docs
|
||||
docs:
|
||||
|
||||
@@ -17,7 +17,7 @@ FROM alpine
|
||||
ENV GO111MODULE=on
|
||||
|
||||
COPY --from=builder /bin/athens-proxy /bin/athens-proxy
|
||||
COPY --from=builder /go/src/github.com/gomods/athens/config.dev.toml /config/config.toml
|
||||
COPY --from=builder /go/src/github.com/gomods/athens/config-example.toml /config/config.toml
|
||||
COPY --from=builder /usr/local/go/bin/go /bin/go
|
||||
|
||||
RUN apk add --update bzr git mercurial openssh-client subversion procps fossil && \
|
||||
|
||||
@@ -11,7 +11,7 @@ The proxy supports the following three use cases
|
||||
3. Include a module in the local proxy.
|
||||
|
||||
These settings can be done by creating a configuration file which can be pointed by setting either
|
||||
`FilterFile` in `config.dev.toml` or setting `ATHENS_FILTER_FILE` as an environment variable.
|
||||
`FilterFile` in `config.toml` or setting `ATHENS_FILTER_FILE` as an environment variable.
|
||||
|
||||
### Writing the configuration file
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ This will deploy a single Athens instance in the `default` namespace with `disk`
|
||||
|
||||
### Give Athens access to private repositories via Github Token (Optional)
|
||||
1. Create a token at https://github.com/settings/tokens
|
||||
2. Provide the token to the Athens proxy either through the [config.toml](https://github.com/gomods/athens/blob/master/config.dev.toml#L111) file or by setting the `ATHENS_GITHUB_TOKEN` environment variable.
|
||||
2. Provide the token to the Athens proxy either through the [config.toml](https://github.com/gomods/athens/blob/master/config-example.toml#L111) file or by setting the `ATHENS_GITHUB_TOKEN` environment variable.
|
||||
|
||||
### Storage Providers
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ The Go community has had lots of problems with libraries disappearing or changin
|
||||
|
||||
### Logic
|
||||
|
||||
The fact that the Go command line can now ping _your own_ server to download dependencies, that means you can program whatever logic you want around providing such dependencies. Things like Access Control (discussed below), adding custom versions, custom forks, and custom packages. For example, Athens provides a [Validation Hook](https://github.com/gomods/athens/blob/master/config.dev.toml#L87) that will get called for every module download to determine whether a module should be downloaded or not. Therefore, you can extend Athens with your own logic such as scanning a module path or code for red flags etc.
|
||||
The fact that the Go command line can now ping _your own_ server to download dependencies, that means you can program whatever logic you want around providing such dependencies. Things like Access Control (discussed below), adding custom versions, custom forks, and custom packages. For example, Athens provides a [Validation Hook](https://github.com/gomods/athens/blob/master/config-example.toml#L87) that will get called for every module download to determine whether a module should be downloaded or not. Therefore, you can extend Athens with your own logic such as scanning a module path or code for red flags etc.
|
||||
|
||||
|
||||
### Performance
|
||||
@@ -34,4 +34,4 @@ Worse than packages disappearing, packages can be malicious. To make sure no suc
|
||||
|
||||
|
||||
### Vendor Directory Becomes Optional
|
||||
With immutability, performance, and a robust proxy server, there's no longer an absolute need for each repository to have its vendor directory checked in to its version control. The go.sum file ensures that no package is manipulated after the first install. Furthermore, your CI/CD can install all of your dependencies on every build with little time.
|
||||
With immutability, performance, and a robust proxy server, there's no longer an absolute need for each repository to have its vendor directory checked in to its version control. The go.sum file ensures that no package is manipulated after the first install. Furthermore, your CI/CD can install all of your dependencies on every build with little time.
|
||||
|
||||
@@ -59,7 +59,8 @@ $ mkdir -p $(go env GOPATH)/src/github.com/gomods
|
||||
$ cd $(go env GOPATH)/src/github.com/gomods
|
||||
$ git clone https://github.com/gomods/athens.git
|
||||
$ cd athens
|
||||
$ GO111MODULE=on go run ./cmd/proxy -config_file=./config.dev.toml &
|
||||
$ cp config-example.toml config.toml
|
||||
$ GO111MODULE=on go run ./cmd/proxy -config_file=./config.toml &
|
||||
[1] 25243
|
||||
INFO[0000] Starting application at 127.0.0.1:3000
|
||||
```
|
||||
@@ -70,8 +71,9 @@ $ mkdir "$(go env GOPATH)\src\github.com\gomods"
|
||||
$ cd "$(go env GOPATH)\src\github.com\gomods"
|
||||
$ git clone https://github.com/gomods/athens.git
|
||||
$ cd athens
|
||||
$ cp config-example.toml config.toml
|
||||
$ $env:GO111MODULE = "on"
|
||||
$ Start-Process -NoNewWindow go 'run -mod=vendor .\cmd\proxy -config_file=".\config.dev.toml"'
|
||||
$ Start-Process -NoNewWindow go 'run -mod=vendor .\cmd\proxy -config_file=".\config.toml"'
|
||||
[1] 25243
|
||||
INFO[0000] Starting application at 127.0.0.1:3000
|
||||
```
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func testConfigFile(t *testing.T) (testConfigFile string) {
|
||||
testConfigFile = filepath.Join("..", "..", "config.dev.toml")
|
||||
testConfigFile = filepath.Join("..", "..", "config-example.toml")
|
||||
if err := os.Chmod(testConfigFile, 0700); err != nil {
|
||||
t.Fatalf("%s\n", err)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
testConfigPath = filepath.Join("..", "..", "config.dev.toml")
|
||||
testConfigPath = filepath.Join("..", "..", "config-example.toml")
|
||||
)
|
||||
|
||||
func getDP(t *testing.T) Protocol {
|
||||
|
||||
@@ -23,7 +23,7 @@ const (
|
||||
)
|
||||
|
||||
func testConfigFile(t *testing.T) (testConfigFile string) {
|
||||
testConfigFile = filepath.Join("..", "..", "config.dev.toml")
|
||||
testConfigFile = filepath.Join("..", "..", "config-example.toml")
|
||||
if err := os.Chmod(testConfigFile, 0700); err != nil {
|
||||
t.Fatalf("%s\n", err)
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ func (m *ModuleStore) newSession(timeout time.Duration, insecure bool, conf *con
|
||||
}
|
||||
|
||||
if m.certPath != "" {
|
||||
// Sets only when the env var is setup in config.dev.toml
|
||||
// Sets only when the env var is setup in config.toml
|
||||
tlsConfig.InsecureSkipVerify = insecure
|
||||
var roots *x509.CertPool
|
||||
// See if there is a system cert pool
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$repoDir = Join-Path $PSScriptRoot ".." | Join-Path -ChildPath ".."
|
||||
if (-not (Join-Path $repoDir config.toml | Test-Path)) {
|
||||
$example = Join-Path $repoDir config.dev.toml
|
||||
$example = Join-Path $repoDir config-example.toml
|
||||
$target = Join-Path $repoDir config.toml
|
||||
Copy-Item $example $target
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user