mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
pre-download static files, and add api versioning
This commit is contained in:
committed by
Aiden McClelland
parent
01d766fce9
commit
d3c5648608
@@ -218,3 +218,18 @@ pub fn dir_size<'a, P: AsRef<Path> + 'a + Send + Sync>(
|
||||
}
|
||||
.boxed()
|
||||
}
|
||||
|
||||
pub fn response_to_reader(response: reqwest::Response) -> impl AsyncRead + Unpin {
|
||||
tokio_util::io::StreamReader::new(response.bytes_stream().map_err(|e| {
|
||||
std::io::Error::new(
|
||||
if e.is_connect() {
|
||||
std::io::ErrorKind::ConnectionRefused
|
||||
} else if e.is_timeout() {
|
||||
std::io::ErrorKind::TimedOut
|
||||
} else {
|
||||
std::io::ErrorKind::Other
|
||||
},
|
||||
e,
|
||||
)
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ impl EmbassyLogger {
|
||||
let log_epoch = Arc::new(AtomicU64::new(rand::random()));
|
||||
let sharing = Arc::new(AtomicBool::new(share_errors));
|
||||
let share_dest = match share_dest {
|
||||
None => "http://registry.privacy34kn4ez3y3nijweec6w4g54i3g54sdv7r5mr6soma3w4begyd.onion/support/error-logs".to_owned(),
|
||||
None => "http://registry.privacy34kn4ez3y3nijweec6w4g54i3g54sdv7r5mr6soma3w4begyd.onion/support/v0/error-logs".to_owned(),
|
||||
Some(a) => a.to_string(),
|
||||
};
|
||||
let tor_proxy = Client::builder()
|
||||
|
||||
Reference in New Issue
Block a user