mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-03 18:38:29 +02:00
Add option to disable version checking (#520)
Fixes "Only signed in user is allowed to call APIs." as the /api/v1/version returns a 403 when running a gitea where REQUIRE_SIGNIN_VIEW is enabled Co-authored-by: Wim <wim@42.be> Reviewed-on: https://gitea.com/gitea/tea/pulls/520 Reviewed-by: 6543 <6543@obermui.de> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Wim <42wim@noreply.gitea.io> Co-committed-by: Wim <42wim@noreply.gitea.io>
This commit is contained in:
@ -16,9 +16,12 @@ import (
|
||||
|
||||
// CreateLogin create an login interactive
|
||||
func CreateLogin() error {
|
||||
var name, token, user, passwd, sshKey, giteaURL, sshCertPrincipal, sshKeyFingerprint string
|
||||
var insecure = false
|
||||
var sshAgent = false
|
||||
var (
|
||||
name, token, user, passwd, sshKey, giteaURL, sshCertPrincipal, sshKeyFingerprint string
|
||||
insecure, sshAgent, versionCheck bool
|
||||
)
|
||||
|
||||
versionCheck = true
|
||||
|
||||
promptI := &survey.Input{Message: "URL of Gitea instance: "}
|
||||
if err := survey.AskOne(promptI, &giteaURL, survey.WithValidator(survey.Required)); err != nil {
|
||||
@ -128,7 +131,16 @@ func CreateLogin() error {
|
||||
if err = survey.AskOne(promptYN, &insecure); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
promptYN = &survey.Confirm{
|
||||
Message: "Check version of Gitea instance: ",
|
||||
Default: true,
|
||||
}
|
||||
if err = survey.AskOne(promptYN, &versionCheck); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return task.CreateLogin(name, token, user, passwd, sshKey, giteaURL, sshCertPrincipal, sshKeyFingerprint, insecure, sshAgent)
|
||||
return task.CreateLogin(name, token, user, passwd, sshKey, giteaURL, sshCertPrincipal, sshKeyFingerprint, insecure, sshAgent, versionCheck)
|
||||
}
|
||||
|
Reference in New Issue
Block a user