Giter Site home page Giter Site logo

Comments (2)

larsxschneider avatar larsxschneider commented on September 26, 2024 1

This snippet should get the versions from the audit log:

$ zcat -f /var/log/github-audit.log.1* | perl -ne 'print if s/.*agent=git\/(\d+(?:\.\d+){0,2}).*"user_id":(\d+).*/\2\t\1/' | sort | uniq | perl -lape 's/\d+ *//' | sort -r -V | uniq -ic

This should also include SSH connections. However, I wonder should take any Git client into considerations with a regex like this (note: I use the user instead of IP here too):

$ zcat -f /var/log/github-audit.log.1* | perl -ne 'print if s/.*agent=git\/(\d+(?:\.\d+){0,2}).*"user_id":(\d+).*/\2\t\1/' | sort | uniq | perl -lape 's/\d+ *//' | sort -r -V | uniq -ic

Even further we could look for other agents:

$ zcat -f /var/log/github-audit.log.1* | perl -ne 'print if s/.*agent=([^\/" ]+\/\d+(?:\.\d+){0,2}).*"user_id":(\d+).*/\2\t\1/' | sort | uniq | perl -lape 's/\d+ *//' | sort | uniq -ic

This would also record JGit clients and the output would look like this:

      1 	git/2.9.0
      2 	git/2.9.2
      3 	git/2.9.3
      4 	JGit/4.5.0
      5	JGit/4.6.1
      6 	JGit/4.8.0

@pluehne Could that be easily be made compatible with your versions check logic? Could everything not git/* be considered "unknown"?

from hubble.

pluehne avatar pluehne commented on September 26, 2024

@larsxschneider: I just realize that you addressed most of this issue in #185, which we already merged.

However, I like the idea of recording the client agents in git-versions.tsv. We could extend the chart to support a mixed data format (with pure versions or versions prefixed by the client agent). Alternatively, we could also write a data migration that prefixes all older entries with git/ to make them compatible (would allow for a cleaner implementation on the dashboard side). What do you think?

from hubble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.