kereis / traefik-certs-dumper

Dumps Let's Encrypt certificates of a specified domain which Traefik stores in acme.json.
Apache License 2.0
129 stars 24 forks source link

Log files are flooded #90

Closed ggruening closed 2 years ago

ggruening commented 2 years ago

Expected Behavior

In the case of an incorrect configuration, I find a (=one) clear error message in the log files.

Current Behavior

Under certain conditions, the log files are flooded with an infinite number of identical error messages.

Possible Solution

Catch the errors in the "infinity" loop, something like:

while true; do
  if [[ -f ${acme_file_path} ]]; then
    inotifywait -qq -e modify "${acme_file_path}"  
    if [[ $? -eq 0 ]]; then
      dump
    fi
  fi
done

I could provide a pull request later this day if desired.

Steps to Reproduce

  1. Use the development environment setup
  2. Edit docker-compose.yaml: mount a directory, that doesn't exist
  3. Watch the logs

Why this matters

If the log file rotation is not configured or not configured correctly, every vServer will fill up in a few days and will be in a critical state.