summaryrefslogtreecommitdiffstats
path: root/cmd/admin.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-04-29 19:08:21 +0100
committertechknowlogick <techknowlogick@gitea.io>2019-04-29 14:08:21 -0400
commit8d0d7bc28d517acc9ca98f0468d7ff2a4fdaf139 (patch)
tree0a8817abd2512ca2ebccfd4e5dc08814933aad2b /cmd/admin.go
parentccf4783980effa871abaecd70d0f983c5062a187 (diff)
downloadgitea-8d0d7bc28d517acc9ca98f0468d7ff2a4fdaf139.tar.gz
gitea-8d0d7bc28d517acc9ca98f0468d7ff2a4fdaf139.zip
Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631)
Diffstat (limited to 'cmd/admin.go')
-rw-r--r--cmd/admin.go76
1 files changed, 0 insertions, 76 deletions
diff --git a/cmd/admin.go b/cmd/admin.go
index b46eb2871e..be21ec0f36 100644
--- a/cmd/admin.go
+++ b/cmd/admin.go
@@ -60,11 +60,6 @@ var (
Name: "admin",
Usage: "User is an admin",
},
- cli.StringFlag{
- Name: "config, c",
- Value: "custom/conf/app.ini",
- Usage: "Custom configuration file path",
- },
cli.BoolFlag{
Name: "random-password",
Usage: "Generate a random password for the user",
@@ -96,11 +91,6 @@ var (
Value: "",
Usage: "New password to set for user",
},
- cli.StringFlag{
- Name: "config, c",
- Value: "custom/conf/app.ini",
- Usage: "Custom configuration file path",
- },
},
}
@@ -123,26 +113,12 @@ var (
Name: "hooks",
Usage: "Regenerate git-hooks",
Action: runRegenerateHooks,
- Flags: []cli.Flag{
- cli.StringFlag{
- Name: "config, c",
- Value: "custom/conf/app.ini",
- Usage: "Custom configuration file path",
- },
- },
}
microcmdRegenKeys = cli.Command{
Name: "keys",
Usage: "Regenerate authorized_keys file",
Action: runRegenerateKeys,
- Flags: []cli.Flag{
- cli.StringFlag{
- Name: "config, c",
- Value: "custom/conf/app.ini",
- Usage: "Custom configuration file path",
- },
- },
}
subcmdAuth = cli.Command{
@@ -160,13 +136,6 @@ var (
Name: "list",
Usage: "List auth sources",
Action: runListAuth,
- Flags: []cli.Flag{
- cli.StringFlag{
- Name: "config, c",
- Value: "custom/conf/app.ini",
- Usage: "Custom configuration file path",
- },
- },
}
idFlag = cli.Int64Flag{
@@ -178,23 +147,10 @@ var (
Name: "delete",
Usage: "Delete specific auth source",
Action: runDeleteAuth,
- Flags: []cli.Flag{
- cli.StringFlag{
- Name: "config, c",
- Value: "custom/conf/app.ini",
- Usage: "Custom configuration file path",
- },
- idFlag,
- },
}
oauthCLIFlags = []cli.Flag{
cli.StringFlag{
- Name: "config, c",
- Value: "custom/conf/app.ini",
- Usage: "Custom configuration file path",
- },
- cli.StringFlag{
Name: "name",
Value: "",
Usage: "Application Name",
@@ -266,10 +222,6 @@ func runChangePassword(c *cli.Context) error {
return err
}
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if err := initDB(); err != nil {
return err
}
@@ -331,10 +283,6 @@ func runCreateUser(c *cli.Context) error {
return errors.New("must set either password or random-password flag")
}
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if err := initDB(); err != nil {
return err
}
@@ -430,10 +378,6 @@ func getReleaseCount(id int64) (int64, error) {
}
func runRegenerateHooks(c *cli.Context) error {
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if err := initDB(); err != nil {
return err
}
@@ -441,10 +385,6 @@ func runRegenerateHooks(c *cli.Context) error {
}
func runRegenerateKeys(c *cli.Context) error {
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if err := initDB(); err != nil {
return err
}
@@ -473,10 +413,6 @@ func parseOAuth2Config(c *cli.Context) *models.OAuth2Config {
}
func runAddOauth(c *cli.Context) error {
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if err := initDB(); err != nil {
return err
}
@@ -490,10 +426,6 @@ func runAddOauth(c *cli.Context) error {
}
func runUpdateOauth(c *cli.Context) error {
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if !c.IsSet("id") {
return fmt.Errorf("--id flag is missing")
}
@@ -561,10 +493,6 @@ func runUpdateOauth(c *cli.Context) error {
}
func runListAuth(c *cli.Context) error {
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if err := initDB(); err != nil {
return err
}
@@ -587,10 +515,6 @@ func runListAuth(c *cli.Context) error {
}
func runDeleteAuth(c *cli.Context) error {
- if c.IsSet("config") {
- setting.CustomConf = c.String("config")
- }
-
if !c.IsSet("id") {
return fmt.Errorf("--id flag is missing")
}