circle appeal tool
  • Python 73.4%
  • JavaScript 12%
  • HTML 7.8%
  • Shell 3.4%
  • CSS 2.3%
  • Other 1%
Find a file
ri0t c8d517cf38 🔒 gates the verify-address action on change permission
Flagged by the automated review of 107d69f, and it is real. Django offers
an admin action to anyone who can reach the changelist, and *view*
permission is enough to reach one -- so a read-only staff account could
select addresses and mark them verified, which is
ACCOUNT_EMAIL_VERIFICATION bypassed from inside the admin. Verifying an
address nobody proved ownership of is exactly what that setting exists to
prevent.

permissions=["change"] is the whole fix; the test is a staff user holding
only view_emailaddress, posting the action, and the address staying
unverified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-12 21:17:32 +01:00
bugs 🔐 actually validates bug-report uploads 2026-11-05 19:53:25 +01:00
cask 🕵 recovers the client IP that a unix socket cannot carry 2026-11-12 20:27:57 +01:00
cask_requests 🔒 gates the verify-address action on change permission 2026-11-12 21:17:32 +01:00
deploy 🔑 the admin has to own the socket directory; podman unshare cannot 2026-11-12 15:31:26 +01:00
docs 🔑 the admin has to own the socket directory; podman unshare cannot 2026-11-12 15:31:26 +01:00
pads 🧦 supervises the container with a quadlet and fixes the socket ownership 2026-11-08 14:23:30 +01:00
scripts 🐞 adds the bug reporter, a beta banner, and mail that cannot escape 2026-11-05 19:44:18 +01:00
static 🐞 adds the bug reporter, a beta banner, and mail that cannot escape 2026-11-05 19:44:18 +01:00
templates 🐞 adds the bug reporter, a beta banner, and mail that cannot escape 2026-11-05 19:44:18 +01:00
.containerignore 🐋 adds single-container podman image 2026-10-25 14:55:55 +01:00
.env.example 🔧 fixes deployment blockers for reverse-proxy and container hosting 2026-10-25 14:35:24 +01:00
.gitignore 🐞 adds the bug reporter, a beta banner, and mail that cannot escape 2026-11-05 19:44:18 +01:00
CLAUDE.md 🧦 supervises the container with a quadlet and fixes the socket ownership 2026-11-08 14:23:30 +01:00
conftest.py 🐞 adds the bug reporter, a beta banner, and mail that cannot escape 2026-11-05 19:44:18 +01:00
Containerfile 🪚 splits the app layer so code-only updates ship 6.6MB, not 243MB 2026-11-08 14:49:24 +01:00
dev 📨 makes the templated reply flow actually work 2026-10-27 18:15:05 +01:00
devenv.nix 🎭 adds real browser tests, and fixes a confidentiality hole they led to 2026-10-27 17:26:11 +01:00
devenv.yaml 🧹 tracks devenv.yaml and pycrdt reference, binds dev server to localhost 2026-10-25 18:15:18 +01:00
feature-ideas.md 📝 carries over in-progress notes, protocol header and form toggles 2026-10-25 18:15:18 +01:00
gunicorn.conf.py 🕵 recovers the client IP that a unix socket cannot carry 2026-11-12 20:27:57 +01:00
LICENSE 📄 added AGPL license 2026-08-07 18:18:53 +02:00
Makefile 🎭 adds real browser tests, and fixes a confidentiality hole they led to 2026-10-27 17:26:11 +01:00
manage.py 🔧 update dev environment, deps, and scripting 2026-08-03 22:53:33 +02:00
pyproject.toml 🧦 supervises the container with a quadlet and fixes the socket ownership 2026-11-08 14:23:30 +01:00
README.md 🎨 gives errors a template, and clears out stale config 2026-10-26 04:08:51 +01:00
uv.lock 🧦 supervises the container with a quadlet and fixes the socket ownership 2026-11-08 14:23:30 +01:00

c-ask

A Django form tool for c-base members and aliens (non-members) to formally request something from the circle (c-base's plenum group) in a structured, auditable way.

On submission, c-ask sends a formatted email to the appropriate address (circle@c-base.org, cultorga@c-base.org, or counselor@c-base.org) with a link to review the request on the c-ask dashboard. A backoffice lets staff examine requests, add comments, close/reopen items, generate plenum topic lists, and respond via templates.

Request types

Type Who Description
Event Everyone Request c-base infrastructure for an event (bar, projector, streaming, etc.)
Filming Everyone Use c-base as a filming location
Info Topic Everyone General announcement or member presentation
Dispute Members File a formal dispute between members
Funding Members Apply for project/EVA/event funding
Circle Membership Members Apply to join c-base's circle
CEY / Soundlab / C-Lab Membership Members Apply for group membership + key access

Tech stack

  • Framework: Django 6.0 (ASGI)
  • Database: PostgreSQL
  • Auth: django-allauth (c-base OAuth provider, Apple, Discord, GitHub, Google, etc.) + MFA (TOTP, WebAuthn, recovery codes)
  • Admin UI: django-unfold
  • Forms/UI: Bootstrap 5, crispy-forms, HTMX, Chart.js
  • Async: Django Channels (Redis channel layer)
  • Email: django-mailer + template-based email composition
  • Dev: Nix (devenv.sh), uv, pytest, pyright

Quick start

Prerequisites

Run locally

# Enter the dev environment (spawns PostgreSQL, Mailpit, dev server, Sass watcher)
devenv shell

# Run migrations and load fixtures
make setup

# Open the dev server at http://127.0.0.1:8002
# Mailpit catches all emails at http://127.0.0.1:8025

Tests

# Unit + integration tests
make test

# E2E tests (Playwright)
make e2e

Linting

make lint      # ruff check
make format    # ruff format
make typecheck # pyright strict mode
make watch-typecheck # file-watcher mode

Database

make migrate            # apply pending migrations
make makemigrations     # generate new migrations
make graphmodels        # draw model diagram to docs/models.png

Project structure

├── cask/                        # Django project config (settings, URLs, ASGI)
│   ├── settings.py              # all Django settings
│   ├── asgi.py                  # ASGI entry point (Channels)
│   └── urls.py                  # top-level URL routing
├── cask_requests/               # Django app (models, views, forms, emails)
│   ├── models.py                # request/appeal domain models
│   ├── views.py                 # list/create/detail/update views
│   ├── forms.py                 # form definitions with crispy
│   ├── emails.py                # email composition & templates
│   ├── email_templates/         # email body templates per request type
│   ├── markdown_templates/      # email header/footer markdown
│   ├── admin.py                 # unfold admin customizations
│   ├── filters.py               # django-filter filter sets
│   ├── signals.py               # post-save signal handlers
│   ├── widgets.py               # custom form widgets
│   ├── templatetags/            # template filters (cask_extras, json_serializer)
│   └── migrations/              # schema migrations (0001–0007)
├── templates/                   # project templates
│   ├── base.html                # base layout (navbar, bootstrap, htmx)
│   ├── index.html               # landing page (request type cards)
│   ├── office/                  # backoffice templates
│   ├── requests/                # request form/detail templates
│   └── account/                 # allauth template overrides
├── Containerfile                # single-container image (postgres+redis+django+celery)
├── deploy/
│   ├── container/               # container deployment (s6 services, env, docs)
│   └── ...                      # legacy bare-metal (nginx, systemd, backup)
├── scripts/                     # utility scripts (runserver, lint, collectstatic)
├── production_static/           # collected static files (auto-generated)
├── devenv.nix                   # dev environment definition
├── pyproject.toml               # dependencies & tool configs
├── .env.example                 # environment variable reference
└── docs/PLAN.md                 # domain logic & request type specs

Configuration

Copy .env.example to .env and set the required values. The critical variables:

Variable Required Notes
SECRET_KEY Yes Never deploy without one
DB_PASSWORD Yes PostgreSQL password
DEBUG No False in production (required)
CASKDEV No Set to 1 for dev mode
ALLOWED_HOSTS_EXTRA Behind a proxy Comma-separated public domains; without it every request 400s
CSRF_TRUSTED_ORIGINS Behind TLS e.g. https://circle.c-base.org; without it every POST 403s
SITE_DOMAIN Yes Drives django.contrib.sites; without it allauth verification links point at example.com
SECURE_SSL_REDIRECT Behind TLS Also the only thing that enables SECURE_PROXY_SSL_HEADER
MAIL_HOST / MAIL_PORT No Mailpit default: localhost:1025

A single podman image bundles PostgreSQL, Redis, gunicorn and Celery, so it deploys on a host where you only have rootless podman — no root, no systemd --user. Only SMTP is external.

podman build --format docker -t localhost/cask:latest .
cp deploy/container/env.example ~/cask/cask.env   # set SECRET_KEY at minimum
podman volume create cask-pgdata && podman volume create cask-state

podman run -d --name cask --restart=always \
  --env-file ~/cask/cask.env \
  -p 127.0.0.1:18000:8000 \
  -v cask-pgdata:/var/lib/postgresql \
  -v cask-state:/var/lib/cask \
  --shm-size=256m --stop-timeout=60 \
  localhost/cask:latest

--format docker is required — podman's default OCI format silently discards the HEALTHCHECK. Point your reverse proxy at port 18000 and pass X-Forwarded-Proto.

See deploy/container/README.md for the full env contract, the reboot-survival recipe, the nginx snippet, volume and backup handling, and host prerequisites.

Production deployment (bare metal, legacy)

Legacy. This path needs root on the target host and is superseded by the container above. Do not run both against the same database. Note also that deploy/nginx/cask.conf serves static and media from a path that does not exist, and deploy/setup.sh reads its domain positionally — so --domain circle.c-base.org sets the domain to the literal --domain.

# Run on a fresh VM as root
sudo bash deploy/setup.sh circle.c-base.org

This installs system packages, sets up PostgreSQL, configures nginx + systemd services, obtains an SSL cert via certbot, and starts the app. Post-deploy:

# Configure .env with real values
# Run daily backups (set up cron)
sudo bash deploy/backup.sh

Email routing

Request type To CC
Event cultorga@c-base.org —
Filming cultorga@c-base.org —
Dispute circle@c-base.org counselor@c-base.org
Funding circle@c-base.org —
Info Topic circle@c-base.org —
Circle Membership circle@c-base.org —

Contributing

  1. devenv shell to enter the dev environment
  2. Work on your feature
  3. make lint && make typecheck && make test to verify
  4. Commit with gitmoji prefix (e.g. feat:, fix:, chore:)
  5. Open a PR

License: AGPL3

This project is licensed under the GNU Affero Public License 3.0 (AGPL-3.0) which you can find in fulltext in the provided LICENSE file.