Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release CE v2.1.5 #4884

Draft
wants to merge 19 commits into
base: release-v214
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 77 additions & 19 deletions .github/workflows/build-public-images-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,39 @@ name: Build Public Images GHCR

on:
push:
tags: ['v*']
tags: ["v*"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
GHCR_REPO: ghcr.io/plausible/community-edition

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-22.04
- platform: linux/arm64
runner: ubuntu-22.04-arm

permissions:
contents: read
packages: write
runs-on: ${{ matrix.runner || 'ubuntu-22.04' }}

steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/plausible/community-edition
tags: |
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
type=semver,pattern={{major}},prefix=v

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
images: ${{ env.GHCR_REPO }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -40,14 +46,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
- name: Build
id: docker_build
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64
outputs: type=image,name=${{ env.GHCR_REPO }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
Expand All @@ -58,11 +62,65 @@ jobs:
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.docker_build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"

- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1

- name: Notify team on failure
if: ${{ failure() }}
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.BUILD_NOTIFICATION_URL }}
method: 'POST'
method: "POST"
customHeaders: '{"Content-Type": "application/json"}'
data: '{"content": "<a href=\"https://github.com/plausible/analytics/actions/workflows/build-public-images.yml\">Build failed</a>"}'
data: '{"content": "<a href=\"https://github.com/plausible/analytics/actions/workflows/build-public-images-ghcr.yml\">Build failed</a>"}'

push:
runs-on: ubuntu-latest
needs:
- build

steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/setup-buildx-action@v3

- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.GHCR_REPO }}
tags: |
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
type=semver,pattern={{major}},prefix=v

- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)

- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }}
63 changes: 0 additions & 63 deletions .github/workflows/build-public-images.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name: Elixir CI
on:
pull_request:
push:
branches: [master, stable]
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CACHE_VERSION: v8
CACHE_VERSION: release-v215
PERSISTENT_CACHE_DIR: cached

jobs:
Expand Down
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.

## Unreleased
## v2.1.5 - 2025-01-17

### Added

- Add text version to emails plausible/analytics#4674

### Removed
### Changed
### Fixed

- Removed billing/trial/etc. messages from HTML templates and emails in CE plausible/analytics#4766 plausible/analytics#4897 plausible/analytics#4668

## v2.1.4 - 2024-10-08

Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ RUN mkdir /app
WORKDIR /app

# install build dependencies
RUN apk add --no-cache git nodejs yarn python3 npm ca-certificates wget gnupg make gcc libc-dev brotli && \
npm install npm@latest -g
RUN apk add --no-cache git "nodejs-current=21.7.3-r0" yarn npm python3 ca-certificates wget gnupg make gcc libc-dev brotli

COPY mix.exs ./
COPY mix.lock ./
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/stats/modals/breakdown-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default function BreakdownModal<TListItem extends { name: string }>({
{
label: reportInfo.dimensionLabel,
key: 'name',
width: 'w-48 md:w-80 flex items-center break-all',
width: 'w-48 md:w-full flex items-center break-all',
align: 'left',
renderItem: (item) => (
<NameCell
Expand Down
47 changes: 12 additions & 35 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,9 @@ data_dir = data_dir || persistent_cache_dir || System.get_env("DEFAULT_DATA_DIR"
persistent_cache_dir = persistent_cache_dir || data_dir

enable_email_verification =
config_dir
|> get_var_from_path_or_env("ENABLE_EMAIL_VERIFICATION", "false")
|> String.to_existing_atom()
get_bool_from_path_or_env(config_dir, "ENABLE_EMAIL_VERIFICATION", false)

is_selfhost =
config_dir
|> get_var_from_path_or_env("SELFHOST", "true")
|> String.to_existing_atom()
is_selfhost = get_bool_from_path_or_env(config_dir, "SELFHOST", true)

# by default, only registration from invites is enabled in CE
disable_registration_default =
Expand All @@ -279,15 +274,10 @@ custom_script_name =
config_dir
|> get_var_from_path_or_env("CUSTOM_SCRIPT_NAME", "script")

disable_cron =
config_dir
|> get_var_from_path_or_env("DISABLE_CRON", "false")
|> String.to_existing_atom()
disable_cron = get_bool_from_path_or_env(config_dir, "DISABLE_CRON", false)

log_failed_login_attempts =
config_dir
|> get_var_from_path_or_env("LOG_FAILED_LOGIN_ATTEMPTS", "false")
|> String.to_existing_atom()
get_bool_from_path_or_env(config_dir, "LOG_FAILED_LOGIN_ATTEMPTS", false)

websocket_url = get_var_from_path_or_env(config_dir, "WEBSOCKET_URL", "")

Expand Down Expand Up @@ -426,7 +416,7 @@ if config_env() in [:ce, :ce_dev, :ce_test] do
end

db_maybe_ipv6 =
if get_var_from_path_or_env(config_dir, "ECTO_IPV6") do
if get_bool_from_path_or_env(config_dir, "ECTO_IPV6") do
if config_env() in [:ce, :ce_dev, :ce_test] do
Logger.warning(
"ECTO_IPV6 is no longer necessary as all TCP connections now try IPv6 automatically with IPv4 fallback"
Expand Down Expand Up @@ -527,9 +517,7 @@ config :plausible, Plausible.HelpScout,
config :plausible, :imported,
max_buffer_size: get_int_from_path_or_env(config_dir, "IMPORTED_MAX_BUFFER_SIZE", 10_000)

maybe_ch_ipv6 =
get_var_from_path_or_env(config_dir, "ECTO_CH_IPV6", "false")
|> String.to_existing_atom()
maybe_ch_ipv6 = get_bool_from_path_or_env(config_dir, "ECTO_CH_IPV6", false)

if maybe_ch_ipv6 && config_env() in [:ce, :ce_dev, :ce_test] do
Logger.warning(
Expand Down Expand Up @@ -637,27 +625,22 @@ case mailer_adapter do
password: get_var_from_path_or_env(config_dir, "SMTP_USER_PWD"),
tls: :if_available,
allowed_tls_versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"],
ssl: get_var_from_path_or_env(config_dir, "SMTP_HOST_SSL_ENABLED") || false,
ssl: get_bool_from_path_or_env(config_dir, "SMTP_HOST_SSL_ENABLED", false),
retries: get_var_from_path_or_env(config_dir, "SMTP_RETRIES") || 2,
no_mx_lookups: get_var_from_path_or_env(config_dir, "SMTP_MX_LOOKUPS_ENABLED") || true
no_mx_lookups: get_bool_from_path_or_env(config_dir, "SMTP_MX_LOOKUPS_ENABLED", true)

"Bamboo.Mua" ->
config :plausible, Plausible.Mailer, adapter: Bamboo.Mua

# prevents common problems with Erlang's TLS v1.3
middlebox_comp_mode =
get_var_from_path_or_env(config_dir, "SMTP_MIDDLEBOX_COMP_MODE", "false")
get_bool_from_path_or_env(config_dir, "SMTP_MIDDLEBOX_COMP_MODE", false)

middlebox_comp_mode = String.to_existing_atom(middlebox_comp_mode)
config :plausible, Plausible.Mailer, ssl: [middlebox_comp_mode: middlebox_comp_mode]

if relay = get_var_from_path_or_env(config_dir, "SMTP_HOST_ADDR") do
port = get_int_from_path_or_env(config_dir, "SMTP_HOST_PORT", 587)

ssl_enabled =
if ssl_enabled = get_var_from_path_or_env(config_dir, "SMTP_HOST_SSL_ENABLED") do
String.to_existing_atom(ssl_enabled)
end
ssl_enabled = get_bool_from_path_or_env(config_dir, "SMTP_HOST_SSL_ENABLED")

protocol =
cond do
Expand Down Expand Up @@ -897,10 +880,7 @@ end

config :tzdata, :data_dir, Path.join(persistent_cache_dir || System.tmp_dir!(), "tzdata_data")

promex_disabled? =
config_dir
|> get_var_from_path_or_env("PROMEX_DISABLED", "true")
|> String.to_existing_atom()
promex_disabled? = get_bool_from_path_or_env(config_dir, "PROMEX_DISABLED", true)

config :plausible, Plausible.PromEx,
disabled: promex_disabled?,
Expand All @@ -927,10 +907,7 @@ if not is_selfhost do
config :plausible, Plausible.Site, default_ingest_threshold: site_default_ingest_threshold
end

s3_disabled? =
config_dir
|> get_var_from_path_or_env("S3_DISABLED", "true")
|> String.to_existing_atom()
s3_disabled? = get_bool_from_path_or_env(config_dir, "S3_DISABLED", true)

unless s3_disabled? do
s3_env = [
Expand Down
2 changes: 1 addition & 1 deletion lib/plausible/billing/site_locker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ defmodule Plausible.Billing.SiteLocker do
{:ok, num_updated}
end

@spec send_grace_period_end_email(Plausible.Auth.User.t()) :: Plausible.Mailer.result()
@spec send_grace_period_end_email(Plausible.Auth.User.t()) :: :ok | {:error, :unknown_error}
def send_grace_period_end_email(user) do
usage = Plausible.Billing.Quota.Usage.monthly_pageview_usage(user)
suggested_plan = Plausible.Billing.Plans.suggest(user, usage.last_cycle.total)
Expand Down
Loading
Loading