Comments (5)
Looked into it a little more when trying to pass that as a Docker label the toml package throws the following error:
Error creating docker configuration Near line 8, key 'frontends': Near line 8: Table names cannot contain '[' or ']'.
Looks like because the entire frontend name is being used as per docker.tmpl it's attempting also inject the regex into the table name.
Please see the referenced commit for my fixes. If you think these are inline I can make a PR. I'm not exactly sure what to return with if the parsing failed. Right now it returns the original string (Don't like this)
from traefik.
Hi @polds, thank you for reporting. This is an issue. We have to find a smart way to do that. I'm not sure to understand what does:
"makeParsedUrl": func(s1 string) string {
if u, err := url.Parse(s1); err == nil {
return u.String()
}
return s1
},
Could you explain a little bit ?
from traefik.
@emilevauge it converts the string to their html entities counterparts. Going in the string is {subdomain: [a-z]+}.example.com
and coming back it is converted to an ugly, but safe: %7Bsubdomain:%20%5Ba-z%5D+%7D.example.com
but still parsed correctly by Traefik.
My biggest concern is if the url.Parse()
fails I have it returning the same string which would inevitably cause issues if url.Parse()
can't handle it. I'm wondering if just returning the string "error" would be better.
Edit: The TOML parser was only specifically complaining about the [ ]
so perhaps instead of introducing a new template function we use the already available replace function and do something like so:
{{$frontend | replace "[" "" | replace "]" ""}}
from traefik.
@polds, OK I get it. I definitely prefer the second solution to reuse the replace
template function. Would you make a PR on that point?
from traefik.
Or even better, should be added directly here: https://github.com/emilevauge/traefik/blob/master/provider/docker.go#L209
from traefik.
Related Issues (20)
- RedirectRegex broken since update to v3.0 HOT 2
- Official standalone Grafana dashboards need to be updated as of Traefik v3.0
- ContentType middleware working not as expected HOT 1
- Traefik 3.0 Failed HTTP-01 challenge for own subdomain with let's encrypt HOT 1
- Add support for edgedb protocol HOT 1
- Traefik v3 silently dropped support for multiple arguments in "Host" rule HOT 3
- Fix `providers.swarm` "Configuration Examples" in doc, provide real life example HOT 1
- Add access log filter for `entrypoint` and `router` HOT 2
- rateLimit not working as expected for long latency requests HOT 2
- Traefik v3.0 breaks existing `cert-manager` integrations
- cannot import github.com/IBM/sarama HOT 3
- Enable HTTP/3 By Default
- Traefik v3.0 Log Error on unexposed services (docker swarm) HOT 2
- Traefik v2 does not show client IP address in X-Forwarded-For and/or in X-Real-Ip headers HOT 3
- Improving Documentation for Non-Containerized Environments HOT 3
- logs.compress integer or boolean? HOT 1
- Dashboard displays duplicate entries for IPAllowList's sourceRange/ipStrategy HOT 1
- middleware error is responding with error http response code though it is redirected to error page to client HOT 1
- Docs mention `--tracing.otlp.http=true` flag but it is not accepted HOT 3
- Traefik does not resolve TLS ingress if termination secret created after ingress HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traefik.