diff options
author | Igor Wiedler <iwiedler@gitlab.com> | 2020-04-30 11:46:28 +0300 |
---|---|---|
committer | Igor Wiedler <iwiedler@gitlab.com> | 2020-04-30 11:46:28 +0300 |
commit | 333138397f79ae4857abd775804359cbbf23aeac (patch) | |
tree | 2e7cdcc0c635fcba96fa5d276c3fdabe06520050 | |
parent | 245060539bcca5e6d52f38bee1c9d23a516911d3 (diff) |
rename internal-gitlab-server to gitlab-api-server (as per @@krasio)
-rw-r--r-- | app_config.go | 4 | ||||
-rw-r--r-- | internal/source/gitlab/client/client.go | 2 | ||||
-rw-r--r-- | main.go | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/app_config.go b/app_config.go index 44e37f13..06679892 100644 --- a/app_config.go +++ b/app_config.go @@ -29,7 +29,7 @@ type appConfig struct { StoreSecret string GitLabServer string - InternalGitLabServer string + GitLabAPIServer string GitLabAPISecretKey []byte GitlabClientHTTPTimeout time.Duration GitlabJWTTokenExpiration time.Duration @@ -43,7 +43,7 @@ type appConfig struct { // GitlabServerURL returns URL to a GitLab instance. func (config appConfig) GitlabServerURL() string { - return config.InternalGitLabServer + return config.GitLabAPIServer } // GitlabClientSecret returns GitLab server access token. diff --git a/internal/source/gitlab/client/client.go b/internal/source/gitlab/client/client.go index 9a5affa2..bea2e836 100644 --- a/internal/source/gitlab/client/client.go +++ b/internal/source/gitlab/client/client.go @@ -27,7 +27,7 @@ type Client struct { } // NewClient initializes and returns new Client baseUrl is -// appConfig.InternalGitLabServer secretKey is appConfig.GitLabAPISecretKey +// appConfig.GitLabAPIServer secretKey is appConfig.GitLabAPISecretKey func NewClient(baseURL string, secretKey []byte, connectionTimeout, jwtTokenExpiry time.Duration) (*Client, error) { if len(baseURL) == 0 || len(secretKey) == 0 { return nil, errors.New("GitLab API URL or API secret has not been provided") @@ -61,7 +61,7 @@ var ( secret = flag.String("auth-secret", "", "Cookie store hash key, should be at least 32 bytes long.") gitLabAuthServer = flag.String("auth-server", "", "DEPRECATED, use gitlab-server instead. GitLab server, for example https://www.gitlab.com") gitLabServer = flag.String("gitlab-server", "", "GitLab server, for example https://www.gitlab.com") - internalGitLabServer = flag.String("internal-gitlab-server", "", "Internal GitLab server for API requests, for example https://www.gitlab.com (defaults to value of gitlab-server)") + gitLabAPIServer = flag.String("gitlab-api-server", "", "GitLab server used for API requests, for example https://www.gitlab.com, useful if you want to send that traffic over an internal load balancer (defaults to value of gitlab-server)") gitLabAPISecretKey = flag.String("api-secret-key", "", "File with secret key used to authenticate with the GitLab API") gitlabClientHTTPTimeout = flag.Duration("gitlab-client-http-timeout", 10*time.Second, "GitLab API HTTP client connection timeout in seconds (default: 10s)") gitlabClientJWTExpiry = flag.Duration("gitlab-client-jwt-expiry", 30*time.Second, "JWT Token expiry time in seconds (default: 30s)") @@ -108,9 +108,9 @@ func gitlabServerFromFlags() string { return host.FromString(url.Host) } -func internalGitlabServerFromFlags() string { - if *internalGitLabServer != "" { - return *internalGitLabServer +func gitlabAPIServerFromFlags() string { + if *gitLabAPIServer != "" { + return *gitLabAPIServer } return gitlabServerFromFlags() @@ -190,7 +190,7 @@ func configFromFlags() appConfig { } config.GitLabServer = gitlabServerFromFlags() - config.InternalGitLabServer = internalGitlabServerFromFlags() + config.GitLabAPIServer = gitlabAPIServerFromFlags() config.GitlabClientHTTPTimeout = *gitlabClientHTTPTimeout config.GitlabJWTTokenExpiration = *gitlabClientJWTExpiry config.StoreSecret = *secret @@ -275,7 +275,7 @@ func loadConfig() appConfig { "tls-max-version": *tlsMaxVersion, "use-http-2": config.HTTP2, "gitlab-server": config.GitLabServer, - "internal-gitlab-server": config.InternalGitLabServer, + "gitlab-api-server": config.GitLabAPIServer, "api-secret-key": *gitLabAPISecretKey, "auth-redirect-uri": config.RedirectURI, }).Debug("Start daemon with configuration") |