Support website publishing #7
No reviewers
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#7
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/website"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR is ready for review.
Fixes #6
It contains:
garage bucket website --allow|--deny <bucket>
)test-smoke.sh
WIP: Support website publishingto Support website publishingThere are a few minor changes to make.
The most important subject for discussion is concerning the
root_domain
configuration parameter: why do you think such a mechanism is necessary, rather than having bucket name = domain name as on AWS? (I would be against theroot_domain
mechanism but maybe there is an explanation I'm not aware of)Why break the convention that bucket name = domain name of the hosted website ? This gives more flexibility as we can host sites on diffferent tld/sld. If a website needs to move, we will copy files to the new bucket, it shouldn't be too costly (we don't expect to store TBs of data for a website...)
Please check my answer directly in the issue feed
@ -158,0 +174,4 @@
));
} else {
return Err(Error::Message(format!(
"Bucket is deleted in update_bucket_key"
Probably put
unreachable!()
in else branch ? Because get_existing_bucket does not return a bucket that is deleted. (I think so, this should be checked)Checked.
Indeed, it does not return deleted buckets.
@ -158,0 +176,4 @@
} else {
return Err(Error::Message(format!(
"Bucket is deleted in update_bucket_key"
)));
update_bucket_key
?@ -0,0 +40,4 @@
webpki = "0.21"
roxmltree = "0.11"
roxmltree, rustls, webpki, httpdate and maybe some others can probably be removed
@ -0,0 +4,4 @@
use garage_util::error::Error as GarageError;
#[derive(Debug, Error)]
pub enum Error {
are all variants used? (try commenting them to find out)
Now fixed, I commented all error types and decommented one by one according to the compiler errors. And once it compiled, I removed the remaining commented entries.
@ -0,0 +89,4 @@
match bucket_desc.state.get() {
BucketState::Deleted => Err(Error::NotFound),
BucketState::Present(params) if !params.website.get() => Err(Error::NotFound),
_ => Ok(()),
Rewrite as only two cases:
@ -0,0 +123,4 @@
Ok(())
}
#[test]
NO!!
expect
makes us crash (panic) if the condition is not verified, this is not acceptable (we don't want to assume that authority is well formed, maybe hyper checks it for us but maybe not and we don't want to take risks)@ -0,0 +175,4 @@
assert_eq!(
host_to_bucket("john.doe.garage.tld", ".garage.tld"),
"john.doe"
);
this case is
unreachable!()
thanks to the previous ifThanks for your review lx,
First, I would call this feature as "relative and absolute path resolving".
It tries to mimic as closely as possible Amazon S3 behavior, which in my point is an important reason if we want to follow the Principle Of Least Astonishment. So in the end, I am doing "as on AWS" ^^
Still, we might not want to implement blindly Amazon features.
I find this feature interesting as it has 2 positive side effects:
Moreover, I can not see any important drawback for this feature apart from some complexity in the code.
So, in the end, I recommend keeping this feature but I would agree to drop it if you see an important drawback I have missed. Let met know what you think :)
I also plan to read and address your other comments as soon as possible ;)
Thank you. I understand better now. Let's keep it.
d19bb044b6
to11a79a95dd
So, I tried to address all your remarks, let me know if you disagree with my modifications ^^
Furthermore,
cargo test
+./script/test-smoke.sh
passed.I also checked that this branch is synchronized with master.
Everything seems to be OK on my side, feel free to merge if you have no additional remarks :)