Commit ea2b8cff authored by Sietse Ringers's avatar Sietse Ringers
Browse files

fix: irma server now respects disable_schemes_update option like the irmaserver library

parent 797ac593
...@@ -94,11 +94,14 @@ func (s *Server) verifyConfiguration(configuration *server.Configuration) error ...@@ -94,11 +94,14 @@ func (s *Server) verifyConfiguration(configuration *server.Configuration) error
return server.LogError(err) return server.LogError(err)
} }
} }
if s.conf.SchemesUpdateInterval == 0 {
s.conf.SchemesUpdateInterval = 60
}
if !s.conf.DisableSchemesUpdate { if !s.conf.DisableSchemesUpdate {
if s.conf.SchemesUpdateInterval == 0 {
s.conf.SchemesUpdateInterval = 60
}
s.conf.IrmaConfiguration.AutoUpdateSchemes(uint(s.conf.SchemesUpdateInterval)) s.conf.IrmaConfiguration.AutoUpdateSchemes(uint(s.conf.SchemesUpdateInterval))
} else {
s.conf.SchemesUpdateInterval = 0
} }
if s.conf.IssuerPrivateKeys == nil { if s.conf.IssuerPrivateKeys == nil {
......
...@@ -104,6 +104,7 @@ func setFlags(cmd *cobra.Command, production bool) error { ...@@ -104,6 +104,7 @@ func setFlags(cmd *cobra.Command, production bool) error {
flags.StringP("schemes-path", "s", schemespath, "path to irma_configuration") flags.StringP("schemes-path", "s", schemespath, "path to irma_configuration")
flags.String("schemes-assets-path", "", "if specified, copy schemes from here into --schemes-path") flags.String("schemes-assets-path", "", "if specified, copy schemes from here into --schemes-path")
flags.Int("schemes-update", 60, "update IRMA schemes every x minutes (0 to disable)") flags.Int("schemes-update", 60, "update IRMA schemes every x minutes (0 to disable)")
flags.Bool("disable-schemes-update", false, "disable IRMA scheme updating")
flags.StringP("privkeys", "k", "", "path to IRMA private keys") flags.StringP("privkeys", "k", "", "path to IRMA private keys")
flags.String("static-path", "", "Host files under this path as static files (leave empty to disable)") flags.String("static-path", "", "Host files under this path as static files (leave empty to disable)")
flags.String("static-prefix", "/", "Host static files under this URL prefix") flags.String("static-prefix", "/", "Host static files under this URL prefix")
...@@ -213,7 +214,7 @@ func configure(cmd *cobra.Command) error { ...@@ -213,7 +214,7 @@ func configure(cmd *cobra.Command) error {
SchemesPath: viper.GetString("schemes-path"), SchemesPath: viper.GetString("schemes-path"),
SchemesAssetsPath: viper.GetString("schemes-assets-path"), SchemesAssetsPath: viper.GetString("schemes-assets-path"),
SchemesUpdateInterval: viper.GetInt("schemes-update"), SchemesUpdateInterval: viper.GetInt("schemes-update"),
DisableSchemesUpdate: viper.GetInt("schemes-update") == 0, DisableSchemesUpdate: viper.GetBool("disable-schemes-update") || viper.GetInt("schemes-update") == 0,
IssuerPrivateKeysPath: viper.GetString("privkeys"), IssuerPrivateKeysPath: viper.GetString("privkeys"),
URL: viper.GetString("url"), URL: viper.GetString("url"),
DisableTLS: viper.GetBool("no-tls"), DisableTLS: viper.GetBool("no-tls"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment