Updated DAV config properties + Added 'nats' feature to CI job
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -311,7 +311,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
rustup target add ${{matrix.target}}
|
rustup target add ${{matrix.target}}
|
||||||
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure enterprise"
|
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure nats enterprise"
|
||||||
cargo build --release --target ${{matrix.target}} -p stalwart-cli
|
cargo build --release --target ${{matrix.target}} -p stalwart-cli
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
mv ./target/${{matrix.target}}/release/stalwart-mail.exe ./artifacts/stalwart-mail.exe
|
mv ./target/${{matrix.target}}/release/stalwart-mail.exe ./artifacts/stalwart-mail.exe
|
||||||
@@ -349,14 +349,14 @@ jobs:
|
|||||||
# Get latest FoundationDB installer
|
# Get latest FoundationDB installer
|
||||||
curl --retry 5 -Lso foundationdb.pkg "$(gh api -X GET /repos/apple/foundationdb/releases --jq '.[] | select(.prerelease == false) | .assets[] | select(.name | test("${{startsWith(matrix.target, 'x86') && 'x86_64' || 'arm64'}}" + ".pkg$")) | .browser_download_url' | head -n1)"
|
curl --retry 5 -Lso foundationdb.pkg "$(gh api -X GET /repos/apple/foundationdb/releases --jq '.[] | select(.prerelease == false) | .assets[] | select(.name | test("${{startsWith(matrix.target, 'x86') && 'x86_64' || 'arm64'}}" + ".pkg$")) | .browser_download_url' | head -n1)"
|
||||||
sudo installer -allowUntrusted -dumplog -pkg foundationdb.pkg -target /
|
sudo installer -allowUntrusted -dumplog -pkg foundationdb.pkg -target /
|
||||||
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "foundationdb elastic s3 redis enterprise"
|
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "foundationdb elastic s3 redis nats enterprise"
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
mv ./target/${{matrix.target}}/release/stalwart-mail ./artifacts/stalwart-mail-foundationdb
|
mv ./target/${{matrix.target}}/release/stalwart-mail ./artifacts/stalwart-mail-foundationdb
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
rustup target add ${{matrix.target}}
|
rustup target add ${{matrix.target}}
|
||||||
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure enterprise"
|
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure nats enterprise"
|
||||||
cargo build --release --target ${{matrix.target}} -p stalwart-cli
|
cargo build --release --target ${{matrix.target}} -p stalwart-cli
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
mv ./target/${{matrix.target}}/release/stalwart-mail ./artifacts/stalwart-mail
|
mv ./target/${{matrix.target}}/release/stalwart-mail ./artifacts/stalwart-mail
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
|
|||||||
g++-x86-64-linux-gnu binutils-x86-64-linux-gnu
|
g++-x86-64-linux-gnu binutils-x86-64-linux-gnu
|
||||||
RUN rustup target add "$(cat /target.txt)"
|
RUN rustup target add "$(cat /target.txt)"
|
||||||
COPY --from=planner /recipe.json /recipe.json
|
COPY --from=planner /recipe.json /recipe.json
|
||||||
RUN RUSTFLAGS="$(cat /flags.txt)" cargo chef cook --target "$(cat /target.txt)" --release --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure enterprise" --recipe-path /recipe.json
|
RUN RUSTFLAGS="$(cat /flags.txt)" cargo chef cook --target "$(cat /target.txt)" --release --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure nats enterprise" --recipe-path /recipe.json
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN RUSTFLAGS="$(cat /flags.txt)" cargo build --target "$(cat /target.txt)" --release -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure enterprise"
|
RUN RUSTFLAGS="$(cat /flags.txt)" cargo build --target "$(cat /target.txt)" --release -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure nats enterprise"
|
||||||
RUN RUSTFLAGS="$(cat /flags.txt)" cargo build --target "$(cat /target.txt)" --release -p stalwart-cli
|
RUN RUSTFLAGS="$(cat /flags.txt)" cargo build --target "$(cat /target.txt)" --release -p stalwart-cli
|
||||||
RUN mv "/build/target/$(cat /target.txt)/release" "/output"
|
RUN mv "/build/target/$(cat /target.txt)/release" "/output"
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ RUN \
|
|||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
source /env-cargo && \
|
source /env-cargo && \
|
||||||
if [ ! -z "${FDB_ARCH}" ]; then \
|
if [ ! -z "${FDB_ARCH}" ]; then \
|
||||||
RUSTFLAGS="-L /usr/lib" cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "foundationdb elastic s3 redis enterprise"; \
|
RUSTFLAGS="-L /usr/lib" cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "foundationdb elastic s3 redis nats enterprise"; \
|
||||||
fi
|
fi
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=secret,id=ACTIONS_RESULTS_URL,env=ACTIONS_RESULTS_URL \
|
--mount=type=secret,id=ACTIONS_RESULTS_URL,env=ACTIONS_RESULTS_URL \
|
||||||
@@ -100,7 +100,7 @@ RUN \
|
|||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
source /env-cargo && \
|
source /env-cargo && \
|
||||||
cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure enterprise" && \
|
cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure nats enterprise" && \
|
||||||
cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p stalwart-cli
|
cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p stalwart-cli
|
||||||
# Copy the source code
|
# Copy the source code
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -114,7 +114,7 @@ RUN \
|
|||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
source /env-cargo && \
|
source /env-cargo && \
|
||||||
if [ ! -z "${FDB_ARCH}" ]; then \
|
if [ ! -z "${FDB_ARCH}" ]; then \
|
||||||
RUSTFLAGS="-L /usr/lib" cargo zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "foundationdb elastic s3 redis enterprise" && \
|
RUSTFLAGS="-L /usr/lib" cargo zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "foundationdb elastic s3 redis nats enterprise" && \
|
||||||
mv /app/target/${TARGET}/release/stalwart-mail /app/artifact/stalwart-mail-foundationdb; \
|
mv /app/target/${TARGET}/release/stalwart-mail /app/artifact/stalwart-mail-foundationdb; \
|
||||||
fi
|
fi
|
||||||
# Build generic version
|
# Build generic version
|
||||||
@@ -124,7 +124,7 @@ RUN \
|
|||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
source /env-cargo && \
|
source /env-cargo && \
|
||||||
cargo zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure enterprise" && \
|
cargo zigbuild --release --target ${TARGET} -p mail-server --no-default-features --features "sqlite postgres mysql rocks elastic s3 redis azure nats enterprise" && \
|
||||||
cargo zigbuild --release --target ${TARGET} -p stalwart-cli && \
|
cargo zigbuild --release --target ${TARGET} -p stalwart-cli && \
|
||||||
mv /app/target/${TARGET}/release/stalwart-mail /app/artifact/stalwart-mail && \
|
mv /app/target/${TARGET}/release/stalwart-mail /app/artifact/stalwart-mail && \
|
||||||
mv /app/target/${TARGET}/release/stalwart-cli /app/artifact/stalwart-cli
|
mv /app/target/${TARGET}/release/stalwart-cli /app/artifact/stalwart-cli
|
||||||
|
|||||||
@@ -36,53 +36,43 @@ impl GroupwareConfig {
|
|||||||
pub fn parse(config: &mut Config) -> Self {
|
pub fn parse(config: &mut Config) -> Self {
|
||||||
GroupwareConfig {
|
GroupwareConfig {
|
||||||
max_request_size: config
|
max_request_size: config
|
||||||
.property("dav.limits.size.request")
|
.property("dav.request.max-size")
|
||||||
.unwrap_or(25 * 1024 * 1024),
|
.unwrap_or(25 * 1024 * 1024),
|
||||||
dead_property_size: config
|
dead_property_size: config
|
||||||
.property_or_default::<Option<usize>>("dav.limits.size.dead-property", "1024")
|
.property_or_default::<Option<usize>>("dav.property.max-size.dead", "1024")
|
||||||
.unwrap_or(Some(1024)),
|
.unwrap_or(Some(1024)),
|
||||||
live_property_size: config
|
live_property_size: config.property("dav.property.max-size.live").unwrap_or(250),
|
||||||
.property("dav.limits.size.live-property")
|
max_lock_timeout: config.property("dav.lock.max-timeout").unwrap_or(3600),
|
||||||
.unwrap_or(250),
|
max_locks_per_user: config.property("dav.locks.max-per-user").unwrap_or(10),
|
||||||
max_lock_timeout: config
|
max_results: config.property("dav.response.max-results").unwrap_or(2000),
|
||||||
.property("dav.limits.timeout.max-lock")
|
max_vcard_size: config.property("contacts.max-size").unwrap_or(512 * 1024),
|
||||||
.unwrap_or(3600),
|
max_ical_size: config.property("calendar.max-size").unwrap_or(512 * 1024),
|
||||||
max_locks_per_user: config
|
|
||||||
.property("dav.limits.max-locks-per-user")
|
|
||||||
.unwrap_or(10),
|
|
||||||
max_results: config.property("dav.limits.max-results").unwrap_or(2000),
|
|
||||||
max_vcard_size: config
|
|
||||||
.property("dav.limits.size.vcard")
|
|
||||||
.unwrap_or(512 * 1024),
|
|
||||||
max_ical_size: config
|
|
||||||
.property("dav.limits.size.ical")
|
|
||||||
.unwrap_or(512 * 1024),
|
|
||||||
default_calendar_name: config
|
default_calendar_name: config
|
||||||
.property_or_default::<Option<String>>("dav.default.calendar.name", "default")
|
.property_or_default::<Option<String>>("calendar.default.href-name", "default")
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
default_addressbook_name: config
|
default_addressbook_name: config
|
||||||
.property_or_default::<Option<String>>("dav.default.addressbook.name", "default")
|
.property_or_default::<Option<String>>("contacts.default.href-name", "default")
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
default_calendar_display_name: config
|
default_calendar_display_name: config
|
||||||
.property_or_default::<Option<String>>(
|
.property_or_default::<Option<String>>(
|
||||||
"dav.default.calendar.display-name",
|
"calendar.default.display-name",
|
||||||
"Default Calendar",
|
"Stalwart Calendar",
|
||||||
)
|
)
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
default_addressbook_display_name: config
|
default_addressbook_display_name: config
|
||||||
.property_or_default::<Option<String>>(
|
.property_or_default::<Option<String>>(
|
||||||
"dav.default.addressbook.display-name",
|
"contacts.default.display-name",
|
||||||
"Default Address Book",
|
"Stalwart Address Book",
|
||||||
)
|
)
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
max_ical_instances: config
|
max_ical_instances: config
|
||||||
.property("dav.limits.ical.max-instances")
|
.property("calendar.max-recurrence-expansions")
|
||||||
.unwrap_or(1000),
|
.unwrap_or(1000),
|
||||||
max_ical_attendees_per_instance: config
|
max_ical_attendees_per_instance: config
|
||||||
.property("dav.limits.ical.max-attendees-per-instance")
|
.property("calendar.max-attendees-per-instance")
|
||||||
.unwrap_or(1000),
|
.unwrap_or(1000),
|
||||||
max_file_size: config
|
max_file_size: config
|
||||||
.property("dav.limits.size.file")
|
.property("file-storage.max-size")
|
||||||
.unwrap_or(25 * 1024 * 1024),
|
.unwrap_or(25 * 1024 * 1024),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -549,7 +549,6 @@ impl DavRequestHandler for Server {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//let c = println!("------------------------------------------");
|
//let c = println!("------------------------------------------");
|
||||||
|
|
||||||
//let std_body = std::str::from_utf8(&body).unwrap_or("[binary]").to_string();
|
//let std_body = std::str::from_utf8(&body).unwrap_or("[binary]").to_string();
|
||||||
|
|
||||||
// Parse headers
|
// Parse headers
|
||||||
@@ -559,7 +558,7 @@ impl DavRequestHandler for Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let start_time = Instant::now();
|
let start_time = Instant::now();
|
||||||
let result = match self
|
match self
|
||||||
.dispatch_dav_request(&request, &headers, access_token, resource, method, body)
|
.dispatch_dav_request(&request, &headers, access_token, resource, method, body)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -674,7 +673,7 @@ impl DavRequestHandler for Server {
|
|||||||
|
|
||||||
HttpResponse::new(code)
|
HttpResponse::new(code)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/*let c = println!(
|
/*let c = println!(
|
||||||
"{:?} {} -> {:?}\nHeaders: {:?}\nBody: {}\nResponse headers: {:?}\nResponse: {}",
|
"{:?} {} -> {:?}\nHeaders: {:?}\nBody: {}\nResponse headers: {:?}\nResponse: {}",
|
||||||
@@ -689,9 +688,9 @@ impl DavRequestHandler for Server {
|
|||||||
http_proto::HttpResponseBody::Empty => "[empty]".to_string(),
|
http_proto::HttpResponseBody::Empty => "[empty]".to_string(),
|
||||||
_ => "[binary]".to_string(),
|
_ => "[binary]".to_string(),
|
||||||
}
|
}
|
||||||
);*/
|
);
|
||||||
|
|
||||||
result
|
result*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
crates/groupware/src/cache/mod.rs
vendored
8
crates/groupware/src/cache/mod.rs
vendored
@@ -288,8 +288,12 @@ impl GroupwareCache for Server {
|
|||||||
name: name.clone(),
|
name: name.clone(),
|
||||||
preferences: vec![CalendarPreferences {
|
preferences: vec![CalendarPreferences {
|
||||||
account_id,
|
account_id,
|
||||||
name: name.clone(),
|
name: self
|
||||||
description: self.core.groupware.default_calendar_display_name.clone(),
|
.core
|
||||||
|
.groupware
|
||||||
|
.default_calendar_display_name
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_else(|| name.clone()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}],
|
}],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user