这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@hansmi
Copy link
Contributor

@hansmi hansmi commented Jun 8, 2016

In at least one case a customer of ours added a domain including
a schema, as in “http://domain.tld/”. That is obviously incorrect, but
then they couldn't remove it using the dokku command:

$ dokku domains:remove app7 http://domain.tld/
sed: -e expression #1, char 9: unknown command: `/'

This patch changes the sed command to use the "\CregexpC" syntax. The
character used is a vertical pipe, which is far less likely to be used
in a URL. After the change:

$ dokku domains:remove app7 http://domain.tld/
-----> Removed http://domain.tld/ from app7

In at least one case a customer of ours added a domain including
a schema, as in “http://domain.tld/”. That is obviously incorrect, but
then they couldn't remove it using the dokku command:

  $ dokku domains:remove app7 http://domain.tld/
  sed: -e expression #1, char 9: unknown command: `/'

This patch changes the sed command to use the "\CregexpC" syntax. The
character used is a vertical pipe, which is far less likely to be used
in a URL. After the change:

  $ dokku domains:remove app7 http://domain.tld/
  -----> Removed http://domain.tld/ from app7

Signed-off-by: Michael Hanselmann <hansmi@vshn.ch>
@michaelshobbs
Copy link
Member

The patch seems reasonable. However, the use case raises a question. Given the domains assigned to an app are byte for byte inserted into nginx configuration, is a domain with a scheme actually a valid argument to the server_name option in nginx.conf?

@josegonzalez
Copy link
Member

I can't find any docs that state having a scheme is valid. We should probably validate and toss them.

I also think that trailing slash shouldn't be there either.

@hansmi
Copy link
Contributor Author

hansmi commented Jun 8, 2016

Yeah, there shouldn't be a scheme or any slashes. Just a FQDN.

Currently it is possible to insert incorrect strings without there being a working option to remove them again, hence the patch.

@michaelshobbs
Copy link
Member

Ah ok understood. Thank you for clarifying (again 😉). I missed the initial bit about that being "obviously incorrect". Sorry for the confusion here.

@michaelshobbs michaelshobbs merged commit 5ff7399 into dokku:master Jun 8, 2016
@josegonzalez
Copy link
Member

@hansmi do you mind working on a pr to ensure people don't add invalid strings?

@hansmi
Copy link
Contributor Author

hansmi commented Jun 9, 2016

@josegonzalez Unfortunately I can't work on this at the present time. I have opened issue #2231, though.

@josegonzalez
Copy link
Member

Thanks for filing!

@hansmi hansmi deleted the fix_slash_domain_removal branch June 13, 2016 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants