1. 26 May, 2020 1 commit
  2. 14 May, 2020 3 commits
  3. 11 May, 2020 3 commits
    • Ruggero Cucchiani's avatar
      update source close code · a1d9f8b2
      Ruggero Cucchiani authored
      I am exploring the, now favoured idea of opening and
      closing the watched file on inotify events, on a
      different branch.
      In the meantime I am trying to shift the code closing
      the open file to remove the dangling files I found
      with `lsof`.
      I frankly don't remember why I picked this path, although
      I do remember thinking about the two possibilities: keep
      file open or open and close.
    • Ruggero Cucchiani's avatar
      switch to intermittend file reading · 5608d58f
      Ruggero Cucchiani authored
      This branch will explore the possibility to switch from keeping
      an open file through the watch life to opening the file only
      for reading.
      By looking at the stats I noticed that, in my situation, the
      number of events are quite limited.
      Also, through _lsof_ I noticed that the binary had dangling
      open files.
      In this branch I will try to explore a solution to the above
      through opening and closing the log files with each read.
    • Ruggero Cucchiani's avatar
      update stats report · f6e64df5
      Ruggero Cucchiani authored
  4. 06 May, 2020 1 commit
  5. 05 May, 2020 3 commits
  6. 01 May, 2020 2 commits
  7. 30 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      add stats · e5d9ce33
      Ruggero Cucchiani authored
      I wanted something to keep track of the go routines.
      I am thinking short term (a few days, maybe a week) so I didn't
      really think about scaling the counters for lasting longer
      periods (months).
      The program was **never** designed for high trafic, so that was
      not considered either.
  8. 29 Apr, 2020 1 commit
  9. 27 Apr, 2020 3 commits
  10. 26 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      fix issues · fe135e6a
      Ruggero Cucchiani authored
      * Removed IN_ATTRIB notification.
      * Re-read was not working. Should be fixed now (it worked fine
      * Having debug messages with the matching string ending up in
        the same file they came from would trigger the match again.
        One way would be to be careful about facility and regexp
        pattern. Another way, non exclusive, was to make the match
        string slightly different. Specifically replacing the IP with
        `{address was here}`
      * Fixed some logging call.
  11. 24 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      refactor functions · 97b0c485
      Ruggero Cucchiani authored
      Reorganised functions.
      Moved most functions from main to the structs.
      Updated structs (mostly Source, which is now a separate file).
      Moved syslog code to a separate file.
  12. 23 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      update prototype · c2cf72be
      Ruggero Cucchiani authored
      Changed the configuration structure and added a few elements.
      Introduced syslog logging.
      Switched to wait groups for sync.
  13. 21 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      add prototype · 634dca9f
      Ruggero Cucchiani authored
      Finished a prototype to be tested with my servers.
      It checks multiple sources and add the IP from grepping them
      for abuse pattern into a nftables set.
      The nftables configuration with the set and what to do with it
      should be already up.
      ```nft -f``` will clear the set.
  14. 20 Apr, 2020 1 commit
  15. 19 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      update watch · ef289122
      Ruggero Cucchiani authored
      It didn't work with a real logrotate case.
      Changed some code, fixed some errors.
      Gonna try again and see if it survives a logrotate on one of my
  16. 18 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      add prototype for log reading · 3ccda69d
      Ruggero Cucchiani authored
      Before committing myself to using Inotify, I am going to try it
      out on my systems.
      Especially since the Inotify events aren't what I expect them to
      be; for example `rm` seems to result in a IN_ATTRIB and not
      one of the IN_DELETE* events...
  17. 16 Apr, 2020 1 commit
    • Ruggero Cucchiani's avatar
      add initial experiments with inotify · f1c4d524
      Ruggero Cucchiani authored
      Trying to figure out how to use inotify for watching a log file.
      Not sure yet I will go this way, just having a polling interval
      and checking the file has not changed, might be good enough for