Custom websites without too much suffering.
This is a standard Django application with uv.
-
Set up a new postgresql database called
pulsar
with a userpulsar
and no password. -
Setup environment variables with:
cp .envrc.example .envrc
source .envrc
- Create database tables with:
uv run manage.py migrate
- Run development server with:
uv run manage.py runserver
Run Python formatting with:
uv run ruff format
Run Python linting with:
uv run ruff check --fix
Run Djade Django HTML formatting with:
uv run djade main/templates/**/*.html
Every commit on branch main
auto-deploys using GitHub Actions.
- Get a domain name eg. example.com
- Get a server with an IP eg 142.250.187.238
- Ensure server access over ssh with the root user, eg.
ssh root@142.250.187.238
- Set DNS records
a. One A record at the root domain, pointing to your domain, eg.
example.com
->142.250.187.238
a. And one A record at the wildcard subdomain, eg*.example.com
->142.250.187.238
# install uv: https://github.com/astral-sh/uv?tab=readme-ov-file#installation
curl -LsSf https://astral.sh/uv/install.sh | sh
# clone
git clone https://github.com/sirodoht/pulsarpub
cd pulsarpub/
cp ansible/.envrc.example ansible/.envrc
# edit ansible/.envrc with your details
# ANSIBLE_HOST should be your server IP
# DOMAIN_NAME your domain name
# SECRET_KEY a random string of ~50 chars and symbols
# POSTGRES_PASSWORD a >20 char password
# DATABASE_URL change the password to be same as POSTGRES_PASSWORD
vim ansible/.envrc
uv sync
cd ansible/
uv run ansible-playbook -v playbook.yaml
That's it. Open your browser and visit your pulsar instance at your domain. It should take a few seconds to generate the TLS certificate the first time.
Once done, you can also enable premium subscriptions. Pulsar supports Stripe.
- Create a Stripe account
- Get your API keys from the Stripe Dashboard
- Create a subscription product and get the price ID
- Add the following environment variables to your
.envrc
file:
export STRIPE_PUBLISHABLE_KEY=pk_test_...
export STRIPE_SECRET_KEY=sk_test_...
export STRIPE_WEBHOOK_SECRET=whsec_...
export STRIPE_PRICE_ID=price_...
- Set up a webhook endpoint in Stripe Dashboard pointing to
/webhooks/stripe/
- Configure the webhook to listen for these events:
customer.subscription.created
customer.subscription.updated
customer.subscription.deleted
invoice.payment_succeeded
invoice.payment_failed
Copyright pulsarpub 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.