aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: bc8d7a0f66ddb23d987121b1b7cc019f5b97875e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# diddle

Minimalist scheduling. A mobile friendly, fast, self-hosted Doodle alternative.

## Installation

The Diddle app is a traditional Flask web app that uses PostgreSQL for persistence. User settings are stored in HTTP cookies.

Build a container image with `docker compose` (see `compose.yml`):

    docker compose build

or directly with `docker build`:

    docker build -t diddle:latest .

Deploy the image as you see fit.

You can also run the app without containerization:

    pip install -r requirements.txt # install pip dependencies
    touch .env                      # put your env vars here
    python apply_migrations.py      # prepare the database
    gunicorn --bind "0.0.0.0:8000" -w 4 app:app

## Environment variables

| Variable | Description |
| -------- | ----------- |
| BASE_URL | E.g. `diddle.my-server.net`, used as a prefix in dynamically generated links **(required)** |
| DB_PASSWORD | Postgres password **(required)** |
| DB_HOST | Postgres host (default: db) |
| DB_PORT | Postgres port (default: 5432) |
| DB_DATABASE | Postgres database (default: postgres) |
| DB_USER | Postgres user (default: postgres) |
| EMAIL_HOST | SMTP host address |
| EMAIL_PORT | SMTP port |
| EMAIL_HOST_USER | SMTP host user |
| EMAIL_HOST_PASSWORD | SMTP host password |
| EMAIL_USE_TLS | Use STARTTLS with SMTP? |
| EMAIL_HEADERS | Additional SMTP headers, format: `header1=foo,header2=bar` |
| EMAIL_MESSAGE_FROM | Email message from address |

`EMAIL_` variables are only required if at least one of them is defined.

## Screenshots

### Front page

![Front page](docs/screenshot_frontpage.png)

### Manage poll page

![Manage poll page](docs/screenshot_manage.png)

### Vote page (table mode)

![Vote page table mode](docs/screenshot_poll_table.png)

### Vote page (list mode)

![Vote page list mode](docs/screenshot_poll_list.png)

## Development

Run Flask in dev mode:

    flask --app app --debug run -p 8000