mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
add support for post-setup commands
This commit is contained in:
parent
8a48b2e3c4
commit
25ea32820c
3 changed files with 11 additions and 0 deletions
|
|
@ -134,6 +134,9 @@ work_dir = "/path/to/temp/dir" # path to temporary directory. optional, defaults
|
||||||
enabled = false # whether or not to automatically install nextcloud on `haze start`. optional, defaults to false
|
enabled = false # whether or not to automatically install nextcloud on `haze start`. optional, defaults to false
|
||||||
username = "foo" # username for admin user during auto setup. optional, defaults to "admin"
|
username = "foo" # username for admin user during auto setup. optional, defaults to "admin"
|
||||||
password = "bar" # password for admin user during auto setup. optional, defaults to "admin"
|
password = "bar" # password for admin user during auto setup. optional, defaults to "admin"
|
||||||
|
post_setup = [ # commands to execute after setup, defaults to []
|
||||||
|
"occ app:enable deck",
|
||||||
|
]
|
||||||
|
|
||||||
[[volume]]
|
[[volume]]
|
||||||
source = "/tmp/haze-shared"
|
source = "/tmp/haze-shared"
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ pub struct HazeAutoSetupConfig {
|
||||||
pub username: String,
|
pub username: String,
|
||||||
#[serde(default = "default_auto_setup_password")]
|
#[serde(default = "default_auto_setup_password")]
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub post_setup: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for HazeAutoSetupConfig {
|
impl Default for HazeAutoSetupConfig {
|
||||||
|
|
@ -30,6 +32,7 @@ impl Default for HazeAutoSetupConfig {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
username: default_auto_setup_username(),
|
username: default_auto_setup_username(),
|
||||||
password: default_auto_setup_password(),
|
password: default_auto_setup_password(),
|
||||||
|
post_setup: Vec::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,11 @@ async fn main() -> Result<()> {
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for cmd in &config.auto_setup.post_setup {
|
||||||
|
cloud
|
||||||
|
.exec(&mut docker, cmd.split(" ").collect(), false)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HazeArgs::Stop { filter } => {
|
HazeArgs::Stop { filter } => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue