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

Normalize auto generated frontend-rule (docker) #1043

Closed
WTFKr0 opened this issue Jan 19, 2017 · 2 comments
Closed

Normalize auto generated frontend-rule (docker) #1043

WTFKr0 opened this issue Jan 19, 2017 · 2 comments

Comments

@WTFKr0
Copy link
Contributor

WTFKr0 commented Jan 19, 2017

What version of Traefik are you using (traefik version)?

Version: v1.1.2
Codename: camembert
Go version: go1.7.4
Built: 2016-12-15_10:21:15AM
OS/Arch: linux/amd64

What is your environment & configuration (arguments, toml...)?

/traefik --web --retry --retry.attempts=10 --docker --docker.watch --docker.swarmmode --docker.domain=my.domain.org --logLevel=DEBUG --entryPoints=Name:http Address::80 Redirect.EntryPoint:https --defaultEntryPoints=http,https --web.address=:8081 --entryPoints=Name:http2 Address::8080 --entryPoints=Name:https Address::443 TLS:traefik.crt,traefik.key

What did you do?

I use docker 1.13 rc7, with a docker-compose file and the docker stack deploy command
This create a service (swarm mode) named

<stack>_<service>

What did you expect to see?

I want traefik create a frontend rule like

<stack>-<service>.<default_domain>

What did you see instead?

Traefik take the service name, so

<stack>_<service>.<default_domain>

So what can we do?

Can traefik change the underscore to hyphen in the normalize process ?
Cause underscores are not valid URI character
See https://tools.ietf.org/html/rfc1035

<domain> ::= <subdomain> | " "

<subdomain> ::= <label> | <subdomain> "." <label>

<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]

<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>

<let-dig-hyp> ::= <let-dig> | "-"

<let-dig> ::= <letter> | <digit>

<letter> ::= any one of the 52 alphabetic characters A through Z in
upper case and a through z in lower case

<digit> ::= any one of the ten digits 0 through 9

Thanx for reading

@WTFKr0 WTFKr0 changed the title Normalize auto generated frtonend-rule (docker) Normalize auto generated frontend-rule (docker) Jan 19, 2017
@WTFKr0
Copy link
Contributor Author

WTFKr0 commented Jan 24, 2017

I think we have to do that in that line :
https://github.com/containous/traefik/blob/913a297e8d2f5279bef79b29cb803f30e5aa5ef1/provider/docker.go#L398
We can't use normalize function as we need to keep dot in url :)

@WTFKr0
Copy link
Contributor Author

WTFKr0 commented Jan 27, 2017

I made a PR for that : #1061
WDYT @emilevauge

@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants