mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +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
|
||||
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"
|
||||
post_setup = [ # commands to execute after setup, defaults to []
|
||||
"occ app:enable deck",
|
||||
]
|
||||
|
||||
[[volume]]
|
||||
source = "/tmp/haze-shared"
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ pub struct HazeAutoSetupConfig {
|
|||
pub username: String,
|
||||
#[serde(default = "default_auto_setup_password")]
|
||||
pub password: String,
|
||||
#[serde(default)]
|
||||
pub post_setup: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for HazeAutoSetupConfig {
|
||||
|
|
@ -30,6 +32,7 @@ impl Default for HazeAutoSetupConfig {
|
|||
enabled: false,
|
||||
username: default_auto_setup_username(),
|
||||
password: default_auto_setup_password(),
|
||||
post_setup: Vec::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,11 @@ async fn main() -> Result<()> {
|
|||
.await?;
|
||||
}
|
||||
}
|
||||
for cmd in &config.auto_setup.post_setup {
|
||||
cloud
|
||||
.exec(&mut docker, cmd.split(" ").collect(), false)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
HazeArgs::Stop { filter } => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue