Commit Graph

475 Commits

Author SHA1 Message Date
Uku Taht
9f446c83fd Use ENVIRONMENT for sentry in runtime config 2020-05-28 21:31:38 +03:00
Uku Taht
5d0fec2016 Use Bamboo local adapter by default 2020-05-28 10:50:40 +03:00
Uku Taht
7916e6f44e URL generation and configuration 2020-05-28 10:41:09 +03:00
Uku Taht
3b3d4d41b0 Configure SSL for database 2020-05-27 16:03:30 +03:00
Uku Taht
ecd30e2892 Bump elixir version 2020-05-27 14:11:42 +03:00
Chandra Tungathurthi
5eb8929929
Support for docker based self-hosting (#64)
* first commit with test and compile job

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* adding 'prepare' stage

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* updated ci script to include "test" compile phase

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* adding environment variables for connecting to postgresql

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* updated ci config for postgres

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* using non-alpine version of elixir

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* re-using the 'compile' artifacts and added explict env variables for testing

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* removing redundant deps fetching from common code

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* formatting using mix.format -- beware no-code changes!

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* added release config

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* adding consistent env variable for Database

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* more cleaning up of environment variables

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Adding releases config for enabling releases

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* cleaning up env configs

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Cleaned up config and prepared config for releases

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* updated CI script with new config for test

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Added Dockerfile for creating production docker image

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Adding "docker" build job yay!

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* using non-slim version of debian and installing webpack

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Adding overlays for migrations on releases

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* restricting the docker built to master branch only

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* typo fix

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* adding "Hosting.md" to explain hosting instructions

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* removed the default comments

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Added documentation related to env variables

* updated documentation and fixed typo

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* updated documentation

* Bumping up elixir version as `overlays` are only supported in latest version

read release notes: https://github.com/elixir-lang/elixir/releases/tag/v1.10.0

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Adding tarball assembly during release

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* updated HOSTING.md

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Added support for db migration

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* minor corrections

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* initializing admin user

Admin user has been added in the "migration" phase. A default user is automatically created in the process. One can provide the related env variables, else a new one will be automatically created for you.

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Initial base domain update - phase#1

These changes are only meant for correct operating it under self-hosting. There are many other cosmetic changes, that require updates to email, site and other places where the original website and author is used.

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Using dedicated config variable `base_domain` instead

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* adding base_domain to releases config

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* removing the dedicated config "base_domain", relying on endpoint host

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Removed the usage of "Mix" in code!

It is bad practice to use "mix" module inside the code as in actual release this module is unavailable. Replacing this with a config environment variable

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Added support for SMTP via Bamboo Smtp Adapter

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Capturing SMTP errors via Sentry

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Minor updates

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* Adding junit formatter -- useful for generating test reports

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* adding documentation for default user

* Resolve "Gitlab Adoption: Add supported services in "Security & Compliance""

* bumping up the debian version to fix issues

fixing some vulnerabilities identified by the scanning tools

* More updates for self-hosting

Changes in most of the places to suit self-hosting. Although, there are some which have been left-off.

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* quick-dirty-fix!

* bumping up the db connect timeout

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* bumping up the db connect timeout

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* bumping up the db connect timeout

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* bumping up timeout - skipping MRs :-/

* removing restrictions on watching for changes

this stuff isn't working

* Update HOSTING.md

* renamed the module name

* reverting formatting-whitespace changes

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* reverting the name to release

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* adding docker-compose.yml and related instructions

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* using `plausible_url` instead of assuming `https`

this is because, it is much to test in local dev machines and in most cases there's already a layer above which is capable for `https` termination and http -> https upgrade

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* WIP: merging changes from upstream

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* wip: more changes

* Pushing in changes from upstream

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* changes to ci for testing

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* cleaning up and finishing clickhouse integration

Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>

* updating readme with hosting details
2020-05-26 16:09:34 +03:00
Uku Taht
89e807b469 Handle errors better 2020-05-26 13:40:49 +03:00
Uku Taht
34de4d5d2e Log any error from clickhouse 2020-05-26 12:35:03 +03:00
Uku Taht
43b46e7607 Show last touch referrer for drilldown 2020-05-25 14:52:20 +03:00
Uku Taht
bda08df7b5 Get goal referrers from sessions table 2020-05-25 14:29:41 +03:00
Uku Taht
a228c6162f Default to empty pathname 2020-05-25 12:25:41 +03:00
Uku Taht
0524ac92c2 Fix error loggin in Clickhouse 2020-05-25 11:57:11 +03:00
Uku Taht
b31c0114c5 Use Clickhouse everywhere 2020-05-22 12:33:17 +03:00
Uku Taht
439a4a80c7 Escape quote in event name 2020-05-21 19:14:45 +03:00
Uku Taht
ee4f604712 Update hydrate command 2020-05-21 19:08:39 +03:00
Uku Taht
578523170f Query via clickhouse 2020-05-21 18:59:07 +03:00
Uku Taht
4800cc6cf7 Escape everything 2020-05-21 16:19:28 +03:00
Uku Taht
1087742fea Clean after itself 2020-05-21 15:55:46 +03:00
Uku Taht
d83ec7b6a1 Report progress 2020-05-21 14:53:09 +03:00
Uku Taht
a8c1fa2ea6 Escape quote in sessions 2020-05-21 14:30:04 +03:00
Uku Taht
ea53daeaac Hydrate historical data 2020-05-21 14:06:14 +03:00
Uku Taht
0ccb893c04 Ingest with new CH schema 2020-05-21 13:36:53 +03:00
Uku Taht
d94a8dbc7e
Clickhouse (#66)
* Get stats from clickhosue

* Pull stats from clickhouse

* Use correct Query namespace

* Use Clickhouse in unit tests

* Use Clickhouse in stats controller tests

* Use fixtures for unit tests

* Add Clickhouse to travis

* Use Clickhouse session store for sessions

* Add garbage collection to session store

* Reload session state from Clickhouse on server restart

* Query from sessions table

* Trap exits in event write buffer

* Run hydration without starting the whole app

* Make session length 30 minutes

* Revert changes to fingerprint schema

* Remove clickhouse from fingerprint sessions

* Flush buffers before shutdown

* Use old stats when merging

* Remove old session schema

* Fix tests with CH sessions

* Add has_pageviews? to Stats

* Use CH in staging

* Update schema

* Fix test setup
2020-05-21 13:03:39 +03:00
Rimenes Ribeiro
eeb54c4575
Ignore Elixir Language Server files. (#65) 2020-05-21 12:36:03 +03:00
Uku Taht
ed21775768 Update elixir 2020-05-21 11:10:41 +03:00
Marko Saric
60ed0a9201
Update README.md 2020-05-19 15:58:51 +02:00
Marko Saric
b982f43a00
Update README.md 2020-05-19 15:57:08 +02:00
Uku Taht
f7180f9620 Don't track wrong password page 2020-05-19 16:20:21 +03:00
Uku Taht
e7cd441a43 Skip tracking on share email 2020-05-19 16:18:26 +03:00
Uku Taht
f587e348cd Update contact form and email addresses 2020-05-18 16:20:00 +03:00
Uku Taht
c27119b03e Fix price in email 2020-05-18 13:08:18 +03:00
Uku Taht
d1b703f007
Clickhouse (#63)
* Get stats from clickhosue

* Pull stats from clickhouse

* Use correct Query namespace

* Use Clickhouse in unit tests

* Use Clickhouse in stats controller tests

* Use fixtures for unit tests

* Add Clickhouse to travis

* Use Clickhouse session store for sessions

* Add garbage collection to session store

* Reload session state from Clickhouse on server restart

* Query from sessions table

* Trap exits in event write buffer

* Run hydration without starting the whole app

* Make session length 30 minutes

* Revert changes to fingerprint schema

* Remove clickhouse from fingerprint sessions

* Flush buffers before shutdown

* Use old stats when merging

* Remove old session schema

* Fix tests with CH sessions

* Add has_pageviews? to Stats
2020-05-18 12:44:52 +03:00
Uku Taht
d366dee08a Do not track header 2020-05-11 14:27:20 +03:00
Uku Taht
6b53b4fbb5 Fix email login link 2020-05-09 00:25:57 +03:00
Uku Taht
a712a583ee Fix typo 2020-05-07 16:22:10 +03:00
Uku Taht
3faec27c82 Fix clickhouse buffer inserts 2020-05-07 14:53:06 +03:00
Uku Taht
b76f5e728a Log write buffer as info 2020-05-07 14:31:34 +03:00
Uku Taht
5d1dc0d27c
Clickhouse DB (#62)
* WIP

* Get all stats from Clickhouse

* Use https dependency

* Do not namespace db tables in hydrate task

* Update hydration task

* Ingest data to clickhouse

* Double-write to both Clickhouse and Postgres

* Add test setup

* Keep old stats module

* Prepare for live ingestion test
2020-05-07 14:28:41 +03:00
Uku Taht
9f7b5b9533 Only delete subscription if it exists
Fixes #61
2020-05-07 14:26:22 +03:00
Uku Taht
4a1a5f9b3b Allow paused subscription status 2020-04-25 08:53:49 +03:00
Uku Taht
6de23e4b94 Remove jumpiness from when conversions are loaded 2020-04-23 10:58:04 +03:00
Uku Taht
2db1289c92 Fix button styling on Safari 2020-04-22 11:42:53 +03:00
Uku Taht
9476ccf95c
Yearly billing (#58)
* Add yearly billing options

* Add new subscription names

* Add note about yearly billing in the email

* Add a test for change_plan function

* Add allowance function back in

* Test billing controller endpoint
2020-04-21 14:11:38 +03:00
Uku Taht
55ca459bb2 Update deps 2020-04-21 14:03:33 +03:00
pmhoudry
22a2eae940
Correctly position more links on mobile (#56)
The more links are absolutely positioned. It works fine on desktop when
there is two columns. On mobile, the absolute sends the more links on
top of each other on top of the column. Adding a simple "relative" class
on each cards that contains a more link ensures that they stay when
they belong.
2020-04-21 10:57:18 +03:00
pmhoudry
f52aac6a31
Correctly position websites list on mobile (#57)
On mobile, the website list at /sites does not have any X padding. The
elements touch the screen left and right. This corrects it by wrapping
the list in a div with "px-4" on it.

This could also be achieved by setting "px-4" and "md:px-0" on every
element but it is unecessarily complex and if some more elements
appeared on this screen, it would be easy to forget this. A container
should be in charge of this, which is what is proposed here.
2020-04-21 10:56:12 +03:00
Marshall Bowers
bed7cc1ec7
Exclude loopback addresses from analytics (#55) 2020-04-20 18:27:54 +03:00
Uku Taht
454feec36e Fix email link 2020-04-15 10:05:19 +03:00
Uku Taht
4163d2a9ba
Authentication updates (#54)
* Use separate cookie for shared link auth

* Remove CSRF protection from login and register pages

* Add AuthorizeStats Plug

* Fix tests
2020-04-14 14:04:35 +03:00
Uku Taht
75ac1dcc3a Use plausible.nolt.io 2020-04-13 17:54:47 +03:00