~linuxgoose/bocpress

ref: 98de34558ab8ee7a654d54ca97a5e1d379809a73 bocpress/README.md -rw-r--r-- 8.0 KiB
98de3455Jordan Robinson update landing page links and text & footer links 13 days ago
uv run ruff format

To lint:

uv run ruff check
uv run ruff check --fix

#Python dependencies

We use uv to manage dependencies declared in pyproject.toml (see [project] and [dependency-groups]).

Common commands:

# Add or remove dependencies
uv add <package>
uv remove <package>

# Update locked versions and install
uv lock -U
uv sync --all-groups

#Deployment

See the Deployment document for an overview on steps required to deploy a BōcPress instance.

#Useful Commands

To reload the gunicorn process:

sudo systemctl reload bocpress

To reload Caddy:

systemctl restart caddy  # root only

gunicorn logs:

journalctl -fb -u bocpress

Caddy logs:

journalctl -fb -u caddy

Get an overview with systemd status:

systemctl status caddy
systemctl status bocpress

#Backup

See Database Backup for details. In summary:

To create a database dump:

pg_dump -Fc --no-acl bocpress -h localhost -U bocpress -f /home/deploy/bocpress.dump -w

To restore a database dump:

pg_restore -v -h localhost -cO --if-exists -d bocpress -U bocpress -W bocpress.dump

#Management

In addition to the standard Django management commands, there are also:

  • processnotifications: sends notification emails for new blog posts of existing records.
  • mailexports: emails users of their blog exports.

They are triggered using the standard manage.py Django way; eg:

python manage.py processnotifications

#Billing

One can deploy BōcPress without setting up billing functionalities. This is the default case. To handle payments and subscriptions this project uses Stripe. To enable Stripe and payments, one needs to have a Stripe account with a single Product (eg. "BōcPress Premium Plan").

To configure, add the following variables from your Stripe account to your .envrc:

export STRIPE_API_KEY="sk_test_XXX"
export STRIPE_PUBLIC_KEY="pk_test_XXX"
export STRIPE_PRICE_ID="price_XXX"

#License

Copyright Mataroa & BōcPress Contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3.

Forked from Mataroa