Commit Graph

3057 Commits

Author SHA1 Message Date
ruslandoga
88144ecdf6
start totp vault early (#4631) 2024-09-27 08:15:53 +00:00
ruslandoga
d2e374ac8c
release v2.1.3 (#4630) 2024-09-26 11:48:18 +00:00
Artur Pata
cac4ad20c9
Allow configuring AuthorizeSiteAccess plug site param (#4597)
* Stop typescript command clearing previous server start output in dev

* Allow auth site access plug to specify that domain is found in request body at some key

* Fix init order

* Make domain retrieval part of the role pipeline

* Add tests

* Refactor how is_binary is applied in get_domain/2

* Make plug tests rely on dedicated test routes for more stability

* Consistently treat empty `allowed_roles` list as permitting all roles

* Fix async test param, add extra case for init

* Make `DocsQueryTest` async again

* Improve a bit and document plug configuration

* Make docs more legible when viewed from source directly

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-09-26 09:52:45 +00:00
Adrian Gruntkowski
2d7943aec8
Use :domain uniformly for all routes instead of :website (#4598)
* Replace :website with :domain in routes uniformly

* Remove support for :website parameter from `AuthorizeSiteAccess` plug
2024-09-26 08:20:35 +00:00
ruslandoga
cb365c2fa0
set secure cookie if BASE_URL scheme is HTTPS (#4623) 2024-09-26 07:57:21 +00:00
Adrian Gruntkowski
87dac3b2ee
Don't track custom events in CE (#4627) 2024-09-26 07:46:21 +00:00
ruslandoga
356f50e9c8
Change cookie key in CE (#4621)
* use default sessions options in ce

* there is no RuntimeSessionAdapter anymore
2024-09-26 07:43:47 +00:00
Adrian Gruntkowski
9d997a74d6
Implement user notes in CRM and HelpScout integration (#4611)
* Implement user notes in CRM and HelpScout integration

* Update HS tests

* Make slight markup and styling changes
2024-09-25 14:56:33 +00:00
Adrian Gruntkowski
e11fd159df
Add notes column to users table (#4612) 2024-09-25 14:21:26 +00:00
Adrian Gruntkowski
6981972617
Make invitations cleanup worker rely on UTC time (#4610) 2024-09-25 12:44:55 +00:00
hq1
3251b5bb33
Check usage for users with active/cancelled/past due subscriptions (#4607)
* Check usage for users with active/cancelled/past due subscriptions

So that over limit e-mails and grace period is handled
regardless - they're still subscribers.

* Ensure current subscription is fetched, for an ongoing plan

* Add extra test

* Revert "Ensure current subscription is fetched, for an ongoing plan"

This reverts commit 9ddc7bdccb.

* Fixup test

* Reapply "Ensure current subscription is fetched, for an ongoing plan"

This reverts commit 7ab537954b.

* Do a subscription preload and assert ID match

* Use inner lateral join to fetch subscriptions
2024-09-25 11:27:12 +00:00
ruslandoga
00dffb579c
release v2.1.2 (#4483) 2024-09-25 11:26:16 +00:00
ruslandoga
0094e8a20f
rm unnecessary reject (#4615) 2024-09-24 18:50:53 +00:00
ruslandoga
09c74ee0b3
Mua: support 465 port connections (#4606)
* mua: support 465 port connections

* allow port=465 but SMTP_HOST_SSL_ENABLED=false
2024-09-24 07:57:15 +00:00
ruslandoga
dca2eb5b81
Update Ecto dumps (#4481)
* update Ecto dumps

* rm tmp tables from dump
2024-09-23 12:50:08 +00:00
ruslandoga
71fa38709f
skip verification in ce (#4604) 2024-09-23 12:17:32 +00:00
ruslandoga
1b912240e3
fix link (#4605) 2024-09-23 09:39:06 +00:00
ruslandoga
5766478887
don't render empty list element in ce (#4596) 2024-09-19 07:11:02 +00:00
Cenk Kücük
234d63e549
enrich with information about app node (#4592) 2024-09-18 17:08:24 +00:00
Artur Pata
59c7ce2ef1
Fix auth issue with POST /api/docs/query (#4593) 2024-09-18 15:46:05 +00:00
Artur Pata
82a15884ad
Automatically generate Typescript types for v2 API query schema (#4574)
* Generate types from query schema

* Flip the query schema so private is static

* Ensure private schema stays private

* Refactor comment, json schema utils
2024-09-18 11:01:20 +00:00
Uku Taht
7a77ebf9bf
Add feature-flagged channels UI (#4585)
* Add feature-flagged channels UI

* Implement channels modal

* Channel -> Channels tab
2024-09-18 08:34:12 +00:00
Cenk Kücük
912b61bc9c
Set marker on honeycomb after a successful build (#4590)
* Set marker on honeycomb after successful builds

* set dataset

* use sha instead
2024-09-17 16:42:04 +01:00
Adrian Gruntkowski
6769ebdc24
Refactor AuthorizeSiteAccess (#4583)
* Refactor and fix `AuthorizeSiteAccess` plug shared link case handling

* Make plug module name more consistent

* Add moduledoc

* Add regression test for shared link auth case

* Adjust failing case test to account for different response

* Further restrict accepted input and configuration

* Extend plug-specific tests

* Tag EE-only test properly

* Remove one DB roundtrip from AuthorizeSiteAccess

* Improve naming slightly

* Filter shared link by site ID on query level already

---------

Co-authored-by: Uku Taht <uku.taht@gmail.com>
2024-09-17 12:52:20 +00:00
RobertJoonas
45c0d538da
return city codes as integers in suggestions (#4589) 2024-09-17 12:37:13 +00:00
hq1
f645a9ba1d
Warm up ConCache before tests (#4587)
ref: https://github.com/sasa1977/con_cache/pull/79
2024-09-17 11:34:46 +00:00
Karl-Aksel Puulmann
dd1313f360
Solve build failure (#4586)
Building Dockerfile seems to be failing now with the following error:
```
Dockerfile:72
--------------------
  70 |       && if [ "$MIX_ENV" = "ce" ]; then apk add --no-cache certbot; fi
  71 |
  72 | >>> COPY --from=buildcontainer --chmod=a+rX /app/_build/${MIX_ENV}/rel/plausible /app
  73 |     COPY --chmod=755 ./rel/docker-entrypoint.sh /entrypoint.sh
  74 |
--------------------
ERROR: failed to solve: invalid chmod parameter: 'a+rX'. it should be octal string and between 0 and 07777
```

Link: https://github.com/plausible/analytics/actions/runs/10898788870/job/30242872415

Not sure _why_ given this line hasn't changed in ages, but perhaps
something to do with buildx changes. If preview deploy succeeds in this,
it should fix the issue.
2024-09-17 09:18:08 +00:00
Adrian Gruntkowski
f7bbbf8c33
Remove support for legacy user sessions (#4540)
* Remove support for legacy user sessions

* Implement revoking all sessions for a given user

* Revoke all user sessions on password reset

* Add tests for revoking all user sessions on password reset

* Reload page when dashboard API request fails with 404

* Revert "Reload page when dashboard API request fails with 404"

This reverts commit 77d1a1035658915f9afe538afc5fb9a3da0ec905.
2024-09-17 07:31:41 +00:00
Marko Saric
68e03c2112
Update to the copy (#4558)
* Update to the copy

Update to the copy to include a note about billable pageviews. hopefully it doesn't make the copy too long...

* Don't show tooltip on small/mobile screens

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-09-16 13:50:36 +00:00
Adrian Gruntkowski
ae0c5a173d
Drop event explicitly on session lock timeout (#4582)
* Drop event explicitly on session lock timeout

* Make session `user_id` more random in tests to avoid excess locking

* Improve testability to event ingestion

* Test lock timeout in ingestion
2024-09-16 10:36:53 +00:00
hq1
9f1017e2b4
Set postgres pool size to 2*cores for test env (#4581)
This should help with random pool timeouts, at least
on AMD Linux with 24 cores.
2024-09-16 10:20:02 +00:00
RobertJoonas
b1152fc351
Breakdown modal search shortcut (#4559)
* add keyboard shortcut

* pass setSearch as undefined when searchEnabled is false
2024-09-16 07:24:06 +00:00
Karl-Aksel Puulmann
748e0d902f
APIv2: Make imports_skip_reason flag not appear when imports not requested (#4565)
* APIv2: Make imports_skip_reason flag not appear when imports not requested

* Update lib/plausible/stats/query_result.ex

Co-authored-by: hq1 <hq@mtod.org>

---------

Co-authored-by: hq1 <hq@mtod.org>
2024-09-16 06:13:32 +00:00
hq1
f979ca938a
Fix race condition merging session data when cache returns (#4579)
`persist_session/1` is used in `populate_native_stats/1` test helper
to merge session data. It sometimes gets `:ok` instead of the actual
session data so that tests randomly fail with:

```
** (BadMapError) expected a map, got: :ok
code: populate_stats(site, [build(:pageview)])
stacktrace:
(elixir 1.17.1) lib/map.ex:486: Map.take/2
(plausible 0.0.1) lib/plausible/clickhouse_event_v2.ex:92: Plausible.ClickhouseEventV2.merge_session/2
(plausible 0.0.1) test/support/test_utils.ex:188: anonymous fn/2 in Plausible.TestUtils.populate_native_stats/1
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(plausible 0.0.1) test/support/test_utils.ex:184: Plausible.TestUtils.populate_native_stats/1
(plausible 0.0.1) test/support/test_utils.ex:179: Plausible.TestUtils.populate_stats/1
test/workers/send_site_setup_emails_test.exs:46: (test)
```
2024-09-16 06:12:18 +00:00
ruslandoga
e9ced986ce
prepare for wiki (#4512) 2024-09-13 11:32:39 +00:00
ruslandoga
0a962e20a9
Make CE HTTPS use current Mozilla recommendations (#4568)
* allow configurable cipher suites in CE

* just use intermediate compatibility

* configure eccs like mozilla

* drop ciphers with rsa
2024-09-12 15:11:30 +00:00
Cenk Kücük
606248d2af
prepare CI for merge queues (#4576) 2024-09-12 16:05:34 +01:00
Karl-Aksel Puulmann
ef57502854
APIv2: Implement pagination and include.total_rows (#4575)
Offset-based pagination is used to make sure Looker integration
is able to work as efficiently as possible. To know how many
requests users need to do `include.total_rows` option was added.
2024-09-12 15:51:18 +03:00
Artur Pata
9fcb76d8e6
Allow sorting breakdown lists by some metrics (#4513)
* On the dashboard, allow Metrics (aka column configurations) to
  * specify width they need
  * specify if they are sortable
* Default sort order for breakdown endpoints is hardcoded on the dashboard (needed to show what column the report is sorted by)
* Unifies Google Keywords modal with other breakdowns
2024-09-12 14:49:43 +03:00
Karl-Aksel Puulmann
dd1021eff3
Limit docs query API, return 401 for API routes (#4570)
* Limit docs query API, return 401 for API routes

* Changelog entry

* Use 404 with changed error message

* Update changelog
2024-09-12 14:11:22 +03:00
ruslandoga
28f20bba3b
tzdata works with 2024b now (#4569) 2024-09-11 14:22:40 +07:00
Karl-Aksel Puulmann
bd11b4cf67
APIv2: Standard iso8601 timestamps, operate on UTC (#4563)
* query.date_range is now in UTC instead of user timezone

This simplifies things down the line and fixes several bugs where
query.date_range is cast to naivedatetime for ecto purposes

Many places still remain broken:
- comparison queries
- `to_date_range` calls

* Make default_for_date_range not care about time zones

* Make timezone parameter mandatory for to_date_range

* Simplify utc_date_range, update legacy query builder

* Fix more cases where query date range is needed

* query.date_range -> query.utc_time_range

* Query.date_range/1 function

* ensure_include_imported update

* Clean up send_email_report
2024-09-11 09:21:59 +03:00
Artur Pata
52b94842c0
Assert filters are tuples, simplify schema (#4541) 2024-09-10 18:01:42 +03:00
Karl-Aksel Puulmann
e8d544c841
Remove does_not_contain support (#4564)
It only needed to be live until users have reload. This has been live
for >24h.
2024-09-10 15:38:04 +03:00
ruslandoga
2180ab4764
Auto HTTPS in CE (#4491)
* auto https

* changelog

* enable auto-tls only when http_port is 80

* make erlang ssl less verbose

* simplify config

* simplify config

* fix ce_dev typo

* fix another typo

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-09-10 14:15:43 +02:00
Adrian Gruntkowski
8ba5f7d32f
Safeguard queries relying on sign from faulty old session entries (#4555)
* Safeguard session queries relying on `sign` from faulty old session entries

* Comment updated metric

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>

* Apply safeguards to `bounce_rate` metric only

* Add note to bounce rate definition in SQL fragments as well

* Add test for graceful bounce rate handling in breakdown

* Make user_id more unique

* Add a note to the test

* Move regression test to APIv2 tests

---------

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
2024-09-10 13:22:49 +02:00
Adrian Gruntkowski
c105ebceaf
Fix test failing due to timestamp setup (#4562) 2024-09-10 12:30:49 +02:00
RobertJoonas
e6993b1f8b
Filter modal fixes (#4553)
* fix deciding whether a filter operation is freeChoice

* fix displaying loading spinner when loading combobox options

* extract lastLoadTimestamp into a separate context

* prettier
2024-09-09 13:49:17 +03:00
ruslandoga
c536af0df0
Don't attempt to create a database if it already exists (#4498)
* don't attempt to create a database if already created

* add tests

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-09-09 11:55:39 +02:00
ruslandoga
d17ac82058
Remove Timex.now (#4546)
* rm Timex.now

* fix test

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-09-09 11:40:15 +02:00