Discourse does not allow dot «.» symbol in bucket name while Amazon S3 allows it


(Discourse.PRO) #1

Rules for Bucket Naming from Amazon Documentation:

Bucket names must be a series of one or more labels. Adjacent labels are separated by a single period (.).
<…>
The following examples are valid bucket names:
<…>
my.aws.bucket

Using a domain name as a bucket name is so naturally, especially for site backup, so it would be nice if Discourse will support it.


Amazon AWS S3 bucket names with dots are not allowed
(Régis Hanol) #2

We did that because we had issues with the gem we used to communicate with S3. Now that we’ve got rid of it, I think it’s safe to loosen the check a bit.


(Sam Saffron) #3

Test it out, I think we may need to use a diff Api unless they fixed it in v2


(Régis Hanol) #4

Just tested it and it worked fine :wink:


(Régis Hanol) #5

(Kane York) #6

Wait, isn’t the dot restriction because it causes HTTPS to fail?

yes, it is:

ssl.CertificateError: hostname 'my.bucket.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'

It’s the SSL certificate, not the gem.

edit: If discourse isn’t always using SSL to talk to s3, that should be fixed. Both on server and client.


(Sam Saffron) #7

(Sam Saffron) #8

Yes I agree, we should just disallow this, its adding complexity where complexity is not needed.

If people want vanity “sexy” names then can use s3_cdn. A solution that only works with HTTP is not really acceptable.


Backup to S3 configuration problem
(Régis Hanol) #9

Thanks for figuring that one out :sunny:

https://github.com/discourse/discourse/commit/5de955451027951600e5ad8b76fa7d38e086603d


(Jeff Atwood) #10