Commit Graph

454 Commits

Author SHA1 Message Date
Danny van Kooten 4ecaff85ac don't parse database driver from URL to also support mysql and sqlite. 2018-07-31 15:29:15 +02:00
Danny van Kooten 8f4a34282e Merge branch 'feature/database-url' of https://github.com/Calyhre/fathom into Calyhre-feature/database-url
* 'feature/database-url' of https://github.com/Calyhre/fathom:
  Update .env.example
  Add support for FATHOM_DATABASE_URL
2018-07-31 15:09:45 +02:00
Danny van Kooten 62ec1f7d41 add built-in support for letsencrypt using autocert. closes #18 2018-07-31 15:05:34 +02:00
Charley DAVID d1387e4dd1
Update .env.example 2018-07-31 08:41:08 -03:00
Charley DAVID 98970057a2
Add support for FATHOM_DATABASE_URL 2018-07-31 08:41:08 -03:00
Danny van Kooten 773a65ff94 Merge branch 'master' of https://github.com/usefathom/fathom
* 'master' of https://github.com/usefathom/fathom:
  Revert "link[href] is already an absolute URL"
2018-07-30 10:51:25 +02:00
Danny van Kooten e90e100f18 fix query args for batch updating pageviews 2018-07-30 10:51:20 +02:00
Danny van Kooten b6f3be0e8e build postgres dsn string dynamically 2018-07-30 09:33:49 +02:00
Danny van Kooten 98c5487a58
Merge pull request #102 from usefathom/revert-98-patch-5
Revert "link[href] is already an absolute URL", create <a> element for correct parsing.
2018-07-27 09:08:55 +02:00
Danny van Kooten 3418e81ea5
Revert "link[href] is already an absolute URL" 2018-07-27 09:08:25 +02:00
Danny van Kooten fe624a63a1 update all godeps 2018-07-27 09:03:18 +02:00
Danny van Kooten 1c2682878e update github.com/mattn/go-sqlite3 dep 2018-07-27 08:54:46 +02:00
Danny van Kooten d03cdf88f2 Merge branch 'master' of https://github.com/usefathom/fathom
* 'master' of https://github.com/usefathom/fathom:
  link[href] is already an absolute URL
2018-07-27 08:52:58 +02:00
Danny van Kooten 658581b744 show prettier error msg when connecting to database fails 2018-07-27 08:52:53 +02:00
Danny van Kooten c8eef57e2a
Merge pull request #98 from da2x/patch-5
link[href] is already an absolute URL
2018-07-23 07:28:26 +02:00
Daniel Aleksandersen c6ec64a267
link[href] is already an absolute URL
a[href] and link[href] will both normalize to an absolute URL so there is no need to create an extra a element here.
2018-07-23 05:53:13 +02:00
Danny van Kooten 6a27475faf
Merge pull request #96 from SimePel/master
config: split up Parse into LoadEnv & Parse func. Thanks @SimePel!
2018-07-16 10:57:19 +02:00
SimePel 34b7eab555 fix typo 2018-07-16 11:14:30 +07:00
SimePel a301dec1a3 add tests for LoadEnv func 2018-07-15 21:10:26 +07:00
SimePel 64b131f7f5 add separate function for loading env values from file 2018-07-15 21:09:44 +07:00
Danny van Kooten 2ef550bc27 reduce number of memory allocations in hot path 2018-07-15 10:05:03 +02:00
Danny van Kooten b2d881e31b optimize sql generation in datastore.InsertPageviews func. 2018-07-15 09:36:28 +02:00
Danny van Kooten 1fea0dc66f return error from datastore.Close func 2018-07-15 09:20:07 +02:00
Danny van Kooten 1e128e6ad7 use simple for loop in bulk datastore funcs for minor perf improvement 2018-07-15 07:37:45 +02:00
Danny van Kooten e6ee4d0a2e increase buffer size & buffer timeout for collecting pageviews 2018-07-15 07:34:06 +02:00
Danny van Kooten c437f8a221 accept PORT env var for setting server addr (through cascade). #59 2018-07-13 11:49:14 +02:00
Danny van Kooten 19b0ccf5b6 move command declaration into same file as func declaration 2018-07-13 11:48:28 +02:00
Danny van Kooten 82e1216bb3 discard http requests coming from browser prerenders. closes #13 2018-07-12 14:06:07 +02:00
Danny van Kooten a6f9b385a3 option to set sslmode param in postgres & mysql connections using FATHOM_DATABASE_SSLMODE. closes #93 closes #90 closes #80 2018-07-12 13:37:52 +02:00
Danny van Kooten f2683d1f0c buffer insert & updates of pageviews for performance gain under heavy load. closes #24 2018-07-12 13:30:32 +02:00
Danny van Kooten 6eb1d284fd get rid of install script 2018-07-12 09:53:05 +02:00
Danny 42008ab83f get rid of session_id and move knowledge of previous pageview to client. this also gets rid of the (only) index on the pageviews table, allowing for much faster INSERT's. closes #14 2018-07-11 15:03:56 +02:00
Danny d9bce6a0cf set time for dates coming from pikaday too. fixes #88 2018-07-11 14:20:45 +02:00
Danny f7afb8c503 only add path if not already in pagesViewed 2018-07-04 14:43:24 +02:00
Danny van Kooten 37897e9d35 stop sending document title from client, since it is not used right now 2018-06-28 10:37:21 +02:00
Danny van Kooten 9b47ee27ef parse hostname from client instead of relying on http header. fixes #79 2018-06-28 10:37:02 +02:00
Danny van Kooten 67308e3348 default to empty path if parsing from <a> fails. #73 2018-06-23 17:45:53 +02:00
Danny van Kooten ad29167db1 Merge branch 'master' of https://github.com/usefathom/fathom
* 'master' of https://github.com/usefathom/fathom: (23 commits)
  improve security and add persistence for MySQL
  Don’t send Referer headers
  set 'Tk: N' header on resources loaded by client. #65
  disregard requests to /collect with DNT header set to '1'.
  expire client-side session at midnight UTC, for now
  print some info regardless of log level
  use mysql Config.FormatDSN to generate dsn conn string for mysql. closes #56 closes #60
  update go mysql driver
  set explicit charset for mysql tables to workaround key limit of 7xx bytes. #58
  don't concat lastSeen in client-side data. fixes #64
  use https in git clone example in readme (because broader compat). closes #63
  set server addr explicitly in docker-compose file
  update docker-compose file
  add instructions on prebuilt docker img to readme
  get rid of old ana screenshot
  add NULLIF in group statement because of go null values = empty string
  fix postgres errors by converting to null in divisions. closes #54 relates to #52
  use absolute url to readme img
  build npm assets in intermedia docker container so we can auto-build from git push. relates to #49 #51
  client-side assets do not need to be built inside docker container. closes #51
  ...
2018-06-23 17:43:46 +02:00
Danny van Kooten 5d99de5813 lower datepicker timeout 2018-06-23 17:43:44 +02:00
Danny van Kooten b6a4401c2c
Merge pull request #71 from o1ek/master
improve security and add persistence for MySQL
2018-06-23 17:41:43 +02:00
o1ek 033c54c58e
improve security and add persistence for MySQL
• add persistence volume for MySQL
• limit MySQL port exposing only to localhost
• add auto-restart
2018-06-16 11:46:22 +03:00
Danny van Kooten 3888882986
Merge pull request #68 from da2x/patch-3
Don’t send Referer headers. Thanks @da2x!
2018-06-14 09:20:25 +02:00
Daniel Aleksandersen 4bed10990e
Don’t send Referer headers
Remove the `Referer` request header when clicking on referrer links in Fathom. This isn’t a public page so keep the secret of its existence.
https://www.w3.org/TR/referrer-policy/#referrer-policy-no-referrer
2018-06-13 21:44:48 +02:00
Danny 844c5996ff set 'Tk: N' header on resources loaded by client. #65 2018-06-13 11:15:18 +02:00
Danny 42cd00b8cd disregard requests to /collect with DNT header set to '1'. 2018-06-13 10:44:33 +02:00
Danny 70d97b03a1 expire client-side session at midnight UTC, for now 2018-06-13 10:32:50 +02:00
Danny e795eb1ac1 print some info regardless of log level 2018-06-13 10:10:56 +02:00
Danny 7f61259df3 use mysql Config.FormatDSN to generate dsn conn string for mysql. closes #56 closes #60 2018-06-13 10:04:42 +02:00
Danny 0be328ddc0 update go mysql driver 2018-06-13 10:03:48 +02:00
Danny 958e653b1f set explicit charset for mysql tables to workaround key limit of 7xx bytes. #58 2018-06-13 09:56:32 +02:00