Bearlytics is a privacy-first, no-nonsense web analytics created by Herman.
Here's a quick guide to hosting Bearlytics using Easypanel:
Select your project in Easypanel and click on "+ Service"
Select "Compose [Beta]" and assign a service name
Fill in the YAML configuration as follows:
services: bearlytics: image: ghcr.io/hermanmartinus/bearlytics:latest ports: - 8000:8000 volumes: - ./analytics:/app/data env_file: - .env restart: unless-stopped
Switch to the Environment settings tab of your service and enter the following variables:
CSRF_TRUSTED_ORIGINS=https://your-domain.example.com DB_PATH=/app/data/analytics.db DEBUG=False SALT_SECRET=your-generated-salt SECRET_KEY=your-generated-secret UID=1000 GID=1000
Important: Replace
your-domain.example.com
with your actual domain, and generate secure values for bothSALT_SECRET
andSECRET_KEY
. You can generate these using an online tool or locally (details below).Configure the domain:
- Switch to the Domains tab of your service
- Assign your domain (e.g., your-domain.example.com)
- Set the internal port to 8000
Initial setup:
- Visit your domain (https://your-domain.example.com)
- You'll be prompted to create an admin username and password
- Complete this setup to access your Bearlytics dashboard
Start using Bearlytics:
- Add domains to track
- Get your tracking scripts
- Implement them on your websites
Additional Information
- Bearlytics stores data in the volume mount at
./analytics
, which persists even if you restart the container - Make sure your domain's DNS is properly configured to point to your Easypanel server
- Consider backing up the
analytics.db
regularly to prevent data loss
Generating Secret Key and Salt Values
Here are a few simple methods to generate secure values for your Django SECRET_KEY
and SALT_SECRET
:
Method 1: Using Python's Built-in Tools
Open a Python shell or script and run:
import secrets # Generate a secure SECRET_KEY secret_key = secrets.token_urlsafe(50) print(f"SECRET_KEY: {secret_key}") # Generate a secure SALT_SECRET salt_secret = secrets.token_hex(32) print(f"SALT_SECRET: {salt_secret}")
Method 2: Using Django's get_random_secret_key() Function
If you have Django installed, you can use:
from django.core.management.utils import get_random_secret_key # Generate Django secret key secret_key = get_random_secret_key() print(f"SECRET_KEY: {secret_key}") # For salt, you can use the same function or the secrets module import secrets salt_secret = secrets.token_hex(32) print(f"SALT_SECRET: {salt_secret}")
Method 3: Using Command Line Tools
If you prefer using the command line:
# Generate SECRET_KEY openssl rand -base64 50 # Generate SALT_SECRET openssl rand -hex 32
Method 4: Online Django Secret Key Generator
You can also use an online generator like:
- https://djecrety.ir/
- https://miniwebtool.com/django-secret-key-generator/