Skip to contentSkip to conversation

rgw static-website hosting design WIP: how S3-like should we be with endpoint types?

DISCUSSION Robin H. Johnson 2 participants 3 messages Jun 9, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

I'm working on implementing S3 Static Website hosting on top of RGW, based on the initial work that Yehuda did (wip-static-website branch).

I have a scratchpad here:
https://github.com/robbat2/temp-ceph-rgw-static-website-wiki/wiki
WIP Codebase here:
https://github.com/robbat2/ceph/tree/wip-static-website-robbat2-master

As part of writing up a full design for it, I'm wondering if we should try to be "as close to S3 as possible", or try to improve the experience for the administrator rather.

In S3, they explicitly add some DNS endpoints that are used for accessing the bucket in website mode. Via those special endpoints, there are MANY constraints applied [1], and you pretty much can't use them for anything else.

At this point in early implementation, it seems possible that rather than requiring organizations to have a separate DNS subdomain/wildcard scope for websites, that we can make the decision based on headers:
If(bucket has website metadata set) {
if(request has auth headers) {
use normal REST mode
} else {
use website mode
}
}

I've got it mostly working to make this behavior, but I'm wondering about fallout/breakage, and unintended consequences. The codebase is pretty ready for plugging the alternative logic with hostnames in as well.

The most notable one so far, is that under Amazon's S3, the website endpoint will server up only fixed pages for directories (no listing); and the regular REST endpoint will serve listings if the bucket/directory has a public ACL.

Another side-effect, and I think that's an improvement, is that if you use a browser to just access a bucket this way, you'll automatically get HTML error pages, instead of the XML blobs (as an admin of a RGW install previously, the non-technical users telling me the rendered HTML from their errors would have been a huge help instead of them being scared of the XML).

[1] The list of S3 website endpoint constraints is here:
http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html

Signature · 4 lines
Robin Hugh Johnson
Gentoo Linux: Developer, Infrastructure Lead
E-Mail     : [email protected]
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
#1 lore raw

----- Original Message -----

Quoted 53 lines

From: "Robin H. Johnson" <[email protected]>
To: "Ceph Development" <[email protected]>
Cc: "jonathan lacour" <[email protected]>
Sent: Monday, June 8, 2015 8:52:21 PM
Subject: rgw static-website hosting design WIP: how S3-like should we be with endpoint types?

Hi,

I'm working on implementing S3 Static Website hosting on top of RGW, based on the initial work that Yehuda did (wip-static-website branch).

I have a scratchpad here:
https://github.com/robbat2/temp-ceph-rgw-static-website-wiki/wiki
WIP Codebase here:
https://github.com/robbat2/ceph/tree/wip-static-website-robbat2-master

As part of writing up a full design for it, I'm wondering if we should try to be "as close to S3 as possible", or try to improve the experience for the administrator rather.

In S3, they explicitly add some DNS endpoints that are used for accessing the bucket in website mode. Via those special endpoints, there are MANY constraints applied [1], and you pretty much can't use them for anything else.

At this point in early implementation, it seems possible that rather than requiring organizations to have a separate DNS subdomain/wildcard scope for websites, that we can make the decision based on headers:
If(bucket has website metadata set) {
if(request has auth headers) {
use normal REST mode
} else {
use website mode
}
}

I've got it mostly working to make this behavior, but I'm wondering about fallout/breakage, and unintended consequences. The codebase is pretty ready for plugging the alternative logic with hostnames in as well.

The most notable one so far, is that under Amazon's S3, the website endpoint will server up only fixed pages for directories (no listing); and the regular REST endpoint will serve listings if the bucket/directory has a public ACL.

Another side-effect, and I think that's an improvement, is that if you use a browser to just access a bucket this way, you'll automatically get HTML error pages, instead of the XML blobs (as an admin of a RGW install previously, the non-technical users telling me the rendered HTML from their errors would have been a huge help instead of them being scared of the XML).

Quoted 3 lines

[1] The list of S3 website endpoint constraints is here:
http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html

A few options (not necessarily mutual exclusive):
- anonymous access gets the website endpoint handling, authenticated gets the REST
- read operations returns website, write operations handle REST
- configurable (whether gateway handles either, or which)

I don't have a strong opinion, more of what users prefer.

Yehuda

#2 lore raw
Quoted 3 lines · Yehuda Sadeh-Weinraub

A few options (not necessarily mutual exclusive):
- anonymous access gets the website endpoint handling, authenticated gets the REST
- read operations returns website, write operations handle REST

I have a hybrid of this now:
- non-authenticated GET/HEAD return website.
- everything else is REST as before.

Quoted 1 line

- configurable (whether gateway handles either, or which)

Yeah, maybe will do that in a later pass.

Signature · 4 lines
Robin Hugh Johnson
Gentoo Linux: Developer, Infrastructure Lead
E-Mail     : [email protected]
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85