X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/38fae0458644b89322ddeac125971800b9e452e5..b02fc7b2227e923beb4d47daee7949c94b90da5f:/services/arv-git-httpd/main.go diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go index 75645ff472..79a3eb3f7b 100644 --- a/services/arv-git-httpd/main.go +++ b/services/arv-git-httpd/main.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main import ( @@ -14,11 +18,12 @@ import ( // Server configuration type Config struct { - Client arvados.Client - Listen string - GitCommand string - RepoRoot string - GitoliteHome string + Client arvados.Client + Listen string + GitCommand string + RepoRoot string + GitoliteHome string + ManagementToken string } var theConfig = defaultConfig() @@ -44,6 +49,11 @@ func main() { "Value for GITOLITE_HTTP_HOME environment variable. If not empty, GL_BYPASS_ACCESS_CHECKS=1 will also be set."+deprecated) cfgPath := flag.String("config", defaultCfgPath, "Configuration file `path`.") + dumpConfig := flag.Bool("dump-config", false, "write current configuration to stdout and exit (useful for migrating from command line flags to config file)") + + flag.StringVar(&theConfig.ManagementToken, "management-token", theConfig.ManagementToken, + "Authorization token to be included in all health check requests.") + flag.Usage = usage flag.Parse() @@ -63,6 +73,10 @@ func main() { } } + if *dumpConfig { + log.Fatal(config.DumpAndExit(theConfig)) + } + srv := &server{} if err := srv.Start(); err != nil { log.Fatal(err)