···5555/// TODO: Make this configurable
5656const CONCURRENT_CHUNK_UPLOADS: usize = 10;
57575858-/// The maximum size of the upload info JSON.
5959-///
6060-/// TODO: Make this configurable
6161-const MAX_NAR_INFO_SIZE: usize = 1 * 1024 * 1024; // 1 MiB
6262-6358type CompressorFn<C> = Box<dyn FnOnce(C) -> Box<dyn AsyncRead + Unpin + Send> + Send>;
64596560/// Data of a chunk.
···147142 ))
148143 })?;
149144150150- if preamble_size > MAX_NAR_INFO_SIZE {
145145+ if preamble_size > state.config.max_nar_info_size {
151146 return Err(ErrorKind::RequestError(anyhow!("Upload info is too large")).into());
152147 }
153148
+3
server/src/config-template.toml
···1919# not `https://domain.tld/attic`).
2020#api-endpoint = "https://your.domain.tld/"
21212222+# The maximum size of the upload info JSON, in bytes.
2323+#max-nar-info-size = 1048576 # 1 MiB
2424+2225# Whether to soft-delete caches
2326#
2427# If this is enabled, caches are soft-deleted instead of actually