pingvin-share icon indicating copy to clipboard operation
pingvin-share copied to clipboard

🚀 Feature: Write logs to file

Open ipod86 opened this issue 1 year ago • 4 comments

🔖 Feature description

Hello,

it would be a handy feature if the log was also written to a file and not just to the stdout.

🎤 Pitch

The log could be processed by other programs. For example, you could monitor failed logins with fail2ban and block the IP.

ipod86 avatar Sep 06 '24 08:09 ipod86

ill try to make somthing like this for u

COMPLEXWASTAKEN avatar Nov 26 '24 17:11 COMPLEXWASTAKEN

ill try to make somthing like this for u

nvm it is not easy to add this because its using the logger from nextjs common without rewriting the whole logging system

COMPLEXWASTAKEN avatar Nov 26 '24 18:11 COMPLEXWASTAKEN

you have still 2 ways of using fail2ban.

  1. using a reverse proxy like swag

swag is writing logs for all access to all backends. it generates "401" entries for a failauth in pingvin. this entry can be parsed in fail2ban nginx jail config. so the src failing ip is banned on the reverse proxy

  1. you can use the docker container json log (std output of authfails are here) caveat is that you have to script a stable link to the changing docker id json files. i.e. /var/lib/docker/containers/b5beece1189ec98d16a99dc57bc16726778d859f3dcdef14ddfe80b10683999e/b5beece1189ec98d16a99dc57bc16726778d859f3dcdef14ddfe80b10683999e-json.log

for me its running perfect with swag in docker container

arcusbude avatar Dec 23 '24 12:12 arcusbude

fail2ban can use syslog too so if you use systemd to run pingvin you can simply set the systemd unit to log to syslog (if it's not already being done).

for docker, you can set the log driver to syslog and all the stdout log from the container will be sent to syslog, which fail2ban can pick up.

Arteneko avatar Jan 23 '25 12:01 Arteneko