Static Push: Unable to push content in a bucket with _ in its bucket name
Considering that the suggested bucket name pattern is: dotcms-bucket-{hostname}-{languageIso} and the application allows to create a site with * as part of the name, the user should be able to push content in a bucket whose name contains *.
Trace log: https://gist.github.com/nollymar/d80ee14c499917cb93b851770a20da05
Important note: Creating a bucket with _ in its name is not possible in AWS Console either. However, site name and bucket name restrictions should be aligned, considering the suggested bucket name pattern.
Current Behavior
Unable to push static content in a bucket whose name contains _
Steps to Reproduce (for bugs)
- Create a site with _ in its name
- Configure a static push environment using the suggested bucket name pattern
- Try to push the site
Your Environment
- dotCMS version used: 3.7.0
- Browser Name and version: Google Chrome
- Operating System and version: Mac OS
- Application Server and version: Tomcat 8
- Java Brand and version: JDK 1.8
- Database and version: Postgres (starter)
- Application module (if apply): Push Publishing
We need to consider also blank spaces (i.e.: copy of demo) and probably other special characters. Some clients' site names may contain blank spaces and could be in trouble doing a static push of their site. I tested this scenario using started data and client data after an upgrade and got this error: https://gist.github.com/shaydotcms/fd9658771b8a1a67f3ce4d69bd7e7b16
These are the special characters that can be used in the host name but are not allowed by AWS in the bucket name: .. , ! : ; & ? $ * / \ [ ] = | # _ " " @ ( ) < > + Note: this character "-" can be used between word in AWS (i.e.: "test-bucket") but not at the end of the word (i.e.: "testbucket-")
FYI: We need take in consideration these rules... http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
But i think that are the same rules that you should use to name a DNS https://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax
ee PR: https://github.com/dotCMS/enterprise-2.x/pull/434 core PR: https://github.com/dotCMS/core/pull/10578
It fails in a specific case. View https://github.com/dotCMS/core/issues/10588
http://auth.dotcms.com/docs/latest/connecting-remote-servers