mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Fix config registration in api and random
This commit is contained in:
parent
2a1681792d
commit
272e5b926a
2 changed files with 11 additions and 5 deletions
|
@ -37,8 +37,9 @@ func registerConfig() error {
|
||||||
Name: "API Address",
|
Name: "API Address",
|
||||||
Key: "api/listenAddress",
|
Key: "api/listenAddress",
|
||||||
Description: "Define on which IP and port the API should listen on.",
|
Description: "Define on which IP and port the API should listen on.",
|
||||||
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
|
||||||
OptType: config.OptTypeString,
|
OptType: config.OptTypeString,
|
||||||
|
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
||||||
|
ReleaseLevel: config.ReleaseLevelStable,
|
||||||
DefaultValue: getDefaultListenAddress(),
|
DefaultValue: getDefaultListenAddress(),
|
||||||
ValidationRegex: "^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{1,5}|\\[[:0-9A-Fa-f]+\\]:[0-9]{1,5})$",
|
ValidationRegex: "^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{1,5}|\\[[:0-9A-Fa-f]+\\]:[0-9]{1,5})$",
|
||||||
RequiresRestart: true,
|
RequiresRestart: true,
|
||||||
|
@ -53,5 +54,6 @@ func registerConfig() error {
|
||||||
|
|
||||||
// SetDefaultAPIListenAddress sets the default listen address for the API.
|
// SetDefaultAPIListenAddress sets the default listen address for the API.
|
||||||
func SetDefaultAPIListenAddress(address string) {
|
func SetDefaultAPIListenAddress(address string) {
|
||||||
|
|
||||||
defaultListenAddress = address
|
defaultListenAddress = address
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,9 @@ func prep() error {
|
||||||
Name: "RNG Cipher",
|
Name: "RNG Cipher",
|
||||||
Key: "random/rng_cipher",
|
Key: "random/rng_cipher",
|
||||||
Description: "Cipher to use for the Fortuna RNG. Requires restart to take effect.",
|
Description: "Cipher to use for the Fortuna RNG. Requires restart to take effect.",
|
||||||
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
|
||||||
OptType: config.OptTypeString,
|
OptType: config.OptTypeString,
|
||||||
|
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
||||||
|
ReleaseLevel: config.ReleaseLevelExperimental,
|
||||||
ExternalOptType: "string list",
|
ExternalOptType: "string list",
|
||||||
DefaultValue: "aes",
|
DefaultValue: "aes",
|
||||||
ValidationRegex: "^(aes|serpent)$",
|
ValidationRegex: "^(aes|serpent)$",
|
||||||
|
@ -46,8 +47,9 @@ func prep() error {
|
||||||
Name: "Minimum Feed Entropy",
|
Name: "Minimum Feed Entropy",
|
||||||
Key: "random/min_feed_entropy",
|
Key: "random/min_feed_entropy",
|
||||||
Description: "The minimum amount of entropy before a entropy source is feed to the RNG, in bits.",
|
Description: "The minimum amount of entropy before a entropy source is feed to the RNG, in bits.",
|
||||||
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
|
||||||
OptType: config.OptTypeInt,
|
OptType: config.OptTypeInt,
|
||||||
|
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
||||||
|
ReleaseLevel: config.ReleaseLevelExperimental,
|
||||||
DefaultValue: 256,
|
DefaultValue: 256,
|
||||||
ValidationRegex: "^[0-9]{3,5}$",
|
ValidationRegex: "^[0-9]{3,5}$",
|
||||||
})
|
})
|
||||||
|
@ -60,8 +62,9 @@ func prep() error {
|
||||||
Name: "Reseed after x seconds",
|
Name: "Reseed after x seconds",
|
||||||
Key: "random/reseed_after_seconds",
|
Key: "random/reseed_after_seconds",
|
||||||
Description: "Number of seconds until reseed",
|
Description: "Number of seconds until reseed",
|
||||||
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
|
||||||
OptType: config.OptTypeInt,
|
OptType: config.OptTypeInt,
|
||||||
|
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
||||||
|
ReleaseLevel: config.ReleaseLevelExperimental,
|
||||||
DefaultValue: 360, // ten minutes
|
DefaultValue: 360, // ten minutes
|
||||||
ValidationRegex: "^[1-9][0-9]{1,5}$",
|
ValidationRegex: "^[1-9][0-9]{1,5}$",
|
||||||
})
|
})
|
||||||
|
@ -74,8 +77,9 @@ func prep() error {
|
||||||
Name: "Reseed after x bytes",
|
Name: "Reseed after x bytes",
|
||||||
Key: "random/reseed_after_bytes",
|
Key: "random/reseed_after_bytes",
|
||||||
Description: "Number of fetched bytes until reseed",
|
Description: "Number of fetched bytes until reseed",
|
||||||
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
|
||||||
OptType: config.OptTypeInt,
|
OptType: config.OptTypeInt,
|
||||||
|
ExpertiseLevel: config.ExpertiseLevelDeveloper,
|
||||||
|
ReleaseLevel: config.ReleaseLevelExperimental,
|
||||||
DefaultValue: 1000000, // one megabyte
|
DefaultValue: 1000000, // one megabyte
|
||||||
ValidationRegex: "^[1-9][0-9]{2,9}$",
|
ValidationRegex: "^[1-9][0-9]{2,9}$",
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue