Skip to content

Commit dab6263

Browse files
committed
v2.1.0
1 parent d6a61a5 commit dab6263

13 files changed

+92
-30
lines changed

README.md

+89-22
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ README.md clickhouse/ docker-compose.yml images/
6161

6262
In the downloaded directory you'll find two important files:
6363

64-
- [docker-compose.yml](./docker-compose.yml) — installs and orchestrates networking between your Plausible CE server, Postgres database, Clickhouse database (for stats), and an SMTP server.
64+
- [docker-compose.yml](./docker-compose.yml) — installs and orchestrates networking between your Plausible CE server, Postgres database, and Clickhouse database for stats.
6565
- [plausible-conf.env](./plausible-conf.env) — configures the Plausible server itself. Full configuration options are documented [below.](#configure)
6666

6767
Right now the latter looks like this:
@@ -70,18 +70,21 @@ Right now the latter looks like this:
7070
```env
7171
BASE_URL=replace-me
7272
SECRET_KEY_BASE=replace-me
73+
TOTP_VAULT_KEY=replace-me
7374
```
7475

7576
Let's do as it asks and populate these required environment variables with our own values.
7677

7778
#### Required configuration
7879

79-
First we generate the [secret key base](#secret_key_base) using OpenSSL:
80+
First we generate the [secret key base](#secret_key_base) and [TOTP vault key](#totp_vault_key) using OpenSSL:
8081

8182
<sub><kbd>console</kbd></sub>
8283
```console
8384
$ openssl rand -base64 48
8485
GLVzDZW04FzuS1gMcmBRVhwgd4Gu9YmSl/k/TqfTUXti7FLBd7aflXeQDdwCj6Cz
86+
$ openssl rand -base64 32
87+
dsxvbn3jxDd16az2QpsX5B8O+llxjQ2SJE2i5Bzx38I=
8588
```
8689

8790
And then we decide on the [base URL](#base_url) where the instance would be accessible:
@@ -92,6 +95,8 @@ And then we decide on the [base URL](#base_url) where the instance would be acce
9295
+ BASE_URL=http://plausible.example.com
9396
- SECRET_KEY_BASE=replace-me
9497
+ SECRET_KEY_BASE=GLVzDZW04FzuS1gMcmBRVhwgd4Gu9YmSl/k/TqfTUXti7FLBd7aflXeQDdwCj6Cz
98+
- TOTP_VAULT_KEY=replace-me
99+
+ TOTP_VAULT_KEY=dsxvbn3jxDd16az2QpsX5B8O+llxjQ2SJE2i5Bzx38I=
95100
```
96101

97102
We can start our instance now but the requests would be served over HTTP. Not cool! Let's configure [Caddy](https://caddyserver.com) to enable HTTPS.
@@ -142,6 +147,7 @@ Finally we need to update the base URL to use HTTPS scheme.
142147
- BASE_URL=http://plausible.example.com
143148
+ BASE_URL=https://plausible.example.com
144149
SECRET_KEY_BASE=GLVzDZW04FzuS1gMcmBRVhwgd4Gu9YmSl/k/TqfTUXti7FLBd7aflXeQDdwCj6Cz
150+
TOTP_VAULT_KEY=dsxvbn3jxDd16az2QpsX5B8O+llxjQ2SJE2i5Bzx38I=
145151
```
146152

147153
Now we can start everything together.
@@ -175,22 +181,20 @@ Next we'll go over how to upgrade the instance when a new release comes out, mor
175181

176182
## Upgrade
177183

178-
Each new [release](https://github.com/plausible/analytics/releases/tag/v2.0.0) contains information on how to upgrade to it from the previous version. This section outlines the
179-
general steps and explains the versioning.
184+
Each new [release](https://github.com/plausible/analytics/releases) contains information on how to upgrade to it from the previous version. This section outlines the general steps and explains the versioning.
180185

181186
### Version management
182187

183188
Plausible CE follows [semantic versioning:](https://semver.org/) `MAJOR.MINOR.PATCH`
184189

185-
You can find available Plausible versions on [DockerHub](https://hub.docker.com/r/plausible/analytics). The default `latest` tag refers to the latest stable release tag. You can also pin your version:
190+
You can find available Plausible versions on [Github packages.](https://github.com/plausible/analytics/pkgs/container/community-edition) The default `latest` tag refers to the latest stable release tag. You can also pin your version:
186191

187-
- <kbd>plausible/analytics:v2</kbd> pins the major version to 2 but allows minor and patch version upgrades
188-
- <kbd>plausible/analytics:v2.0</kbd> pins the minor version to 2.0 but allows only patch upgrades
192+
- <kbd>ghcr.io/plausible/community-edition:v2</kbd> pins the major version to `2` but allows minor and patch version upgrades
193+
- <kbd>ghcr.io/plausible/community-edition:v2.1</kbd> pins the minor version to `2.1` but allows only patch upgrades
189194

190195
None of the functionality is backported to older versions. If you wish to get the latest bug fixes and security updates you need to upgrade to a newer version.
191196

192-
New versions are published on [the releases page](https://github.com/plausible/analytics/releases) and their changes are documented in our [Changelog.](https://github.com/plausible/analytics/blob/master/CHANGELOG.md) Please note that database schema changes require running migrations when you're upgrading. However, we consider the schema
193-
as an internal API and therefore schema changes aren't considered a breaking change.
197+
New versions are published on [the releases page](https://github.com/plausible/analytics/releases) and their changes are documented in our [Changelog.](https://github.com/plausible/analytics/blob/master/CHANGELOG.md) Please note that database schema changes require running migrations when you're upgrading. However, we consider the schema as an internal API and therefore schema changes aren't considered a breaking change.
194198

195199
We recommend to pin the major version instead of using `latest`. Either way the general flow for upgrading between minor version would look like this:
196200

@@ -219,14 +223,12 @@ $ docker compose -f docker-compose.yml -f reverse-proxy/docker-compose.caddy-gen
219223
✔ Container hosting-plausible_db-1 Running 0.0s
220224
✔ Container hosting-plausible-1 Started 1.2s
221225
✔ Container caddy-gen Running 0.0s
222-
$ docker images --filter=reference='plausible/analytics:*'
223-
REPOSITORY TAG IMAGE ID CREATED SIZE
224-
plausible/analytics v2.0 2b2735265a65 7 months ago 163MB
225-
plausible/analytics v1.5 5e1e0047953a 8 months ago 130MB
226-
$ docker rmi 5e1e0047953a
227-
Untagged: plausible/analytics:v1.5
228-
Untagged: plausible/analytics@sha256:365124b00f103ac40ce3c64cd49a869d94f2ded221d9bb7900be1cecfaf34acf
229-
Deleted: sha256:5e1e0047953afc179ee884389e152b3f07343fb34e5586f9ecc2f33c6ba3bcaa
226+
$ docker images --filter=reference='ghcr.io/plausible/community-edition:*'
227+
REPOSITORY TAG IMAGE ID CREATED SIZE
228+
ghcr.io/plausible/community-edition v2.1 63f7c8708294 6 days ago 83.4MB
229+
ghcr.io/plausible/community-edition v2.1.0-rc.0 2b2735265a65 7 months ago 163MB
230+
$ docker rmi 2b2735265a65
231+
Untagged: ghcr.io/plausible/community-edition:v2.1.0-rc.0
230232
...
231233
```
232234

@@ -250,6 +252,7 @@ Here's the minimal configuration file we got from the [quick start:](#quick-star
250252
```env
251253
BASE_URL=https://plausible.example.com
252254
SECRET_KEY_BASE=GLVzDZW04FzuS1gMcmBRVhwgd4Gu9YmSl/k/TqfTUXti7FLBd7aflXeQDdwCj6Cz
255+
TOTP_VAULT_KEY=dsxvbn3jxDd16az2QpsX5B8O+llxjQ2SJE2i5Bzx38I=
253256
```
254257

255258
And here's a configuration with some extra options provided:
@@ -258,12 +261,18 @@ And here's a configuration with some extra options provided:
258261
```env
259262
BASE_URL=https://plausible.example.com
260263
SECRET_KEY_BASE=GLVzDZW04FzuS1gMcmBRVhwgd4Gu9YmSl/k/TqfTUXti7FLBd7aflXeQDdwCj6Cz
264+
TOTP_VAULT_KEY=dsxvbn3jxDd16az2QpsX5B8O+llxjQ2SJE2i5Bzx38I=
261265
MAXMIND_LICENSE_KEY=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
262266
MAXMIND_EDITION=GeoLite2-City
263267
GOOGLE_CLIENT_ID=140927866833-002gqg48rl4iku76lbkk0qhu0i0m7bia.apps.googleusercontent.com
264268
GOOGLE_CLIENT_SECRET=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
265269
MAILER_NAME=Plausible
266-
270+
271+
MAILER_ADAPTER=Bamboo.Mua
272+
SMTP_HOST_ADDR=smtp.gmail.com
273+
SMTP_HOST_PORT=587
274+
275+
SMTP_USER_PWD="wnqj fkbn jcwc byxk"
267276
DISABLE_REGISTRATION=invite_only
268277
```
269278

@@ -303,6 +312,23 @@ SECRET_KEY_BASE=GLVzDZW04FzuS1gMcmBRVhwgd4Gu9YmSl/k/TqfTUXti7FLBd7aflXeQDdwCj6Cz
303312
> [!WARNING]
304313
> Don't use this exact value or someone would be able to sign a cookie with `user_id=1` and log in as the admin!
305314
315+
---
316+
317+
#### TOTP_VAULT_KEY
318+
319+
Configures the secret used for encrypting TOTP secrets at rest using AES256-GCM, doesn't have any defaults and needs to be provided in the ENV vars, can be generated with OpenSSL:
320+
321+
<sub><kbd>console</kbd></sub>
322+
```console
323+
$ openssl rand -base64 32
324+
dsxvbn3jxDd16az2QpsX5B8O+llxjQ2SJE2i5Bzx38I=
325+
```
326+
327+
<sub><kbd>plausible-conf.env</kbd></sub>
328+
```env
329+
TOTP_VAULT_KEY=dsxvbn3jxDd16az2QpsX5B8O+llxjQ2SJE2i5Bzx38I=
330+
``````
331+
306332
### Registration
307333
308334
#### DISABLE_REGISTRATION
@@ -462,14 +488,41 @@ MaxMind database edition to use (only if [MAXMIND_LICENSE_KEY](#maxmind_license_
462488

463489
Plausible CE sends transactional emails e.g. account activation, password reset. In addition, it sends non-transactional emails like weekly or monthly reports.
464490

465-
It uses SMTP with a [relay](./docker-compose.yml#L3-L5) by default. Alternatively, you can use other [services](https://hexdocs.pm/bamboo/readme.html#available-adapters) such as Postmark, Mailgun, Mandrill or Send Grid to send emails.
491+
It uses SMTP with an optional [relay](#smtp_host_addr) by default. Alternatively, you can use other [services](https://hexdocs.pm/bamboo/readme.html#available-adapters) such as Postmark, Mailgun, Mandrill or Send Grid to send emails.
492+
493+
[Here's](https://gist.github.com/ruslandoga/c94ce526231fb77930132aaeda3fc3c9) a short guide on using your Gmail account for email delivery.
466494

467495
#### MAILER_ADAPTER
468496

469497
Default: `Bamboo.SMTPAdapter`
470498

471499
Instead of the default, you can replace this with <kbd>Bamboo.PostmarkAdapter</kbd>, <kbd>Bamboo.MailgunAdapter</kbd>, <kbd>Bamboo.MandrillAdapter</kbd> or <kbd>Bamboo.SendGridAdapter</kbd> and add the appropriate variables.
472500

501+
<details>
502+
<summary>Having problems with the default SMTP client?</summary>
503+
504+
---
505+
506+
Please try the new SMTP client introduced in [v2.1.0-rc.1](https://github.com/plausible/analytics/discussions/4084) by setting MAILER_ADAPTER to `Bamboo.Mua`. All the `SMTP_*` environment variables can stay the same.
507+
508+
<sub><kbd>plausible-conf.env</kbd></sub>
509+
```diff
510+
BASE_URL=https://plausible.example.com
511+
SECRET_KEY_BASE=PkVcxRgQDfQyhPETlog3vvCrj5LdYFSv4ejPEJHJO+i/37w6RZfRjeVCpJayjUjJMfXsNurcv5upPhTRoD3KgQ==
512+
TOTP_VAULT_KEY=aihU7k+GSBKbcVFuX9VEPyUhuwlKEomqA94/SQQ0NR4=
513+
SMTP_HOST_ADDR=smtp.gmail.com
514+
SMTP_HOST_PORT=587
515+
516+
SMTP_USER_PWD="wnqj fkbn jcwc byxk"
517+
+ MAILER_ADAPTER=Bamboo.Mua
518+
```
519+
520+
We plan to make it the new default in the final v2.1.0 release.
521+
522+
---
523+
524+
</details>
525+
473526
#### MAILER_EMAIL
474527

475528
@@ -484,8 +537,6 @@ The display name for the sender (_from_).
484537

485538
#### SMTP_HOST_ADDR
486539

487-
Default: [`mail`](./docker-compose.yml#L3-L5)
488-
489540
The host address of your SMTP relay.
490541

491542
#### SMTP_HOST_PORT
@@ -751,6 +802,10 @@ Trust our own application.
751802

752803
<img src="./images/6-continue.png">
753804

805+
Trust more.
806+
807+
<img src="./images/6-sign-in-copycat.png">
808+
754809
Allow viewing Search Console data.
755810

756811
<img src="./images/6-view-search-console-data.png">
@@ -801,10 +856,22 @@ Trust our own application.
801856

802857
<img src="./images/6-continue.png">
803858

804-
Pick the view to import and then follow the Plausible directions.
859+
Trust more.
860+
861+
<img src="./images/6-data-continue.png">
862+
863+
Pick the view to import.
805864

806865
<img src="./images/6-pick-view.png">
807866

867+
And then follow the Plausible directions.
868+
869+
<img src="./images/6-import-continue.png">
870+
871+
Confirm everything's in order and start the import.
872+
873+
<img src="./images/6-import.png">
874+
808875
You'll receive an email once the data is imported.
809876

810877
---

docker-compose.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
services:
2-
mail:
3-
image: bytemark/smtp
4-
restart: always
5-
62
plausible_db:
73
# Plausible v2.0.0 was tested against PostgreSQL versions 12, 13, and 14
84
# https://github.com/plausible/analytics/blob/v2.0.0/.github/workflows/elixir.yml#L16
@@ -14,7 +10,7 @@ services:
1410
- POSTGRES_PASSWORD=postgres
1511

1612
plausible_events_db:
17-
image: clickhouse/clickhouse-server:23.3.7.5-alpine
13+
image: clickhouse/clickhouse-server:24.3.3.102-alpine
1814
restart: always
1915
volumes:
2016
- event-data:/var/lib/clickhouse
@@ -27,13 +23,12 @@ services:
2723
hard: 262144
2824

2925
plausible:
30-
image: plausible/analytics:v2.0
26+
image: ghcr.io/plausible/community-edition:v2.1.0-rc.1
3127
restart: always
3228
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
3329
depends_on:
3430
- plausible_db
3531
- plausible_events_db
36-
- mail
3732
ports:
3833
- 127.0.0.1:8000:8000
3934
env_file:
@@ -46,4 +41,3 @@ volumes:
4641
driver: local
4742
event-logs:
4843
driver: local
49-

images/6-choose-google-account.png

5.72 KB
Loading

images/6-data-continue.png

209 KB
Loading

images/6-data-import.png

4.15 KB
Loading

images/6-import-continue.png

187 KB
Loading

images/6-import.png

170 KB
Loading

images/6-pick-view.png

-38.1 KB
Loading

images/6-plausible-settings-pick.png

6.33 KB
Loading
-4.24 KB
Loading

images/6-property.png

-248 Bytes
Loading

images/6-sign-in-copycat.png

211 KB
Loading

plausible-conf.env

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
BASE_URL=replace-me
22
SECRET_KEY_BASE=replace-me
3+
TOTP_VAULT_KEY=replace-me

0 commit comments

Comments
 (0)