From fdf53dd4beb3e399261994754fc4b34986724856 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 27 Oct 2021 15:28:41 +0800 Subject: [PATCH] Remove OAuth2ServerURL --- README.md | 2 +- config.example.yaml | 1 - pkgs/settings/settings.go | 5 +---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4edae5b..4ebd84b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PR-Deployer help Gitea to run some PR as a gitea instance for easier testing. Since sometiems we need to check if the PR is like what expected in the UI and don't -want to run it locally, We can deployer the PR as a service as https://try-pr-.gitea.io. +want to run it locally, We can deployer the PR as a service as https://try-pr-{index}.gitea.io. If the process is almost automatically, it will help all contributors. The project aims to do that. It will allow the users who has write permission to diff --git a/config.example.yaml b/config.example.yaml index 853ce30..f26d890 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -1,7 +1,6 @@ ServiceType: github RepoURL: https://github.com/go-gitea/gitea OAuth2: - ServerURL: https://github.com ClientID: xxxxxx ClientSecret: xxxxxxxx CallbackURL: http://localhost:3001 diff --git a/pkgs/settings/settings.go b/pkgs/settings/settings.go index 591f0a7..a54f4ab 100644 --- a/pkgs/settings/settings.go +++ b/pkgs/settings/settings.go @@ -76,10 +76,7 @@ func Init() error { if OAuth2CallbackURL == "" { return errors.New("OAuth2CallbackURL cannot be empty") } - OAuth2ServerURL = viper.GetString("OAuth2.ServerURL") - if OAuth2ServerURL == "" { - return errors.New("OAuth2ServerURL cannot be empty") - } + OAuth2ServerURL = BaseURL OAuth2ClientID = viper.GetString("OAuth2.ClientID") if OAuth2ClientID == "" {