2024-01-14 06:27:12 -08:00
|
|
|
# OpenNeo Analytics
|
|
|
|
|
|
|
|
This is the deployment code we use to set up and manage analytics.openneo.net,
|
|
|
|
a self-hosted copy of [Plausible][pl]! It's an analytics service that's
|
|
|
|
unusually privacy-oriented, keeping as little data as possible to give us an
|
|
|
|
impression of trends in usage and what features people do and don't use.
|
|
|
|
|
|
|
|
We like to use Ansible playbooks to keep track of how we set up our servers,
|
|
|
|
here's how we've structured them! (We don't use very fancy Ansible features:
|
|
|
|
these are all very basic commands, captured in script form for convenience!)
|
|
|
|
|
|
|
|
- `setup-users.yml`: Sets up the user accounts for the system, with their SSH
|
|
|
|
keys for login.
|
|
|
|
- `setup-security.yml`: Sets up firewall rules and automatic system updates.
|
2024-01-14 06:45:35 -08:00
|
|
|
(This is a standard playbook I use for all my servers!)
|
2024-01-14 06:27:12 -08:00
|
|
|
- `setup-nginx.yml`: Sets up the nginx reverse-proxy to sit in front of
|
|
|
|
Plausible, including `certbot` for auto-renewing SSL certificates.
|
|
|
|
- `setup-plausible.yml`: Sets up the Plausible server itself, as a `systemd`
|
|
|
|
service running Plausible's official Docker container.
|
|
|
|
|
2024-02-13 08:36:54 -08:00
|
|
|
You can run them individually, or all at once, with `ansible-playbook`:
|
2024-01-14 06:27:12 -08:00
|
|
|
|
2024-02-13 08:36:54 -08:00
|
|
|
ansible-playbook setup-all.yml
|
2024-01-14 06:27:12 -08:00
|
|
|
|
|
|
|
If you're interested in setting up your own Plausible service, this could be
|
|
|
|
useful as a starting point, there's not much custom here! Just a couple things
|
|
|
|
to note:
|
|
|
|
|
|
|
|
- `setup-users.yml` contains my own username and my own SSH public keys—you'll
|
2024-01-14 06:45:35 -08:00
|
|
|
want to replace those! (Public SSH keys aren't secret, don't worry, I'm fine!)
|
2024-01-14 06:27:12 -08:00
|
|
|
- You'll need to create your own copy of `files/plausible-conf.env`, with your
|
|
|
|
own random secret key. We've omitted ours from the repo for security reasons,
|
2024-01-14 06:45:35 -08:00
|
|
|
but `files/plausible-conf.example.env` is similar!
|
2024-01-14 06:27:12 -08:00
|
|
|
- We used the latest version of Plausible available at the time we deployed,
|
|
|
|
but it's possible you're reading this later. It's worth checking out
|
|
|
|
Plausible's own self-hosting instructions, and making sure your copy of
|
|
|
|
`files/docker-compose.yml` references the latest versions.
|
|
|
|
- This code is distributed under the GPLv3 license; see the `LICENSE` file for
|
|
|
|
more details.
|
|
|
|
|
|
|
|
Hope this helps!
|
|
|
|
|
|
|
|
[pl]: https://plausible.io/
|