Support website publishing #7

Merged
lx merged 61 commits from feature/website into master 2021-01-15 16:49:51 +00:00
3 changed files with 5 additions and 2 deletions
Showing only changes of commit 5b363626f4 - Show all commits

1
Cargo.lock generated
View file

@ -661,6 +661,7 @@ dependencies = [
"hex", "hex",
"http", "http",
"hyper", "hyper",
"idna",
"log", "log",
"percent-encoding", "percent-encoding",
"rand", "rand",

View file

@ -41,4 +41,4 @@ rustls = "0.17"
webpki = "0.21" webpki = "0.21"
roxmltree = "0.11" roxmltree = "0.11"
idna = "0.2"
quentin marked this conversation as resolved Outdated
Outdated
Review

roxmltree, rustls, webpki, httpdate and maybe some others can probably be removed

roxmltree, rustls, webpki, httpdate and maybe some others can probably be removed

View file

@ -10,6 +10,8 @@ use hyper::server::conn::AddrStream;
use hyper::service::{make_service_fn, service_fn}; use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Request, Response, Server}; use hyper::{Body, Request, Response, Server};
use idna::domain_to_unicode;
use garage_model::garage::Garage; use garage_model::garage::Garage;
use garage_util::error::Error as GarageError; use garage_util::error::Error as GarageError;
use crate::error::*; use crate::error::*;
@ -70,7 +72,7 @@ async fn serve_file(garage: Arc<Garage>, req: Request<Body>) -> Result<Response<
.to_str()?; .to_str()?;
// Get bucket // Get bucket
let host = authority_to_host(authority)?; let (host, _) = domain_to_unicode(authority_to_host(authority)?);
let root = &garage.config.s3_web.root_domain; let root = &garage.config.s3_web.root_domain;
let bucket = host_to_bucket(&host, root); let bucket = host_to_bucket(&host, root);