Skip to content

Commit 96ebd01

Browse files
authored
Release 3.0.0 (#5309)
* Update User schema with a field required by teams migration * Start cloak vault for self-hosted release migrations. Since this one is using schemas, existing encrypted columns do require cloak to be up. * Update changelog * Make trial notification ee-only * Replace `Plausible.ee?/0` with `ee?/0` across the codebase * Bump release date
1 parent 2a18ba8 commit 96ebd01

9 files changed

Lines changed: 41 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
33

44
## Unreleased
55

6+
### Added
7+
8+
### Removed
9+
10+
### Changed
11+
12+
## v3.0.0 - 2025-04-11
13+
614
### Added
715
- Ability to sort by and compare the `exit_rate` metric in the dashboard Exit Pages > Details report
816
- Add top 3 pages into the traffic spike email
@@ -71,7 +79,7 @@ All notable changes to this project will be documented in this file.
7179
- Fix Conversion Rate metrics column disappearing from reports when "Goal is ..." filter is within a segment
7280
- Graph tooltip now shows year when graph has data from multiple years
7381

74-
## v2.1.5-rc.1 - 2025-01-17
82+
## v2.1.5 - 2025-02-03
7583

7684
### Added
7785

lib/plausible/auth/user.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ defmodule Plausible.Auth.User do
4747
has_many :owner_memberships, Plausible.Teams.Membership, where: [role: :owner]
4848
has_many :owned_teams, through: [:owner_memberships, :team]
4949

50+
on_ce do
51+
# we only need this for backfill teams migration to work; let's figure out how to safely remove later on
52+
field :trial_expiry_date, :date
53+
end
54+
5055
timestamps()
5156
end
5257

lib/plausible/data_migration/backfill_teams.ex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,21 @@ defmodule Plausible.DataMigration.BackfillTeams do
1414
end
1515

1616
def run(opts \\ []) do
17+
start_cloak()
18+
1719
dry_run? = Keyword.get(opts, :dry_run?, true)
1820
Repo.transaction(fn -> backfill(dry_run?) end, timeout: :infinity)
1921
end
2022

23+
defp start_cloak() do
24+
Application.ensure_all_started(:cloak)
25+
Application.ensure_all_started(:cloak_ecto)
26+
Plausible.Auth.TOTP.Vault.start_link(key: totp_vault_key())
27+
rescue
28+
_ ->
29+
:ok
30+
end
31+
2132
defp backfill(dry_run?) do
2233
# Orphaned teams
2334

@@ -614,4 +625,10 @@ defmodule Plausible.DataMigration.BackfillTeams do
614625
defp log(msg) do
615626
IO.puts("[#{DateTime.utc_now(:second)}] #{msg}")
616627
end
628+
629+
defp totp_vault_key() do
630+
:plausible
631+
|> Application.fetch_env!(Plausible.Auth.TOTP)
632+
|> Keyword.fetch!(:vault_key)
633+
end
617634
end

lib/plausible_web/email.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ defmodule PlausibleWeb.Email do
554554
def priority_email(%{layout: layout}) do
555555
email = base_email(%{layout: layout})
556556

557-
if Plausible.ee?() do
557+
if ee?() do
558558
put_param(email, "MessageStream", "priority")
559559
else
560560
email
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
You've activated
2-
<%= if Plausible.ee?() do %>
2+
<%= if ee?() do %>
33
your free 30-day trial of
44
<% end %>
55
{Plausible.product_name()}, a simple and privacy-friendly website analytics tool. <br /><br />
66
<a href={"#{plausible_url()}/sites/new"}>Click here</a>
77
to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics.
8-
<%= if Plausible.ee?() do %>
8+
<%= if ee?() do %>
99
<br /><br />Do reply back to this email if you have any questions or need some guidance.
1010
<% end %>

lib/plausible_web/templates/email/site_setup_help_email.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= if Plausible.ee?() and Plausible.Teams.on_trial?(@site_team) do %>
1+
<%= if ee?() and Plausible.Teams.on_trial?(@site_team) do %>
22
You signed up for a free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.
33
<br /><br />
44
<% end %>
@@ -9,6 +9,6 @@ This Plausible script is 45 times smaller than Google Analytics script so you’
99
<br /><br /> On WordPress? We have a
1010
<a href="https://plausible.io/wordpress-analytics-plugin">WordPress plugin</a> that makes the process simpler. We also have
1111
<a href="https://plausible.io/docs/integration-guides">integration guides</a> for different site builders to help you start counting stats in no time.
12-
<%= if Plausible.ee?() do %>
12+
<%= if ee?() do %>
1313
<br /><br /> Do reply back to this email if you have any questions or need some guidance.
1414
<% end %>

lib/plausible_web/templates/site/new.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
resource="sites"
1515
/>
1616

17-
<%= if is_nil(@current_team) or is_nil(@current_team.trial_expiry_date) do %>
17+
<%= if ee?() and (is_nil(@current_team) or is_nil(@current_team.trial_expiry_date)) do %>
1818
<div class="rounded-md bg-blue-50 dark:bg-transparent dark:border border-blue-200 p-4">
1919
<div class="flex">
2020
<div class="flex-shrink-0">

test/plausible_web/controllers/billing_controller_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ defmodule PlausibleWeb.BillingControllerTest do
162162
assert %{
163163
"disableLogout" => true,
164164
"email" => user.email,
165-
"passthrough" => "ee:#{Plausible.ee?()};user:#{user.id};team:#{team.id}",
165+
"passthrough" => "ee:#{ee?()};user:#{user.id};team:#{team.id}",
166166
"product" => @configured_enterprise_plan_paddle_plan_id,
167167
"success" => Routes.billing_path(PlausibleWeb.Endpoint, :upgrade_success),
168168
"theme" => "none"
@@ -337,7 +337,7 @@ defmodule PlausibleWeb.BillingControllerTest do
337337
assert %{
338338
"disableLogout" => true,
339339
"email" => user.email,
340-
"passthrough" => "ee:#{Plausible.ee?()};user:#{user.id};team:#{team.id}",
340+
"passthrough" => "ee:#{ee?()};user:#{user.id};team:#{team.id}",
341341
"product" => @configured_enterprise_plan_paddle_plan_id,
342342
"success" => Routes.billing_path(PlausibleWeb.Endpoint, :upgrade_success),
343343
"theme" => "none"

test/plausible_web/controllers/site_controller_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ defmodule PlausibleWeb.SiteControllerTest do
430430
assert html_response(conn, 200) =~
431431
"This domain cannot be registered. Perhaps one of your colleagues registered it?"
432432

433-
if Plausible.ee?() do
433+
if ee?() do
434434
assert html_response(conn, 200) =~ "support@plausible.io"
435435
else
436436
refute html_response(conn, 200) =~ "support@plausible.io"
@@ -453,7 +453,7 @@ defmodule PlausibleWeb.SiteControllerTest do
453453
assert html_response(conn, 200) =~
454454
"This domain cannot be registered. Perhaps one of your colleagues registered it?"
455455

456-
if Plausible.ee?() do
456+
if ee?() do
457457
assert html_response(conn, 200) =~ "support@plausible.io"
458458
else
459459
refute html_response(conn, 200) =~ "support@plausible.io"

0 commit comments

Comments
 (0)