Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Hymical Forms configuration.
#
# Copy this file to `.env`, or set the same variables in your process environment.
# FORMS_DATABASE_URL is required. Everything below it is optional and shown with
# its built-in default; uncomment the lines you want to change.

# SQLAlchemy database URL. PostgreSQL is the intended production database.
FORMS_DATABASE_URL=postgresql+psycopg://forms:forms@localhost:5432/forms

# SQLite is supported for local experimentation and backs the test suite. It is
# not a supported production target.
# FORMS_DATABASE_URL=sqlite:///./forms.db

# Largest request body accepted, in bytes. File uploads are not supported, so
# this only needs to accommodate text form fields.
# FORMS_MAX_BODY_BYTES=262144

# Largest number of name/value pairs accepted in one submission. A repeated
# field name (a checkbox group) counts once per submitted value.
# FORMS_MAX_FIELDS=100

# Largest field name accepted, in characters.
# FORMS_MAX_FIELD_NAME_LENGTH=128

# Largest field value accepted, in characters.
# FORMS_MAX_FIELD_VALUE_LENGTH=16384

# How long to wait for a webhook destination to accept a connection, in seconds.
# FORMS_WEBHOOK_CONNECT_TIMEOUT_SECONDS=5

# How long to wait for a webhook destination to respond, in seconds.
# FORMS_WEBHOOK_READ_TIMEOUT_SECONDS=10

# How many delivery attempts a submission gets before it is given up on.
# FORMS_WEBHOOK_MAX_ATTEMPTS=5

# Wait before the second attempt, in seconds. Each later wait doubles it.
# FORMS_WEBHOOK_RETRY_INITIAL_SECONDS=10

# Cap on the wait between attempts, however far the backoff has doubled.
# FORMS_WEBHOOK_RETRY_MAX_SECONDS=3600

# How long the worker waits before looking for due deliveries again, in seconds.
# FORMS_WORKER_POLL_SECONDS=1

# How many deliveries a worker claims at once.
# FORMS_WORKER_BATCH_SIZE=10

# How long a worker's claim on a delivery holds, in seconds. After this the
# delivery becomes claimable again, which is how work is recovered from a worker
# that died holding it.
# FORMS_WORKER_LEASE_SECONDS=60

# Permit webhook destinations on loopback and private addresses, so a webhook can
# point at a server on your own machine. Development only: enabling this in
# production lets anyone who can create an endpoint reach your internal network.
# FORMS_ALLOW_PRIVATE_WEBHOOK_TARGETS=false
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install -e ".[dev]"
- run: ruff check .
- run: ruff format --check .
- run: mypy
- run: pytest
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ local_settings.py
db.sqlite3
db.sqlite3-journal

# Local SQLite databases, e.g. FORMS_DATABASE_URL=sqlite:///./forms.db
*.db
*.db-journal
*.sqlite
*.sqlite3

# Flask stuff:
instance/
.webassets-cache
Expand Down
Loading
Loading