mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +02:00
add options for enabling/disabling apps
This commit is contained in:
parent
44ae8ebae5
commit
036232285c
4 changed files with 44 additions and 2 deletions
|
|
@ -70,6 +70,10 @@ pub struct HazeAutoSetupConfig {
|
|||
#[serde(default = "default_auto_setup_password")]
|
||||
pub password: String,
|
||||
#[serde(default)]
|
||||
pub enable_apps: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub disable_apps: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub post_setup: Vec<String>,
|
||||
}
|
||||
|
||||
|
|
@ -79,6 +83,8 @@ impl Default for HazeAutoSetupConfig {
|
|||
enabled: false,
|
||||
username: default_auto_setup_username(),
|
||||
password: default_auto_setup_password(),
|
||||
enable_apps: Vec::default(),
|
||||
disable_apps: Vec::default(),
|
||||
post_setup: Vec::default(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
22
src/main.rs
22
src/main.rs
|
|
@ -560,6 +560,28 @@ async fn setup(docker: &Docker, options: CloudOptions, config: &HazeConfig) -> R
|
|||
.await?;
|
||||
}
|
||||
|
||||
for app in &config.auto_setup.enable_apps {
|
||||
cloud
|
||||
.exec(
|
||||
docker,
|
||||
vec!["occ", "app:enable", app.as_str(), "--force"],
|
||||
false,
|
||||
Vec::<String>::default(),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
for app in &config.auto_setup.disable_apps {
|
||||
cloud
|
||||
.exec(
|
||||
docker,
|
||||
vec!["occ", "app:disable", app.as_str()],
|
||||
false,
|
||||
Vec::<String>::default(),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
for service in cloud.services() {
|
||||
for app in service.apps() {
|
||||
cloud
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue