1. 18 Dec, 2020 4 commits
    • Philipp Winter's avatar
      Fix bug where test cache timeout was ignored. · 5a0e7d48
      Philipp Winter authored
      When bridgestrap read its cache from disk, it wouldn't only read the
      cache entries but also the cache timeout, overriding whatever we
      provided over the command line.  In other words, if bridgestrap saved a
      cache whose timeout was set to 24h, and we later restart bridgestrap
      with a given cache timeout of 18h, it would use 24h because that's what
      it read from disk.
      
      This patch fixes this bug in two ways: 1) we no longer write the cache
      timeout to disk and 2) we set the cache timeout after reading the cached
      entries from disk.
      5a0e7d48
    • Philipp Winter's avatar
      Collect Tor's event types. · c93fde23
      Philipp Winter authored
      This patch is a follow-up commit to #10.
      c93fde23
    • Philipp Winter's avatar
      Reduce default cache timeout to 18 hours. · 0db35d80
      Philipp Winter authored
      It's important that bridgestrap's cache timeout is less than or equal to
      rdsys's pluggable transport expiry time.  If bridgestrap expires cache
      entries after 24 hours and rdsys wants to re-test bridges after 18
      hours, then there's a worst case of a 6 hour window within which
      bridgestrap will refuse to re-test rdsys's bridges because they're still
      in the cache.  Rdsys will keep bothering bridgestrap because it wants a
      more recent test result.
      
      This patch reduces bridgestrap's default cache timeout to 18 hours,
      which is the number of hours after which bridges should re-upload their
      descriptors to the bridge authority:
      https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt?id=c2a584144330239d6aa032b0acfb8b5ba26719fb#n369
      0db35d80
    • Philipp Winter's avatar
      Add more extensive logging. · 5683956c
      Philipp Winter authored
      This patch 1) makes obfs4proxy log its output to file and 2) adds a log
      message that prints the error message (if any) after sending a "SIGNAL
      ACTIVE" tor tor.
      5683956c
  2. 14 Dec, 2020 1 commit
  3. 11 Dec, 2020 1 commit
    • Philipp Winter's avatar
      Try waking up tor before giving it new bridges. · 88d8f0a8
      Philipp Winter authored
      By default, tor goes to sleep after 24 hours of no user activity.
      Bridgestrap's control port interaction does not count as user activity,
      which means that tor effectively stops working after 24 hours.  To work
      around this, we're sending tor a SIGNAL ACTIVE, which wakes up tor in
      case it went to sleep.  This is a cheap thing to do, so we might as well
      do it before each SETCONF.
      
      This patch fixes #12.
      88d8f0a8
  4. 07 Dec, 2020 1 commit
  5. 03 Dec, 2020 1 commit
  6. 01 Dec, 2020 1 commit
    • Philipp Winter's avatar
      Make metrics more idiomatic to Prometheus. · e3135a66
      Philipp Winter authored
      Our metrics aren't implemented in the way Prometheus recommends.  This
      patch makes use of labels and renames our metrics to change that.  For
      example, instead of having two metrics called cache_hits and
      cache_misses, we now have a single metric called cache_total and it
      accepts a "type" label that can take on the values "hit" or "miss".
      
      This patch fixes #10.
      e3135a66
  7. 30 Nov, 2020 1 commit
    • Philipp Winter's avatar
      Add +1 to the final bucket. · 76dfe653
      Philipp Winter authored
      Our timeout is set to 60 by default, so the actual execution time is 60
      + a few milliseconds.  Adding +1 to the final bucket covers that case.
      76dfe653
  8. 26 Nov, 2020 1 commit
  9. 25 Nov, 2020 1 commit
  10. 23 Nov, 2020 1 commit
  11. 21 Nov, 2020 3 commits
    • Philipp Winter's avatar
      Fix broken unit test. · 05811608
      Philipp Winter authored
      05811608
    • Philipp Winter's avatar
      Implement Prometheus-based metrics. · 337a3afa
      Philipp Winter authored
      The way Prometheus works is that a central instance scrapes metrics from
      various endpoints, bridgestrap being one of them.  We expose a new HTTP
      handler for /metrics and let our Prometheus library do the rest.
      
      This patch fixes #4
      337a3afa
    • Philipp Winter's avatar
      Use channel-based request dispatcher. · cf1bce74
      Philipp Winter authored
      So far, bridgestrap would serialise requests by relying on a mutex's
      locking mechanism.  That's dirty.  This patch implements a channel-based
      dispatching mechanism that guarantees order (mutexes don't).  In
      addition to that, we can now log the number of outstanding requests,
      which is good to know.
      cf1bce74
  12. 20 Nov, 2020 5 commits
  13. 19 Nov, 2020 5 commits
  14. 18 Nov, 2020 3 commits
  15. 16 Nov, 2020 5 commits
  16. 13 Nov, 2020 1 commit
  17. 12 Nov, 2020 1 commit
  18. 20 Oct, 2020 1 commit
  19. 15 Oct, 2020 3 commits