fbonalair / traefik-crowdsec-bouncer

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

HTML forbidden page #35

Open Maxy-Paulo opened 2 years ago

Maxy-Paulo commented 2 years 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 2 years 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 1 year 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 7 months ago

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