X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/71229e23918b698caa7c6c8b62b368d4aef2ab85..35568d227889ca85026c647d57144fee1306bc87:/services/arv-git-httpd/main.go diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go index 3ff155714c..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 ( @@ -10,16 +14,16 @@ import ( "git.curoverse.com/arvados.git/sdk/go/arvados" "git.curoverse.com/arvados.git/sdk/go/config" "github.com/coreos/go-systemd/daemon" - "github.com/ghodss/yaml" ) // 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() @@ -46,6 +50,10 @@ func main() { 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() @@ -66,12 +74,7 @@ func main() { } if *dumpConfig { - y, err := yaml.Marshal(theConfig) - if err != nil { - log.Fatal(err) - } - os.Stdout.Write(y) - os.Exit(0) + log.Fatal(config.DumpAndExit(theConfig)) } srv := &server{}