truecharts/charts

Replace traefik chain for custom-app to support applications, which need cors

breucode opened this issue · 5 comments

Is your feature request related to a problem?

I installed a custom-app on truecharts. Basically, it is a rest backend for a website.
Therefore I need cors to be properly configured.

In general, there are two options to solve this.

  1. The app itself sends the headers and traefik forwards them.
  2. Traefik sends the headers

Currently, none of these options work, because the chain-basic chain, which contains the basic-secure-headers middleware overrides the cors headers of my application. I also can't use the tc-opencors-chain, because the chain-basic has precedence over it and can't be removed.

Describe the solution you'd like

I would like to be able to unset default middlewares for custom-app, so I can put together the middlewares I would like (setting up a custom chain and using it or using the predefined tc-opencors-chain).

Describe alternatives you've considered

One alternative for my particular problem would be to set custom headers in custom-app, but this solution doesn't seem elegant to me.

Additional context

No response

I've read and agree with the following

  • I've checked all open and closed issues and my request is not there.
  • I've checked all open and closed pull requests and my request is not there.

Afaik we indeed removed the option to disable this and it will not be re-added.

custom-app and external-service are “might work for you” apps. Not things we plan to put much time for features into…

One day custom-app might be reworked. But not anytime soon

Also: cors IS properly configured.

I don't understand what you mean by "cors IS properly configured". Of course it is configured via the basic-secure-headers middleware. But for me this is not proper, because it makes my service unusable, as traefik overrides all the cors headers from my application.

All in all, custom-app is not usable for api backends, which receive browser requests from a different origin.

In my setup (server at home, which means nating port 80 and 443 to truenas), I can only use the truecharts traefik. Not being able to configure things like cors means, I can't run my own backends in my home network.

If there is any solution, which might not require lots amounts of work on your side, I would highly appreciate the effort.

In this context, I also don't understand, why we configure a custom chain in the traefik app, when it is not usable. Or is there something I misunderstand here?

Another solution would be to enable the usage of custom (https://doc.traefik.io/traefik/middlewares/http/headers/). The I can configure the cors headers myself, provided they are not overridden by basic-secure-headers.

This issue is locked to prevent necro-posting on closed issues. Please create a new issue or contact staff on discord of the problem persists