diff --git a/cmd/olympus/actions/actions_test.go b/cmd/olympus/actions/actions_test.go index 5d102380..557b8e2c 100644 --- a/cmd/olympus/actions/actions_test.go +++ b/cmd/olympus/actions/actions_test.go @@ -15,7 +15,7 @@ import ( ) var ( - testConfigFile = filepath.Join("..", "..", "..", "config.test.toml") + testConfigFile = filepath.Join("..", "..", "..", "config.dev.toml") ) type ActionSuite struct { diff --git a/cmd/proxy/Dockerfile b/cmd/proxy/Dockerfile index efdc80a2..2e1f971a 100644 --- a/cmd/proxy/Dockerfile +++ b/cmd/proxy/Dockerfile @@ -18,7 +18,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.example.toml /config/config.toml +COPY --from=builder /go/src/github.com/gomods/athens/config.dev.toml /config/config.toml COPY --from=builder /go/src/github.com/gomods/athens/cmd/proxy/locales /go/src/github.com/gomods/athens/cmd/proxy/locales COPY --from=builder /go/src/github.com/gomods/athens/cmd/proxy/assets /go/src/github.com/gomods/athens/cmd/proxy/assets COPY --from=builder /usr/local/go/bin/go /bin/go diff --git a/cmd/proxy/actions/actions_test.go b/cmd/proxy/actions/actions_test.go index 71eb1a2e..c1a1404c 100644 --- a/cmd/proxy/actions/actions_test.go +++ b/cmd/proxy/actions/actions_test.go @@ -9,7 +9,7 @@ import ( ) var ( - testConfigFile = filepath.Join("..", "..", "..", "config.test.toml") + testConfigFile = filepath.Join("..", "..", "..", "config.dev.toml") ) type ActionSuite struct { diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 4d1f1109..953c5186 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -10,7 +10,7 @@ import ( ) var ( - configFile = flag.String("config_file", filepath.Join("..", "..", "config.example.toml"), "The path to the config file") + configFile = flag.String("config_file", filepath.Join("..", "..", "config.dev.toml"), "The path to the config file") ) func main() { diff --git a/config.example.toml b/config.dev.toml similarity index 100% rename from config.example.toml rename to config.dev.toml diff --git a/config.test.toml b/config.test.toml deleted file mode 100644 index 663ff9f3..00000000 --- a/config.test.toml +++ /dev/null @@ -1,194 +0,0 @@ -# This is an example configuration with all supported properties explicitly set -# Most properties can be overriden with environment variables specified in this file -# Most properties also have defaults (mentioned in this file) if they are not set in either the config file or the corresponding environment variable - -# GoBinary returns the path to the go binary to use. This value can be a name of a binary in your PATH, or the full path -# Defaults to "go" -# Env override: GO_BINARY_PATH -GoBinary = "go" - -# GoEnv specifies the type of environment to run. -# Supported values are: 'development' and 'production'. Defaults to "development" -# Env override: GO_ENV -GoEnv = "development" - -# GoGetWorkers specifies how many times you can concurrently -# go mod download, this is so that low performance instances -# can manage go get more sanely and not run out of disk or memory. -# Env override: ATHENS_GOGET_WORKERS -GoGetWorkers = 30 - -# ProtocolWorkers specifies how many concurrent -# requests can you handle at a time for all -# download protocol paths. This is different from -# GoGetWorkers in that you can potentially serve -# 30 requests to the Download Protocol but only 5 -# at a time can stash a module from Upstream to Storage. -# Env override: ATHENS_PROTOCOL_WORKERS -ProtocolWorkers = 30 - -# LogLevel returns the system's exposure to internal logs. Defaults to debug. -# Supports all logrus log levels (https://github.com/Sirupsen/logrus#level-logging) -# Env override: ATHENS_LOG_LEVEL -LogLevel = "debug" - -# BuffaloLogLevel returns the log level for logs -# emitted by Buffalo itself. This is different from our own -# LogLevel in this file because you might want info level -# for our codebase, but panic level for buffalo. -# Env override: BUFFALO_LOG_LEVEL -BuffaloLogLevel = "debug" - -# CloudRuntime is the Cloud Provider on which the Proxy/Registry is running. -# Currently available options are "GCP", or "none". Defaults to "none" -# Env override: ATHENS_CLOUD_RUNTIME -CloudRuntime = "none" - -# MaxConcurrency sets maximum level of concurrency -# Defaults to number of cores if not specified. -# Env override: ATHENS_MAX_CONCURRENCY -MaxConcurrency = 4 - -# The maximum number of failures for jobs submitted to buffalo workers -# Defaults to 5. -# Env override: ATHENS_MAX_WORKER_FAILS -MaxWorkerFails = 5 - -# The filename for the include exclude filter. Defaults to 'filter.conf' -# Env override: ATHENS_FILTER_FILE -FilterFile = "filter.conf" - -# Timeout is the timeout for external network calls in seconds -# This value is used as the default for storage backends if they don't specify timeouts -# Defaults to 300 -# Env override: ATHENS_TIMEOUT -Timeout = 300 - -# EnableCSRFProtection determines whether to enable CSRF protection. -# Defaults to false -# Env override: ATHENS_ENABLE_CSRF_PROTECTION -EnableCSRFProtection = false - - -[Proxy] - # StorageType sets the type of storage backend the proxy will use. - # Possible values are memory, disk, mongo, postgres, sqlite, cockroach, mysql - # Defaults to mongo - # Env override: ATHENS_STORAGE_TYPE - StorageType = "memory" - # Port sets the port the proxy listens on - # Env override: PORT - Port = ":3000" - # The endpoint for Olympus in case of a proxy cache miss - # Env override: OLYMPUS_GLOBAL_ENDPOINT - OlympusGlobalEndpoint = "http://localhost:3001" - # Redis queue for buffalo workers - # Defaults to ":6379" - # Env override: ATHENS_REDIS_QUEUE_ADDRESS - RedisQueueAddress = ":6379" - # Flag to turn off Proxy Filter middleware - # Defaults to true - # Env override: PROXY_FILTER_OFF - FilterOff = true - # Username for basic auth - # Env override: BASIC_AUTH_USER - BasicAuthUser = "" - # Password for basic auth - # Env override: BASIC_AUTH_PASS - BasicAuthPass = "" - # Set to true to force an SSL redirect - # Env override: PROXY_FORCE_SSL - ForceSSL = false - # ValidatorHook specifies the endpoint to validate modules against - # Not used if left blank or not specified - # Env override: ATHENS_PROXY_VALIDATOR - ValidatorHook = "" - # PathPrefix specifies whether the Proxy - # should have a basepath. Certain proxies and services - # are distinguished based on subdomain, while others are based - # on path prefixes. - # Env override: ATHENS_PATH_PREFIX - PathPrefix = "" - - # NETRCPath tells you where the .netrc path initially resides. - # This is so that you can mount the .netrc file to a secret location - # in the fs system and then move it ~/.netrc. In certain deployments - # like Kubernetes, we can't mount directly to ~ because it would then - # clean out whatever is already there as part of the image (such as - # .cache directory in the Go image). - # Env override: ATHENS_NETRC_PATH - NETRCPath = "" - -[Olympus] - # StorageType sets the type of storage backend Olympus will use. - # Possible values are memory, disk, mongo, postgres, sqlite, cockroach, mysql - # Defaults to memory - # Env override: ATHENS_STORAGE_TYPE - StorageType = "memory" - # Port sets the port olympus listens on - # Env override: PORT - Port = ":3001" - # Background worker type. Possible values are memory and redis - # Defaults to redis - # Env override: OLYMPUS_BACKGROUND_WORKER_TYPE - WorkerType = "redis" - # Redis queue for buffalo workers - # Defaults to ":6379" - # Env override: OLYMPUS_REDIS_QUEUE_ADDRESS - RedisQueueAddress = ":6379" - -[Storage] - # Only storage backends that are specified in Proxy.StorageType or Olympus.StorageType are required here - [Storage.CDN] - # Endpoint for CDN storage - # Env override: CDN_ENDPOINT - Endpoint = "cdn.example.com" - # Timeout for networks calls made to the CDN in seconds - # Defaults to Global Timeout - Timeout = 300 - [Storage.Disk] - # RootPath is the Athens Disk Root folder - # Env override: ATHENS_DISK_STORAGE_ROOT - RootPath = "/path/on/disk" - [Storage.GCP] - # ProjectID to use for GCP Storage - # Env overide: GOOGLE_CLOUD_PROJECT - ProjectID = "MY_GCP_PROJECT_ID" - # Bucket to use for GCP Storage - # Env override: ATHENS_STORAGE_GCP_BUCKET - Bucket = "MY_GCP_BUCKET" - # Timeout for networks calls made to GCP in seconds - # Defaults to Global Timeout - Timeout = 300 - [Storage.Minio] - # Endpoint for Minio storage - # Env override: ATHENS_MINIO_ENDPOINT - Endpoint = "127.0.0.1:9001" - # Access Key for Minio storage - # Env override: ATHENS_MINIO_ACCESS_KEY_ID - Key = "minio" - # Secret Key for Minio storage - # Env override: ATHENS_MINIO_SECRET_ACCESS_KEY - Secret = "minio123" - # Timeout for networks calls made to Minio in seconds - # Defaults to Global Timeout - Timeout = 300 - # Enable SSL for Minio connections - # Defaults to true - # Env override: ATHENS_MINIO_USE_SSL - EnableSSL = false - # Minio Bucket to use for storage - # Defaults to gomods - # Env override: ATHENS_MINIO_BUCKET_NAME - Bucket = "gomods" - [Storage.Mongo] - # Full URL for mongo storage - # Env override: ATHENS_MONGO_STORAGE_URL - URL = "mongodb://127.0.0.1:27017" - # Path to certificate to use for the mongo connection - # Env override: ATHENS_MONGO_CERT_PATH - CertPath = "" - # Timeout for networks calls made to Mongo in seconds - # Defaults to Global Timeout - # Env override: MONGO_CONN_TIMEOUT_SEC - Timeout = 300 diff --git a/docs/content/walkthrough.md b/docs/content/walkthrough.md index bf97e942..a6107aba 100644 --- a/docs/content/walkthrough.md +++ b/docs/content/walkthrough.md @@ -59,7 +59,7 @@ $ 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=off go run ./cmd/proxy -config_file=config.example.toml & +$ GO111MODULE=off go run ./cmd/proxy -config_file=config.dev.toml & [1] 25243 INFO[0000] Starting application at 127.0.0.1:3000 ``` @@ -73,7 +73,7 @@ $ cd "$(go env GOPATH)\src\github.com\gomods" $ git clone https://github.com/gomods/athens.git $ cd athens $ $env:GO111MODULE = "off" -$ Start-Process -NoNewWindow go "run .\cmd\proxy -config_file=config.example.toml" +$ Start-Process -NoNewWindow go "run .\cmd\proxy -config_file=config.dev.toml" [1] 25243 INFO[0000] Starting application at 127.0.0.1:3000 ``` diff --git a/pkg/config/parse_test.go b/pkg/config/parse_test.go index 3da31f6d..661157b8 100644 --- a/pkg/config/parse_test.go +++ b/pkg/config/parse_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" ) -const exampleConfigPath = "../../config.example.toml" +const exampleConfigPath = "../../config.dev.toml" func compareConfigs(parsedConf *Config, expConf *Config, t *testing.T) { opts := cmpopts.IgnoreTypes(StorageConfig{}, ProxyConfig{}, OlympusConfig{}) diff --git a/pkg/download/protocol_test.go b/pkg/download/protocol_test.go index 268c0053..a03d6da7 100644 --- a/pkg/download/protocol_test.go +++ b/pkg/download/protocol_test.go @@ -22,7 +22,7 @@ import ( ) var ( - testConfigPath = filepath.Join("..", "..", "config.test.toml") + testConfigPath = filepath.Join("..", "..", "config.dev.toml") ) func getDP(t *testing.T) Protocol { diff --git a/pkg/middleware/middleware_test.go b/pkg/middleware/middleware_test.go index 3f69f546..f58100b8 100644 --- a/pkg/middleware/middleware_test.go +++ b/pkg/middleware/middleware_test.go @@ -25,7 +25,7 @@ const ( ) var ( - testConfigFile = filepath.Join("..", "..", "config.test.toml") + testConfigFile = filepath.Join("..", "..", "config.dev.toml") ) func middlewareFilterApp(filterFile, olympusEndpoint string) *buffalo.App { diff --git a/pkg/module/filter_test.go b/pkg/module/filter_test.go index 754e44a2..7c81bdcc 100644 --- a/pkg/module/filter_test.go +++ b/pkg/module/filter_test.go @@ -9,7 +9,7 @@ import ( ) var ( - testConfigFile = filepath.Join("..", "..", "config.test.toml") + testConfigFile = filepath.Join("..", "..", "config.dev.toml") ) type FilterTests struct { diff --git a/pkg/storage/mongo/local_test.go b/pkg/storage/mongo/local_test.go index 4cc47919..9f4f65fe 100644 --- a/pkg/storage/mongo/local_test.go +++ b/pkg/storage/mongo/local_test.go @@ -9,7 +9,7 @@ import ( ) var ( - testConfigFile = filepath.Join("..", "..", "..", "config.test.toml") + testConfigFile = filepath.Join("..", "..", "..", "config.dev.toml") ) type MongoTests struct { diff --git a/pkg/storage/s3/all_test.go b/pkg/storage/s3/all_test.go index 6351f20e..714382c9 100644 --- a/pkg/storage/s3/all_test.go +++ b/pkg/storage/s3/all_test.go @@ -10,7 +10,7 @@ import ( ) var ( - testConfigFile = filepath.Join("..", "..", "..", "config.test.toml") + testConfigFile = filepath.Join("..", "..", "..", "config.dev.toml") ) type S3Tests struct { diff --git a/pkg/storage/storage_tests/module_storage/storage_test.go b/pkg/storage/storage_tests/module_storage/storage_test.go index e402da0f..efd61ae4 100644 --- a/pkg/storage/storage_tests/module_storage/storage_test.go +++ b/pkg/storage/storage_tests/module_storage/storage_test.go @@ -27,7 +27,7 @@ import ( ) var ( - testConfigFile = filepath.Join("..", "..", "..", "..", "config.test.toml") + testConfigFile = filepath.Join("..", "..", "..", "..", "config.dev.toml") ) type TestSuites struct { diff --git a/scripts/create_default_config.sh b/scripts/create_default_config.sh index 0510ac87..1fd8b188 100755 --- a/scripts/create_default_config.sh +++ b/scripts/create_default_config.sh @@ -3,5 +3,5 @@ SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" if [ ! -e "${SCRIPTS_DIR}/../config.toml" ] ; then - cp "${SCRIPTS_DIR}/../config.test.toml" "${SCRIPTS_DIR}/../config.toml" + cp "${SCRIPTS_DIR}/../config.dev.toml" "${SCRIPTS_DIR}/../config.toml" fi diff --git a/scripts/ps/create_default_config.ps1 b/scripts/ps/create_default_config.ps1 index f2ac8879..df3af589 100644 --- a/scripts/ps/create_default_config.ps1 +++ b/scripts/ps/create_default_config.ps1 @@ -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.test.toml + $example = Join-Path $repoDir config.dev.toml $target = Join-Path $repoDir config.toml Copy-Item $example $target } \ No newline at end of file