mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
added a feature for private repositories
This commit is contained in:
@@ -32,6 +32,7 @@ func init() {
|
||||
flags.StringVar(&restserver.Config.TLSCert, "tls-cert", restserver.Config.TLSCert, "TLS certificate path")
|
||||
flags.StringVar(&restserver.Config.TLSKey, "tls-key", restserver.Config.TLSKey, "TLS key path")
|
||||
flags.BoolVar(&restserver.Config.AppendOnly, "append-only", restserver.Config.AppendOnly, "enable append only mode")
|
||||
flags.BoolVar(&restserver.Config.PrivateRepos, "private-repos", restserver.Config.PrivateRepos, "users can only access their private repo")
|
||||
flags.BoolVar(&restserver.Config.Prometheus, "prometheus", restserver.Config.Prometheus, "enable Prometheus metrics")
|
||||
}
|
||||
|
||||
@@ -88,6 +89,12 @@ func runRoot(cmd *cobra.Command, args []string) error {
|
||||
log.Println("Authentication enabled")
|
||||
}
|
||||
|
||||
if restserver.Config.PrivateRepos {
|
||||
log.Println("Private repositories enabled")
|
||||
} else {
|
||||
log.Println("Private repositories disabled")
|
||||
}
|
||||
|
||||
enabledTLS, privateKey, publicKey, err := tlsSettings()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user