-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Split Web into API/Dashboard, ping, metric and Rest Provider #2335
Conversation
50ab5d9
to
d245988
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliens 😍 👏 👏
Only few suggestions.
docs/configuration/api.md
Outdated
| `/health` | `GET` | json health metrics | | ||
| `/api` | `GET` | Configuration for all providers | | ||
| `/api/providers` | `GET` | Providers | | ||
| `/api/providers/{provider}` | `GET` | Get or update provider | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not we use PUT
method to update provider?
docs/configuration/api.md
Outdated
|
||
!!!warning | ||
For compatibility reason, when you activate the rest provider, you can use `web` or `rest` for `provider` value. | ||
But be careful, in the configuration for all provider the key is still `web` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all providers
docs/configuration/api.md
Outdated
| `/api/providers/{provider}/frontends/{frontend}/routes/{route}` | `GET` | Get a route in a frontend | | ||
|
||
!!!warning | ||
For compatibility reason, when you activate the rest provider, you can use `web` or `rest` for `provider` value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for provider
value => as provider
value ?
docs/configuration/backends/rest.md
Outdated
| `/api/providers/rest` | `PUT` | update provider | | ||
|
||
!!!warning | ||
For compatibility reason, when you activate the rest provider, you can use `web` or `rest` for `provider` value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for provider
value => as provider
value ?
docs/configuration/ping.md
Outdated
|
||
|
||
!!!warning | ||
Even if you have authentication configure on entrypoint, the `/ping` path of the api is excluded from authentication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configured
integration/basic_test.go
Outdated
"github.com/containous/traefik/integration/try" | ||
"github.com/go-check/check" | ||
checker "github.com/vdemeester/shakers" | ||
"os" | ||
"strings" | ||
"syscall" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort imports 😉
version/version.go
Outdated
@@ -4,9 +4,13 @@ import ( | |||
"context" | |||
"net/url" | |||
|
|||
"net/http" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort imports 😉
8f6d4f5
to
d8a1685
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New comments
configuration/configuration.go
Outdated
log.Warn("web provider configuration is deprecated, you should use --api for api, --rest for rest provider, --ping for ping and --metrics for metrics") | ||
|
||
if gc.API != nil || gc.Metrics != nil || gc.Ping != nil || gc.Rest != nil { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe should we add a Warn
message to inform user that the web
configuration is not used if API
or Metrics
or Ping
or Rest
configuration exists
provider/rest/rest.go
Outdated
) | ||
|
||
// Provider is a provider.Provider implementation that provides the UI | ||
type Provider struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change the comment because the provider does not provides UI
yet, isn't it?
Does this mean I can leave my /metrics exposed for Prometheus while still providing auth for dashboard? I was going to open a feature request for that. |
@shadycuz yes but on different entrypoints (not the same port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very proud to be the first one to LGTM this amazing PR 👏 👏 😍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
No more path option like in #1233 ? |
@tcoupin the path option disappear but you can do it like this http://v1-5.archive.docs.traefik.io/configuration/backends/web/#path |
This PR changes the Web Provider implementation.
Now we can find all this "internal" routes separately
Moreover, all this part, are configured on a entry point.
By doing it like this, we can use auth, whitelister etc.. for all internal routes.
We can attach those internal routes to the same entry point as the reverse proxy entry point