Can upload disk images on the server
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-05-27 20:40:48 +02:00
parent 6a7af7e6c4
commit b55880b43c
13 changed files with 288 additions and 5 deletions

View File

@ -16,6 +16,7 @@ struct StaticConfig {
local_auth_enabled: bool,
oidc_auth_enabled: bool,
iso_mimetypes: &'static [&'static str],
disk_images_mimetypes: &'static [&'static str],
net_mac_prefix: &'static str,
builtin_nwfilter_rules: &'static [&'static str],
nwfilter_chains: &'static [&'static str],
@ -37,6 +38,7 @@ struct SLenConstraints {
#[derive(serde::Serialize)]
struct ServerConstraints {
iso_max_size: usize,
disk_image_max_size: usize,
vnc_token_duration: u64,
vm_name_size: LenConstraints,
vm_title_size: LenConstraints,
@ -63,11 +65,13 @@ pub async fn static_config(local_auth: LocalAuthEnabled) -> impl Responder {
local_auth_enabled: *local_auth,
oidc_auth_enabled: !AppConfig::get().disable_oidc,
iso_mimetypes: &constants::ALLOWED_ISO_MIME_TYPES,
disk_images_mimetypes: &constants::ALLOWED_DISK_IMAGES_MIME_TYPES,
net_mac_prefix: constants::NET_MAC_ADDR_PREFIX,
builtin_nwfilter_rules: &constants::BUILTIN_NETWORK_FILTER_RULES,
nwfilter_chains: &constants::NETWORK_CHAINS,
constraints: ServerConstraints {
iso_max_size: constants::ISO_MAX_SIZE,
disk_image_max_size: constants::DISK_IMAGE_MAX_SIZE,
vnc_token_duration: VNC_TOKEN_LIFETIME,