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

[Feature]: options for add files in /oauth2/static/ #2614

Open
devildant opened this issue Apr 22, 2024 · 7 comments
Open

[Feature]: options for add files in /oauth2/static/ #2614

devildant opened this issue Apr 22, 2024 · 7 comments

Comments

@devildant
Copy link

Motivation

My goal is to be able to put images, and files like a manifest file for webapps, in the static directory of oauth2-proxy (/oauth2/static/)
and use this in the login page (override)
<link rel="manifest" href="/oauth2/static/custom/manifest.webmanifest" />

for implementation, mount a volume directory in docker, and indicate via config the path to use as for page override (--custom-templates-dir)
the options could have the following name
--custom-statics-dir

Possible solution

No response

Provider

None

@tuunit
Copy link
Member

tuunit commented Apr 22, 2024

We had similar requests in the past. This to me sounes like feature creep and we most likely aren't going to support this. Use existing solutions dedicated for providing static files like nginx and setup proper routing for your files.

@JoelSpeed any other opinion on this?

@tuunit
Copy link
Member

tuunit commented Apr 22, 2024

Furthermore, don't we already have an option that serves static html files anyway?

--custom-templates-dir string path to custom html templates?

anything further than that like images, css and etc. should be provided from somewhere else

@devildant
Copy link
Author

devildant commented Apr 22, 2024

We had similar requests in the past. This to me sounes like feature creep and we most likely aren't going to support this. Use existing solutions dedicated for providing static files like nginx and setup proper routing for your files.

@JoelSpeed any other opinion on this?

for me it would be a gas factory, having to put an nginx server on the front end.
I use a reverse proxy on Synology but impossible to write the conf.
therefore this would amount to putting an nginx container in front of oauth2-proxy just for images and a manifest file.
Hence my feature request :p

it would just be a matter of being able to bind a volume, and its contents appear in a directory /oauth2/static/custom for example

Furthermore, don't we already have an option that serves static html files anyway?

--custom-templates-dir string path to custom html templates?

anything further than that like images, css and etc. should be provided from somewhere else

yes i use it (--custom-templates-dir) to customize the login and error page and it works well, but unfortunately I cannot define manifest or images for certain meta tag which requires a file on the server (base64 does not work)

I tried to put my images and manifest files in the directory (custom-templates-dir), but I can't find a route to access them

@devildant
Copy link
Author

with the customization of templates it seems logical to me to be able to define static files :)

Copy link
Contributor

This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed.

@github-actions github-actions bot added the Stale label Jun 22, 2024
@devildant
Copy link
Author

...

@github-actions github-actions bot removed the Stale label Jun 24, 2024
@AyanamiAkaha
Copy link

came to this issue searching about why my style isn't applied

Furthermore, don't we already have an option that serves static html files anyway?

Do I understand correctly that this works only for error.html and sign_in.html, and not the associated styles? Is there a way styles can be included? (I thought some sort of including css and js files would be available, if templating is available...)

The only way I managed to get the styling working (without adding yet another reverse-proxy layer for serving static files...) is to include it in the HTML itself, but this requires CSP with style-src: unsafe-inline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants