feat: allow disabling of registration
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
This commit is contained in:
parent
1cda34d16b
commit
b8cf21903e
3 changed files with 14 additions and 0 deletions
|
@ -10,6 +10,7 @@ pub struct ConfigBuilder {
|
|||
database: Database,
|
||||
cache_database: CacheDatabase,
|
||||
web: Option<WebBuilder>,
|
||||
instance: Option<Instance>,
|
||||
bunny: BunnyBuilder,
|
||||
}
|
||||
|
||||
|
@ -38,6 +39,11 @@ struct WebBuilder {
|
|||
_ssl: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Instance {
|
||||
pub registration: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct BunnyBuilder {
|
||||
api_key: String,
|
||||
|
@ -93,6 +99,7 @@ impl ConfigBuilder {
|
|||
database: self.database,
|
||||
cache_database: self.cache_database,
|
||||
web,
|
||||
instance: self.instance.unwrap_or(Instance { registration: true }),
|
||||
bunny,
|
||||
}
|
||||
}
|
||||
|
@ -103,6 +110,7 @@ pub struct Config {
|
|||
pub database: Database,
|
||||
pub cache_database: CacheDatabase,
|
||||
pub web: Web,
|
||||
pub instance: Instance,
|
||||
pub bunny: Bunny,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue