Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize Site Names #86

Closed
TopherGopher opened this issue Mar 23, 2017 · 5 comments
Closed

Sanitize Site Names #86

TopherGopher opened this issue Mar 23, 2017 · 5 comments
Assignees
Milestone

Comments

@TopherGopher
Copy link
Contributor

What happened:

I created a site with sitename with a suspected invalid character. When I attempted to take the site through the workflow, the site spin-up failed with an Exit code 1.

What you expected to happen:

I expected the site to come up all the way.

How to reproduce it (as minimally and precisely as possible):

Create a folder with an invalid site name and use it as the default site name or just run ddev config and try plugging in a site name with invalid characterts.

Anything else do we need to know:

People might have folder names that we have to sanitize (e.g. they interact with their folders through Finder and use invalid characters in the folder name. In general, the sitename input should be sanitized.

Related source links or issues:

Console Output

➜  src mkdir invalid-drud-site\?
➜  src cd invalid-drud-site\?
➜  invalid-drud-site? cp -R ../drud-d7/docroot .
➜  invalid-drud-site? ddev config
Creating a new ddev project config in the current directory (/Users/csterling/src/invalid-drud-site?)
Once completed, your configuration will be written to /Users/csterling/src/invalid-drud-site?/.ddev/config.yaml

Project name (invalid-drud-site?):

The docroot is the directory from which your site is served. This is a relative path from your application root (/Users/csterling/src/invalid-drud-site?)
You may leave this value blank if your site files are in the application root
Docroot Location: docroot
Found a drupal7 codebase at /Users/csterling/src/invalid-drud-site?/docroot
➜  invalid-drud-site? ddev start
Starting environment for invalid-drud-site?...

Adding hostfile entry. You will be prompted for your password.
Password:
Failed to start invalid-drud-site?: exit status 1
@rfay
Copy link
Member

rfay commented Apr 18, 2017

Mostly we should be able to handle the vast majority of characters, anything that's utf-8. Except what's not allowed in a domain name right?

It looks like the old ascii rules are in http://www.ietf.org/rfc/rfc1034.txt
And the new IDNA rules are in https://en.wikipedia.org/wiki/Internationalized_domain_name

So we probably just have to choose a strategy and then normalize for it. IMO forcing ascii would be OK.

@rickmanelius
Copy link
Contributor

Looks like we're proceeding on this. Removing the "needs decision" blocker and adding flags for tests. Not sure documentation is necessary if we end up prompting the user that we only support alphanumeric + dash character as input!

rfay pushed a commit to rfay/ddev that referenced this issue Jun 27, 2017
)

* normalize sitenames on config write and read

* improve comment on regexp

* switch to a validation approach vs replacing invalid values, add config validation to Init
@rickmanelius
Copy link
Contributor

This tripped me up. I was reviewing https://github.com/drud/ddev/pull/712/files#diff-0c9a20c1c50fca454d4715bf175e38bdR135 and I tried to pass in the project name "test^☃site" (because honestly, who doesn't want to have a snowman domain name). It broke when running ddev start. Perhaps a regression from here? #339

@rickmanelius rickmanelius reopened this Mar 5, 2018
@rickmanelius rickmanelius modified the milestones: v1.0.0, v0.9.1 Mar 5, 2018
@rickmanelius
Copy link
Contributor

Updated the milestone to reflect when this was officially released.

@rfay
Copy link
Member

rfay commented Sep 25, 2018

We need to solve this bug. It trips people from time to time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants