NHAS / wag

Simple Wireguard 2FA
BSD 3-Clause "New" or "Revised" License
499 stars 27 forks source link

Possibility to customize MFA Portal #36

Closed bluecraank closed 1 year ago

bluecraank commented 1 year ago

At the moment, i have to download source and customize template files.

Maybe it is possible, that the compiled version looks for a folder where templates are in

NHAS commented 1 year ago

How are you customising the template files?

At the moment I'm looking to not add new features for a while and make the design and feel of the various UI elements of wag more consistent. So I cant promise that this will be something Im going to do any time soon, or at all.

More context is always useful tho :)

bluecraank commented 1 year ago

We have a specific design and would like to do the same with the MFA Portal. Therefore it would be great if you could specify in the config what the template files are to overwrite the HTML

NHAS commented 1 year ago

Im planning on wrapping this up into the 6.x.x release Im doing soon. Is allowing you to define your own CSS for it enough? Or would you like complete control (as thats a bit harder for me to make)

bluecraank commented 1 year ago

Hello,

i would prefer full control. You could create a template folder and check if there are any files for overwriting design, this should not be so hard to make

NHAS commented 1 year ago

Yep I have a method in mind. You can look forward to this in the next couple days all things going well

NHAS commented 1 year ago

I have added this in the latest pre-release. Please give it a shot and tell me if this suites, if it does I'll do a full release.

https://github.com/NHAS/wag/releases/tag/v6.1.2-pre-release

bluecraank commented 1 year ago

How to use css and more?

NHAS commented 1 year ago

Please read the documentation.

bluecraank commented 1 year ago

I did, at the moment u can not add javascript / css files to template folder. Using other sources for css/js is not allowed (style-src webserver restriction) So the only way is inline css?

bluecraank commented 1 year ago

Oh even inline styles not working :(

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' fonts.googleapis.com". Either the 'unsafe-inline' keyword, a hash ('sha256-QK8bSv1dlnwrOBpQEtdh0AtJ1yALgA+MYljY7NkQMGU='), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.
NHAS commented 1 year ago

Yep that's how csps work.

I'll look at adding a css and js folders in the template directory.

bluecraank commented 1 year ago

Yeah, i now building wag myself and added the style files into the static folder.