Commit Graph

33 Commits

Author SHA1 Message Date
Cenk Kücük
0c40042d8e
Update Clickhouse version in CI (#4617)
* Update Clickhouse version in CI

* update order

* Update clickhouse image

* Update Makefile
2024-10-11 00:13:59 +01:00
hq1
c81cb16933
Snippet integration verification (#4106)
* Allow running browserless.io locally

* Compile tailwind classes based on extra/ too

* Add browserless runtime configuration

* Ignore verification events on ingestion

* Improve extracting HTML text in tests

* Update dependencies

- Floki will be used on production to parse site contents
- Req will be used to handle redundant stuff like retrying etc.

* Add shuttle SVG to generic components

Later on we'll use it to indicate verification errors

* Connect live socket & allow skipping awaiting the first pageview

* Connect live socket in general settings

* Implement verification checks & diagnostics

* Stub remote services with Req for testing

* Change snippet screen copy

* Update tracker script, so that:

1. headless browsers aren't ignored if `window.__plausible` is defined
2. callback optionally supplies the event response HTTP status

This will be later used to check whether the server acknowledged
the verification event.

* Implement LiveView verification UI

* Embed the verification UIs into settings and onboarding

* Implement browserless puppeteer verification script

It:
 - tries to visit the site
 - defines window.__plausible, so the tracker doesn't ignore test events
 - sends a verification event and instruments the callback
 - awaits the callback to fire and returns the result

* Improve diagnostics for CSP

Only report CSP error if the snippet is already found

* Put verification behind a feature flag/env setting

* Contact Us hint only for Enterprise Edition

* For headless code, use JS context instead of EEx interpolation

* Update diagnostics test with WordPress scenarios

* Shorten exception/throw interception

* Rename test

* Tidy up

* Bust URL always on headless check

* Update moduledoc

* Detect official Plausible WordPress Plugin

and act accordingly on diagnostics interoperation

* Stop using 'rating' in favour of 'interpretation'

* Only report CSP error if no proxy is likely

* Update CHANGELOG

* Allow event-* attributes on snippet elements

* Improve naive GTM detection, not to confuse it with GA4

* Update lib/plausible/verification.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Update test/plausible/site/verification/checks_test.exs

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* s/perform_wrapped/perform_safe

* Update lib/plausible/verification/checks/installation.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Remove garbage

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-05-23 15:00:50 +02:00
Cenk Kücük
39cf8c4179
Upgrade Clickhouse version in CI (#4062)
* Update elixir.yml

* Fix error

See https://github.com/ClickHouse/ClickHouse/issues/62431#issuecomment-2090283419

* fix order to pass test

* Revert "fix order to pass test"

This reverts commit d79fbeb297.

* Update Makefile

Update CH version
2024-05-13 21:53:29 +02:00
Adrian Gruntkowski
c1c03b729c
Reapply "Local CSV exports/imports and S3/UI updates (#3989)" (#3995) (#3996)
* Reapply "Local CSV exports/imports and S3/UI updates (#3989)" (#3995)

This reverts commit aee69e44c8.

* remove unused functions

* eh, that one was actually used

* ugh, they were both used

---------

Co-authored-by: ruslandoga <67764432+ruslandoga@users.noreply.github.com>
2024-04-11 09:15:01 +02:00
Adrian Gruntkowski
aee69e44c8
Revert "Local CSV exports/imports and S3/UI updates (#3989)" (#3995)
This reverts commit 1a0cb52f95.
2024-04-09 21:26:23 +02:00
ruslandoga
1a0cb52f95
Local CSV exports/imports and S3/UI updates (#3989)
* local CSV exports/imports and S3 updates

* credo

* dialyzer

* refactor input columns

* fix ci minio/clickhouse tests

* Update lib/plausible_web/live/csv_export.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* fix date range filter in export_pages_q and process only pageviews

* remove toTimeZone(zero_timestamp) note

* use SiteImport.pending(), SiteImport.importing()

* escape [SiteImport.pending(), SiteImport.importing()]

* use random s3 keys for imports to avoid collisions (sometimes makes the upload get stuck)

* clamp import date ranges

* site is already in assigns

* recompute cutoff date each time

* use toDate(timestamp[, timezone]) shortcut

* show alreats on export cancel/delete and extract hint into a component

* switch to Imported.clamp_dates/4

* reprocess tables when imports are added

* recompute cutoff_date on each call

* actually use clamped_date_range on submit

* add warning message

* add expiry rules to buckets in make minio

* add site_id to imports notifications and use it in csv_importer

* try/catch safer

* return :ok

* date range is not available when no uploads

* improve ui and warning messages

* use Generic.notice

* fix flaky exports test

* begin tests

* Improve `Importer` notification payload shape

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-04-09 20:59:48 +02:00
ruslandoga
5e74b1cf74
CSV exports (UI) (#3875)
* ui

* fix redirect link

* improve make minio

* use implicit button form for csv export

* add exports_bucket helper

* read S3_EXPORTS_BUCKET

* supply s3_bucket in export_csv job args

* make plausible_minio use unprotected port

* move s3_csv_export queue to base queues

* Update lib/plausible_web/controllers/site_controller.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-03-18 08:52:57 +01:00
ruslandoga
f3423aefec
Add csv importer (#3795)
* add csv importer

* make table validation explicit

* update some docs

* improve docs

* add minio container to ci

* more tests

* eh

* continue

* add passing test

* add failing test

* add config test

* add minio to Makefile

* testcontainers

* remove extra whitespace

* explain the implementation a bit

* account for async deletes in tests

* bounces is UInt32

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-02-27 14:19:09 +01:00
Arkadiusz Plichta
4ec86abeac
update clickhouse docker image (#3701) 2024-01-17 15:32:12 +00:00
hq1
edd2757531
Expose 9000 for native clickhouse protocol (dev mode) (#3162)
* Expose 9009 for native clickhouse protocol (dev mode)

* s/9009/9000
2023-07-19 10:23:31 +02:00
Cenk Kücük
13a38aee14
upgrade clickhouse (#3113) 2023-07-11 13:54:50 +02:00
Cenk Kücük
f374650330
Postgres upgrade (#3062)
* Update list to the last 3 versions of postgres

* Update postgres prod version
2023-06-30 14:01:12 +02:00
Adam Rutkowski
ac1f44f89a
Bump clickhouse images to 22.8.13.20-alpine (prod/CI) (#2660)
* Bump clickhouse images to 22.8.13.20-alpine (prod/CI)

* !fixup

* Remove clickhouse-ci target
2023-02-09 08:11:03 +01:00
ruslandoga
8640ba499f
fix clickhouse-ci rule in Makefile (#2614) 2023-01-20 10:52:39 -03:00
Adam Rutkowski
0c23e6ec57
Update Makefile with tracker generation (#2356) 2022-10-24 07:52:15 -03:00
ruslandoga
3db2b1cbd7
update clickhouse and postgres images in Makefile (#2343)
* update clickhouse and postgres images in Makefile

* update .PHONY
2022-10-18 17:13:59 +02:00
RobertJoonas
38d5e00442
update contributing.md and makefile to install tracker deps (#2322) 2022-10-11 14:24:26 +02:00
Uku Taht
519a1fa669
Add script to send pageview (#2272)
* Add script to send fake pageviews

* Fix option typo

* Remove dummy_event from .PHONY in Makefile
2022-09-27 17:58:22 +03:00
Adam Rutkowski
12c2469745
Pin clickhouse image to 21.11.3.6 (#2175) 2022-09-06 09:56:22 +03:00
Adam Rutkowski
45cc1d27a1
Fix dev environment startup errors (#1990)
* Include gelocation DB download in the development workflow

* Make sure `tls_certificate_check` is started ASAP

This prevents `:application_either_not_started_or_not_ready` errors
on application startup.

* Mark Makefile targets as PHONY

By default Make assumes the targets are files,
in this case none of them are.
2022-07-06 17:47:31 +03:00
Ru
7505584cf8
ARM64 dev support (#1863)
* chore(docker): improve repeat contributions workflow

* This change adds two new commands to gracefully stop and remove the Postgres and Clickhouse docker containers. To do so, it also gives them a recognizable name.

* Additionally, the Postgres container is updated to use a named volume for its data. This lower friction for repeat contributions where one would otherwise sign up and activate their accounts again and again each time.

* Apple M1 compatibility for local development

* Patch upgrade for Python to a version that is built without errors
* Use a new community image for clickhouse that's ARM64 compatible
* Update contribution docs
2022-04-27 21:52:12 +03:00
Uku Taht
06b165eb6d Run GA import in monthly batches 2022-04-08 08:43:07 +03:00
Uku Taht
d40faf6ec7 More datepicker improvements 2022-03-31 16:47:19 +03:00
Uku Taht
0d327d6dbf Remove Referer header from example curl 2022-03-31 09:00:05 +03:00
Uku Taht
f92e26c68f Update Makefile 2022-03-30 10:26:19 +03:00
Uku Taht
7b28debc3d Update Makefile 2022-03-30 10:25:12 +03:00
RobertJoonas
4742e05ab1
Allow URLs without hostname setting it to (none) (#1335) 2021-09-16 10:05:43 +02:00
Ru Singh
c95d375839
Fix for details button misbehaving on mobile (#1114)
* chore(make): convenience commands for installation & dev server

* docs: easier development env instructions

* docs: add note about docker volumes

* docs: detail pre-commit configuration

* style: eslint and prettier changes

* Allow for passing custom classes to fade-in

* style: eslint & prettier for the details button component

* style: react lifecycle methods to come first

* docs: add instructions to disable pre-commit

* style: devices components

* Move render methods to the last (together) in the order list
* Remove unused component import
* React lifecycle to come first before our own methods
* General styling and eslint changes
* Cleaner renderContent method using switch/case (fixes an eslint error as well!)
* Cleaner renderPill method with proper spacing + removing uncessary else

* style: more eslint/prettier for pages components

* Use newer Fragment syntax
* Remove unnecessary else statement
* Use backtick strings for concatenating strings
* Remove unnecessary space
* Remove unused imports and variable declarations
* Bunch render methods together as last in the order list

* fix: details button to drop to the bottom naturally on smaller screens

This _mostly_ fixes one of the issues being tracked on #972, titled "Details button issue on Firefox specifically"

* refactor: reduce usage of our CSS class in favor of tailwind's util classes

* refactor: remove our css classes in favor of Tailwind's util classes
2021-06-15 10:34:43 +03:00
Ru Singh
7153b366e5
chore(docker): improve repeat contributions workflow (#1057)
* This change adds two new commands to gracefully stop and remove the Postgres and Clickhouse docker containers. To do so, it also gives them a recognizable name.

* Additionally, the Postgres container is updated to use a named volume for its data. This lower friction for repeat contributions where one would otherwise sign up and activate their accounts again and again each time.
2021-05-19 16:49:39 +03:00
Ru Singh
820357f7ca
Specify clickhouse and postgres versions for local development. (#1039)
This PR solves #1017.
2021-05-17 10:49:04 +03:00
Johan Fagerberg
f7885a93d7
Change Docker volume used by Clickhouse to a local directory (#404)
Previously it would pollute the users home directory
2020-11-10 13:49:50 +02:00
Johan Fagerberg
3ff2c79b33
Update contribution guidelines (#403)
* Update contribution guidelines to include dependency installation

Now mentions the required system dependencies, and the step for installing Elixir deps
Erlang is used by the :gettext dependency, and ecto.create will fail if it is not present

* Make Clickhouse and PostgreSQL containers run in detached mode

This ensures that they run in the background so that they are present during the follow steps
2020-11-10 10:58:49 +02:00
Dennis Tel
f490e8de52
task: Add CONTRIBUTING.md with development setup instructions (#395)
* task: Add CONTRIBUTING.md with development setup instructions

* Add --prefix assets to npm install instructions

Co-authored-by: Dennis Tel <dennis@aiden.cx>
2020-11-05 13:43:24 +02:00