From 7a9c492b619078aed6f9c3f95cf21640afd63100 Mon Sep 17 00:00:00 2001 From: feistel <6742251-feistel@users.noreply.gitlab.com> Date: Tue, 15 Jun 2021 12:09:36 +0200 Subject: Use internal-gitlab-server in auth-related tasks Update the auth package to use the internal server when fetching access token or checking for authentication. Changelog: changed --- app.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app.go') diff --git a/app.go b/app.go index 99fd2976..78c254b9 100644 --- a/app.go +++ b/app.go @@ -518,8 +518,8 @@ func runApp(config *cfg.Config) { // TODO: This if was introduced when `gitlab-server` wasn't a required parameter // once we completely remove support for legacy architecture and make it required // we can just remove this if statement https://gitlab.com/gitlab-org/gitlab-pages/-/issues/581 - if config.GitLab.Server != "" { - a.AcmeMiddleware = &acme.Middleware{GitlabURL: config.GitLab.Server} + if config.GitLab.PublicServer != "" { + a.AcmeMiddleware = &acme.Middleware{GitlabURL: config.GitLab.PublicServer} } if len(config.General.CustomHeaders) != 0 { @@ -549,9 +549,8 @@ func (a *theApp) setAuth(config *cfg.Config) { } var err error - // TODO: use config.GitLab.InternalServer https://gitlab.com/gitlab-org/gitlab-pages/-/issues/581 a.Auth, err = auth.New(config.General.Domain, config.Authentication.Secret, config.Authentication.ClientID, config.Authentication.ClientSecret, - config.Authentication.RedirectURI, config.GitLab.Server, config.Authentication.Scope) + config.Authentication.RedirectURI, config.GitLab.InternalServer, config.GitLab.PublicServer, config.Authentication.Scope) if err != nil { log.WithError(err).Fatal("could not initialize auth package") } -- cgit v1.2.3