summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorDaniil Pankratov <mobigod0@gmail.com>2020-12-28 11:39:12 +0300
committerGitHub <noreply@github.com>2020-12-28 09:39:12 +0100
commit3175d08626232e85df64bec95fa62aac227e252a (patch)
tree8f2c2e3e7abc122c450b5add750dc4a07596c2d3 /cmd
parentd75f011345efe6625cd39467899e3f0639581499 (diff)
downloadgitea-3175d08626232e85df64bec95fa62aac227e252a.tar.gz
gitea-3175d08626232e85df64bec95fa62aac227e252a.zip
CLI support for OAuth sources custom icons (#14166)
Co-authored-by: Daniil Pankratov <daniil.pankratov@t-systems.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/admin.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/admin.go b/cmd/admin.go
index 25faaae188..b4e0c3cb5e 100644
--- a/cmd/admin.go
+++ b/cmd/admin.go
@@ -282,6 +282,11 @@ var (
Value: "",
Usage: "Use a custom Email URL (option for GitHub)",
},
+ cli.StringFlag{
+ Name: "icon-url",
+ Value: "",
+ Usage: "Custom icon URL for OAuth2 login source",
+ },
}
microcmdAuthUpdateOauth = cli.Command{
@@ -606,6 +611,7 @@ func parseOAuth2Config(c *cli.Context) *models.OAuth2Config {
ClientSecret: c.String("secret"),
OpenIDConnectAutoDiscoveryURL: c.String("auto-discover-url"),
CustomURLMapping: customURLMapping,
+ IconURL: c.String("icon-url"),
}
}
@@ -658,6 +664,10 @@ func runUpdateOauth(c *cli.Context) error {
oAuth2Config.OpenIDConnectAutoDiscoveryURL = c.String("auto-discover-url")
}
+ if c.IsSet("icon-url") {
+ oAuth2Config.IconURL = c.String("icon-url")
+ }
+
// update custom URL mapping
var customURLMapping = &oauth2.CustomURLMapping{}