fbonalair / traefik-crowdsec-bouncer

A http service to verify request and bounce them according to decisions made by CrowdSec.
MIT License
263 stars 21 forks source link

HTML forbidden page #35

Open Maxy-Paulo opened 1 year ago

Maxy-Paulo commented 1 year ago

Hello, I tried a sample HTML code as a return from the bouncer when blocked. But, It's showed on the browser as plain text and not HTML page.

Is it planned to switch the bouncer reply to HTML ?

2022-09-28 14_05_00

CROWDSEC_BOUNCER_BAN_RESPONSE_MSG = "<!DOCTYPE html><html lang=\"en\"><head><title>403</title></head><body><h1>403</h1><h2>Access forbidden !</h2></body></html>"

fbonalair commented 1 year ago

Right now, the response from the bouncer is hardcoded to be a text, that's why in the Response Header the content-type is text/plain and the browser interpret that raw.
I have checked the underlying framework, it would be possible to read a HTML template file and send that to end user. If the environment variable change to CROWDSEC_BOUNCER_BAN_RESPONSE and you put your HTML template file path there instead, would that work for you?
I can't give any estimate time of arrival though.

joehill1810 commented 9 months ago

Is there any update on if this is feasible or not? I have tried the above but it did not work for me. I know it's a fairly low-priority addition, but it would make it nicer

RedJohn14 commented 4 months ago

Hello @fbonalair that would be great any news on this?