Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
309 commits
Select commit Hold shift + click to select a range
3ead121
Remove traces of south (now unused)
McCio Feb 19, 2019
6b71ca9
Upgrade celery
McCio Feb 19, 2019
f33aa83
[DJ1.9] Fix some imports for django 1.9
McCio Feb 19, 2019
48e87d0
A bit more homogeneous redirect creation
McCio Feb 19, 2019
83b3c1a
Improvements to tests
McCio Feb 19, 2019
6c65968
[DJ1.9] Pre-fix tests for Django 1.9
McCio Feb 19, 2019
dc1b303
[DJ1.10] Redefine template settings
McCio Feb 19, 2019
59bd82f
[Travis] Upgrade pip instead of fixing setuptools' version
McCio Feb 19, 2019
6078c1c
[DJ1.9] Cannot import models from a django-app init (even as third-pa…
McCio Feb 19, 2019
04268e9
Use urlparse.parse_qs instead of cgi.parse_qs (deprecated)
McCio Feb 19, 2019
b94b798
Fixed election sorting in admin elections page
replaceafill Aug 21, 2018
dda86f9
Explicit some more imports removing almost all conflicting 'import *'
McCio Feb 19, 2019
a70a4be
Restore functionality of extract-passwords-for-email
McCio Feb 19, 2019
d973dd4
Upgrade Django to 1.9
McCio Mar 4, 2019
fa9b1be
[DJ1.10] SubfieldBase has been deprecated. Use Field.from_db_value in…
McCio Mar 4, 2019
6e4c92c
Silence urls.W002 warning.
McCio Mar 4, 2019
f768800
[DJ2] on_delete will be a required arg for ForeignKey, currently defa…
McCio Mar 4, 2019
c2c7f86
[DJ1.10] Upgrade Celery to 4.2.1, Kombu to 4.2.0
McCio Mar 4, 2019
1df36cd
[DJ2] SelectDateWidget is moved out of extras
McCio Mar 4, 2019
69ec942
[tests] Extend setup_login capabilities
McCio Mar 5, 2019
53c42db
[tests] Add admin user fixture and test accessibility of stats
McCio Mar 5, 2019
1b876a2
[DJ1.10] Update stats_urls to have names and be reversed by name
McCio Mar 7, 2019
ed9cf10
[DJ1.10] Update election_urls to have names and be reversed by name
McCio Mar 7, 2019
94cd4ae
[DJ1.10] Update helios.urls to have names and be reversed by name
McCio Mar 7, 2019
1d07bbc
Make stats_url_names and election_url_names visible from url_names
McCio Mar 7, 2019
742e12b
[DJ1.10] Update helios_auth.urls to have names and be reversed by name
McCio Mar 7, 2019
42025b9
[DJ1.10] Upgrade to Django 1.10
McCio Mar 7, 2019
18e2410
[DJ1.10] reverse function is now in django.urls
McCio Mar 5, 2019
350fd20
[DJ1.11] Fix widgets
McCio Mar 7, 2019
993f020
[DJ1.11] Upgrade to Django 1.11
McCio Mar 7, 2019
28ad702
[Travis] Test to run travis on both Xenial and Trusty
McCio Mar 7, 2019
d68c50c
[Travis] Postgres 9.3 isn't present in Xenial
McCio Mar 7, 2019
c36f0a9
Fix csrf_token on perms_why
McCio Mar 7, 2019
c57f1ac
[DJ2] Update HSTS Middleware to latest definition
McCio Mar 7, 2019
788ab95
Merge remote-tracking branch 'benadida/master' into django-1.11
McCio Mar 7, 2019
4be568f
Merge pull request #214 from McCio/mccio/auth-improve
benadida Apr 1, 2019
cbf92cb
Order loaded voter files by date
shirlei Mar 25, 2018
af9214d
Merge pull request #218 from shirlei/order_voter_files
benadida Apr 3, 2019
b453952
Update random.js
pereira Apr 11, 2019
895f3e2
Merge pull request #220 from pereira/master
benadida Apr 11, 2019
592a08a
Merge remote-tracking branch 'benadida/master' into django-1.11
McCio Jun 30, 2019
b52a755
Update pull from benadida repository. (#3)
millosolomillo Aug 21, 2019
df0d2c5
Revert "Update pull from benadida repository. (#3)" (#4)
millosolomillo Aug 21, 2019
fc6ce6e
Merge pull request #5 from benadida/master
millosolomillo Aug 21, 2019
1e7b3dd
Bump Django to 1.11.28
McCio Feb 17, 2020
f3435cb
[DJ1.8+] remove unneeded django-sslify and django-secure
McCio Mar 3, 2020
588979a
[celery] Make celery backend configurable
McCio Mar 22, 2020
3f04f6e
[readme] revert travis badge to benadida/helios-server
McCio Mar 22, 2020
0533e63
Merge pull request #217 from McCio/django-1.11
benadida Mar 24, 2020
4499889
add recent significant contributors
benadida Mar 28, 2020
9b697dc
Pulling updated benadida master branch (#6)
millosolomillo Apr 16, 2020
5bfd91a
Revert "Pulling updated benadida master branch (#6)" (#7)
millosolomillo Apr 16, 2020
ba296dc
Merge pull request #8 from benadida/master
millosolomillo Apr 16, 2020
da0f0f6
Approval voting improved message
DavidMertz Jun 7, 2020
15cfd7c
Update heliosbooth/templates/seal.html
DavidMertz Jun 7, 2020
25cb906
Remove in-house random pool in favor of pycryptodome library
McCio Jun 30, 2019
66ea4f6
Completely move to python 3, updating some libraries
McCio Jun 30, 2019
9f3ae27
[fix] Fix opening voter file as binary for unicodecsv reading
McCio Mar 3, 2020
338e6cd
[tests] Let django test handle the json conversion where possible
McCio Mar 3, 2020
25458ed
[tests] Minor test edit
McCio Mar 3, 2020
509b542
[py3] str-bytes comparisons
McCio Mar 3, 2020
393e7d9
Ignore multiple venv folders
McCio Mar 3, 2020
c2669a6
[bleach] Upgrade bleach
McCio Mar 3, 2020
074e931
Upgrade django-picklefield
McCio Mar 3, 2020
b62760c
[bleach] actually use bleach
McCio Mar 3, 2020
61ddefe
[tests] redirect improvements
McCio Mar 3, 2020
f1ce2f9
[auth] enforce AUTH_ENABLED_SYSTEMS
McCio Mar 3, 2020
bcc429d
[logging] log only INFO if not TESTING
McCio Mar 3, 2020
b588cf2
[db] db variables in settings and dj_database_url/psycopg2 upgrades
McCio Mar 3, 2020
63c13df
[deps] remove html5lib, requests, webtest.
McCio Mar 3, 2020
f315ab7
[Facebook] completely remove facebookclient
McCio Mar 3, 2020
d812168
[Travis] try to update travis tests matrix
McCio Mar 3, 2020
98efedf
[Travis] remove bionic.pg12 and add xenial.pg10
McCio Mar 3, 2020
396d169
[Travis] specify better matrix
McCio Mar 3, 2020
2af3e4f
[Travis] fix
McCio Mar 3, 2020
ae6e359
EncryptedVote JSON should not contain whitespace
thotypous Jul 25, 2020
755b038
Orders trustees by id
eduardormanika Jul 5, 2020
b54ffd0
Create a true Python list of these objects
eduardormanika Jul 9, 2020
d9f39f2
Update install instructions
milouk Jan 3, 2021
056eb56
type mismatch in new django version, max age needs to be an int
benadida Jan 10, 2021
684b249
log to stdout for heroku deployments and others
benadida Jan 10, 2021
302cda9
election extra var unnecessary and causes serialization issue
benadida Jan 10, 2021
e1090c7
Merge branch 'master' into bens-cleaned-up-py3
benadida Jan 23, 2021
0075e5a
missing migration
benadida Jan 23, 2021
b795f1c
fix python3-related bytes-to-string conversion in google auth
benadida Jan 23, 2021
64f6033
updated install instructions for python3
benadida Jan 23, 2021
a5b7009
Updated INSTALL.md with comment about RabbitMQ.
rgristroph Jan 24, 2021
fc22228
fix: python3 bytes to string for randomness
benadida Jan 25, 2021
728ade8
Merge branch 'master' into bens-cleaned-up-py3
benadida Jan 25, 2021
5682807
heroku python3 runtime indicator
benadida Jan 30, 2021
aa38530
update install instructions
benadida Feb 1, 2021
bdd916f
revert to other email validation package
benadida Feb 1, 2021
352a493
Remove numbering fields
shirlei Feb 7, 2021
f334fe0
Compress values before passing to format_value
shirlei Feb 7, 2021
2c5d5fb
fix trustee email display in verifier
benadida Feb 8, 2021
0f0948a
Merge pull request #277 from benadida/bens-cleaned-up-py3
benadida Feb 8, 2021
242719f
Fixing typo in install guide
pauarge Feb 10, 2021
bc09371
auth systems should always be present, even if not enabled, otherwise…
benadida Feb 13, 2021
b7243dc
allow for uploading of a latin1-encoded voter file, not just utf-8
benadida Feb 22, 2021
cd0b10f
handle badly formed timestamp
benadida Feb 22, 2021
3431846
Import Helios Models After Django Setup
itamarjp Aug 30, 2020
60e6629
Merge branch 'master' into election-view-detail
benadida Feb 22, 2021
4f31b43
Merge pull request #202 from edmarmartineli/election-view-detail
benadida Feb 22, 2021
9fa9fa9
Bump bleach from 1.4.1 to 3.3.0
dependabot[bot] Feb 8, 2021
b6d54e4
move to django 2.2
benadida Feb 22, 2021
f443261
hash utility should return an ascii string by default, was previously…
benadida Feb 22, 2021
9308a72
update python
benadida Mar 1, 2021
05a2788
instantiate gh auth flow
lizthegrey Aug 12, 2021
7036d55
The election object was not provided when the email is sent
edmarmartineli Feb 27, 2021
093a5e9
Bump django from 2.2.19 to 2.2.24
dependabot[bot] Jun 10, 2021
1a95b5f
wip
lizthegrey Sep 17, 2021
6e1aaaf
add voter_type to preview
lizthegrey Sep 17, 2021
99e1c17
fix obvious errors
lizthegrey Sep 17, 2021
e3f3ad4
avoid double-creating users
lizthegrey Sep 17, 2021
1da79be
Merge pull request #320 from lizthegrey/lizf.github-batch
benadida Oct 5, 2021
c478731
allow viewing a vote by full hash so we don't do quite as many DB que…
benadida Oct 6, 2021
ed351f4
remove link while figuring out error
benadida Oct 6, 2021
e94b952
show available voter types
benadida Oct 7, 2021
35b5cda
try U
benadida Oct 7, 2021
500c1b7
fixed UTF BOM
benadida Oct 7, 2021
e0e1d1f
fix bug introduced in previous PR with password uploads
benadida Oct 7, 2021
607e6b5
Merge pull request #240 from millosolomillo/master
benadida Oct 7, 2021
7b5a8b8
feat: allow sending email directly via mailgun API as an option
benadida Oct 18, 2021
3d1e839
Making Helios Booth responsive
pauarge Feb 16, 2021
9a4b295
format for ADMINS was wrong, fixing.
benadida Dec 5, 2021
d37ee8c
Open voter_stream in rb (binary) mode
Nov 14, 2021
d62ef20
Use substr() instead of substring() in SQL query
Nov 14, 2021
9a39b4e
don't error out if session has been cleared on cast done page.
benadida Dec 5, 2021
f5b021e
Drop superfluous x bits on pyton module and changelog
Dec 5, 2021
02b1959
add per question random order
benadida Dec 5, 2021
19555c3
improved vote casting confirmation email
benadida Dec 5, 2021
b18e3f6
fix padding
benadida Jan 12, 2022
9c7f138
ensure that a password voter has at least an empty user info dictiona…
benadida Jan 14, 2022
3695c8d
no name, use email instead for password voters
benadida Jan 14, 2022
6c181fc
simplify language that no one is reading anyways, get the audit out o…
benadida Jan 15, 2022
ee7d037
more streamlining of text, removal of 'smart' from ballot tracker cau…
benadida Jan 15, 2022
849564f
tweaks to FAQ for 2022
benadida Jan 15, 2022
ab322e5
nicer buttons, lighter text, clearer submission
benadida Jan 15, 2022
02049ba
more tweaks
benadida Jan 15, 2022
d2d2ab0
small tweaks
benadida Jan 17, 2022
b92f1d4
explain tracker, fix layout
benadida Jan 21, 2022
08c1874
additional guidance throughout the voting process
benadida Jan 28, 2022
8feb285
simpler templates
benadida Jan 28, 2022
b7195a0
small patch to make menu work on mobile. Ultimately need to upgrade f…
benadida Feb 6, 2022
e76171f
removed extraneous class
benadida Feb 6, 2022
68afb1e
simplified the template for additional info to make it more flexible.
benadida Mar 31, 2022
017a53c
fix copy help_email when copying election
edmarmartineli Dec 16, 2021
1f28c31
Update incorrect Scantegrity link
bkmgit Jan 4, 2023
57fb135
Remove broken Prêt à Voter link
bkmgit Jan 4, 2023
45f4069
Add ldapauth system
shirlei Feb 25, 2023
b1eeb1b
Some adjustments for python 3.6
shirlei Mar 3, 2023
067dfa9
Add ldap auth icon
shirlei Mar 3, 2023
1b8e92a
Do not enable LDAP by default
shirlei Apr 9, 2023
cea7411
Remove non-PR-related setting
shirlei Apr 9, 2023
2a2ecf8
tweak ballot submission button to clarify that your ballot won't be f…
benadida Feb 10, 2024
65e30cf
update python runtime
benadida Feb 10, 2024
fe35c7d
Revert "update python runtime"
benadida Feb 10, 2024
609352a
upgrade to python 3.8
benadida Apr 14, 2024
26fc185
python 3.9
benadida Apr 14, 2024
e83077b
Remove election.json
pauarge Apr 24, 2024
1dcaf3e
Remove unicodecsv dependency
pauarge Apr 24, 2024
c7ed060
Updating python dependencies
pauarge Apr 24, 2024
c841d2b
Update to Django 3.0
laoumh Jul 25, 2024
2506a31
Adds 'ldap' option to AUTH_ENABLED_SYSTEMS when in TESTING mode
laoumh Jul 26, 2024
b8d7449
Upgrade Django 3.0 to 4.0: django.conf.urls.url is removed, using dja…
laoumh Jul 29, 2024
21624b3
Upgrade Django 3.0 to 4.0: django.utils.translation.ugettext() is rem…
laoumh Jul 30, 2024
6ce8806
Upgrade Django 3.0 to 4.0: The 'providing_args' argument for django.d…
laoumh Jul 30, 2024
8713201
Upgrade Django 3.0 to 4.0: The {% ifequal %} and {% ifnotequal %} tem…
laoumh Jul 30, 2024
2bc8e1e
Upgrade Django 4.0 to 5.0
laoumh Jul 31, 2024
dc6aae0
Upgrade Django 4.0 to 5.0: update requirements.txt
laoumh Aug 1, 2024
4d4461a
Explicitly set DEFAULT_AUTO_FIELD, to silence warning models.W042 aft…
laoumh Aug 12, 2024
39c8902
up runtime to 3.12
benadida Sep 15, 2024
796614d
add Lucas Araujo to CONTRIBUTORS for upgrade to Django 5
benadida Sep 16, 2024
ca3dc88
allow better searching for admins, add missing election fixture
benadida Jun 20, 2025
952ed29
email opt-out feature, with assitance from Claude Code.
benadida Jun 21, 2025
c4275cd
Update psycopg2 to support Python 3.13
uhei Jun 18, 2025
56dbfc3
feat(helios_auth): add Gitlab
uhei May 31, 2025
7bded10
Update views.py
Cryptosaurus May 5, 2023
9416a1b
fix tests
benadida Jun 21, 2025
4c70505
allow CSV download of voters
benadida Jun 22, 2025
66146c9
clean up the question setup interface a little bit
benadida Jun 22, 2025
2c9a811
improve opt-in/opt-out to require confirmation so a simple link click…
benadida Nov 22, 2025
8b69faa
no more confusing error when trying to opt back in twice.
benadida Nov 22, 2025
d185fee
more thorough validation of secret key
benadida Dec 2, 2025
be54e96
enable multiple administrators for an election
benadida Dec 2, 2025
096e8fb
Disable voter emails for elections tallied more than a configurable n…
benadida Jan 2, 2026
93000f6
fix: silence invalid escape sequence warnings
fabianzw Dec 27, 2025
286220b
fix: update INSTALL.md with correct versions and fix formatting
claude Jan 3, 2026
59db8be
fix: update Python version to 3.12 to match runtime.txt
claude Jan 3, 2026
bb2e649
add inital CLAUDE.md
benadida Jan 3, 2026
2dcaee8
add test and fix atomicity of multiple pseudonymous voter uploads
benadida Jan 3, 2026
1175cbc
Remove legacy browser crypto workaround (issue #373)
claude Jan 3, 2026
9eeeebd
Bump python-ldap from 3.4.4 to 3.4.5
dependabot[bot] Oct 10, 2025
a4ee6fb
Improve election datetime picker with modern HTML5 input
claude Jan 3, 2026
0c9f54c
Add datetime picker demo and mockup visualizations
claude Jan 3, 2026
64a746a
Fix Django 5.0 compatibility for DateTimeLocalWidget
claude Jan 3, 2026
bb7ccf5
Remove demo and mockup files, keep only production code
claude Jan 3, 2026
f78063a
Address GitHub Copilot code review feedback
claude Jan 3, 2026
820947e
Use idiomatic build_attrs call without keyword argument
claude Jan 3, 2026
fae1b0f
Add comprehensive unit tests for DateTimeLocalWidget and Field
claude Jan 3, 2026
c2904fb
tweak as per copilot
benadida Jan 3, 2026
8d42388
Fix behaviour when sending email to non-existent voter_id
Cryptosaurus May 10, 2023
3a01eb5
fix: Use integer division when determining winner in absolute questions
golyalpha Dec 9, 2025
83b78b8
Fixed issue in `create_user`
crazyscientist Jan 31, 2023
25cf2d0
Apply suggestion from @Copilot
benadida Jan 3, 2026
7e67703
fix integer math in other location and add tests (#428)
benadida Jan 3, 2026
311056d
Improve voter removal notification email (#429)
benadida Jan 3, 2026
28806e2
Remove unused sample election.json from heliosbooth (#432)
benadida Jan 3, 2026
318a585
Add clear voters feature for unfrozen elections (#431)
benadida Jan 3, 2026
e25464c
Replace uuid.uuid1() with uuid.uuid4() to prevent information leakage…
benadida Jan 3, 2026
4e28a89
Add password resend option for voters (#430)
benadida Jan 3, 2026
c7d3242
Switch from psycopg2 to psycopg2-binary
claude Jan 3, 2026
12c7614
Upgrade Django from 5.0 to 5.2.9
claude Jan 3, 2026
813b927
Add option to print emails to stdout in development mode
claude Jan 3, 2026
c595cfc
Remove unused socialbuttons.html template
claude Jan 4, 2026
3677ff2
Preserve line breaks in question text display
claude Jan 4, 2026
b220948
Add Content-Security-Policy middleware for enhanced XSS protection
claude Jan 4, 2026
a1b6fee
Replace custom CSP middleware with django-csp
claude Jan 4, 2026
36f5b52
explicit setting by copilot
benadida Jan 4, 2026
32a6b35
Add pagination options to bulletin board voter list
claude Jan 4, 2026
be5dd48
good conservative error checking by copilot
benadida Jan 4, 2026
321c507
Remove Twitter authentication support
claude Jan 4, 2026
48704e7
always run the tests
benadida Jan 4, 2026
097c0b3
Case-insensitive GitHub username matching at login (#449)
benadida Jan 4, 2026
bdd7809
add a devlogin auth method for dev mode only to make testing easier (…
benadida Jan 4, 2026
17ac773
Add CSV export for election log (#447)
benadida Jan 4, 2026
fe5c3ea
Prevent vote tabulation with pending queue items (#441)
benadida Jan 4, 2026
8441f2b
Truncate recipient name to 70 characters for email (#446)
benadida Jan 4, 2026
09898d0
Remove check_dns and check_smtp flags from validate_email calls
claude Jan 4, 2026
ff7d267
Audit the dependencies (#439)
benadida Jan 17, 2026
51837f0
Add admin user search feature (#457)
benadida Jan 17, 2026
9d631a4
Migrate CI/CD pipeline to GitHub Actions (#459)
benadida Jan 17, 2026
074156b
Upgrade Python from 3.12.6 to 3.13.11 (#460)
benadida Jan 17, 2026
4b5c461
Block voter upload when election is tallied (fixes #455) (#461)
benadida Jan 17, 2026
3c86a3a
Add dual timezone display (UTC + local) for all timestamps (#453)
benadida Jan 17, 2026
604fac4
Migrate from pip to uv for dependency management (#462)
benadida Jan 17, 2026
c1d9dda
Switch from runtime.txt to .python-version for Heroku uv (#463)
benadida Jan 17, 2026
4e244da
Fix GitHub OAuth scope format to use comma-separated string (#464)
benadida Jan 18, 2026
a1668b1
Surface LinkedIn auth request token errors (#465)
benadida Jan 18, 2026
7d55b78
Migrate LinkedIn auth to official OAuth2 library (#466)
benadida Jan 18, 2026
f2a66f5
Fix LinkedIn OAuth token fetch to send credentials in request body (#…
benadida Jan 18, 2026
a20b336
Fix LinkedIn OAuth scope format to use comma-separated string (#469)
benadida Jan 18, 2026
e388d3f
Prevent voter deletion once tallying has begun (#470) (#471)
benadida Jan 18, 2026
86d4af2
Fix button styling to use consistent Foundation CSS classes (#474)
benadida Jan 18, 2026
573c5b1
docs: add Helios Booth Lit Redesign design plan, removing old one. (#…
benadida Jan 18, 2026
75d6f4c
Soft delete election (#456)
benadida Jan 19, 2026
6739a04
Add index on deleted_at column (#475)
benadida Jan 19, 2026
7a21238
Simplify CI to test only latest PostgreSQL version (#476)
benadida Jan 19, 2026
c3fdde9
Fix recent votes query to only count votes within 24-hour window (#477)
benadida Jan 20, 2026
c7d5e60
Add database indexes for frequently queried fields (#478)
benadida Jan 20, 2026
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
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.13']
postgres-version: ['16']

services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: helios
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
PGHOST: localhost
PGUSER: postgres

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev

- name: Install Python dependencies
run: |
uv sync
uv pip freeze

- name: Run tests
run: uv run python -Wall manage.py test -v 2 --settings=settings_ci
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ deploy-latest.sh
.DS_Store
*~
media/*
venv
.venv
venv*
celerybeat-*
env.sh
.cache
.cache
.idea/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

158 changes: 158 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# CLAUDE.md

This file provides guidance to Claude Code when working with the Helios Election System codebase.

## Project Overview

Helios is an end-to-end verifiable voting system that provides secure, transparent online elections with cryptographic verification. It supports multiple authentication systems (Google, Facebook, GitHub, LDAP, CAS, password, etc.) and uses homomorphic encryption for privacy-preserving vote tallying.

## Critical Instructions for Claude when preparing a PR

- always run the tests. Install everything and run the tests. Every time.

## Technology Stack

- **Python**: 3.13
- **Framework**: Django 5.2
- **Database**: PostgreSQL 9.5+
- **Task Queue**: Celery with RabbitMQ
- **Crypto**: pycryptodome
- **Package Manager**: uv

## Common Commands

```bash
# Install dependencies
uv sync

# Run development server
uv run python manage.py runserver

# Run all tests
uv run python manage.py test -v 2

# Run tests for a specific app
uv run python manage.py test helios -v 2
uv run python manage.py test helios_auth -v 2

# Run a specific test class
uv run python manage.py test helios.tests.ElectionModelTests -v 2

# Database migrations
uv run python manage.py makemigrations
uv run python manage.py migrate

# Reset database (drops and recreates)
./reset.sh

# Start Celery worker (for background tasks)
uv run celery --app helios worker --events --beat --concurrency 1
```

## Project Structure

- `helios/` - Core election system (models, views, crypto, forms)
- `helios_auth/` - Authentication system with multiple backends
- `server_ui/` - Admin web interface
- `heliosbooth/` - JavaScript voting booth interface
- `heliosverifier/` - JavaScript ballot verification interface

## Code Style Conventions

### Naming

- **Boolean fields**: Use `_p` suffix (e.g., `private_p`, `frozen_p`, `admin_p`, `featured_p`)
- **Datetime fields**: Use `_at` suffix (e.g., `created_at`, `frozen_at`, `voting_ends_at`)
- **Functions/methods**: snake_case
- **Classes**: PascalCase

### Indentation

- Use 2-space indentation throughout Python files

### Imports

```python
# Standard library
import copy, csv, datetime, uuid

# Third-party
from django.db import models, transaction
import bleach

# Local
from helios import datatypes, utils
from helios_auth.jsonfield import JSONField
```

## Key Patterns

### View Decorators

Use existing security decorators for views:

```python
from helios.security import election_view, election_admin, trustee_check

@election_view(frozen=True)
def my_view(request, election):
pass

@election_admin()
def admin_view(request, election):
pass
```

### Model Base Class

All domain models inherit from `HeliosModel`:

```python
class MyModel(HeliosModel):
class Meta:
app_label = 'helios'
```

### JSON Responses

```python
from helios.views import render_json
return render_json({'key': 'value'})
```

### Template Rendering

```python
from helios.views import render_template
return render_template(request, 'template_name', {'context': 'vars'})
```

### Database Queries

- Use `@transaction.atomic` for operations that need atomicity
- Prefer `select_related()` for foreign key joins
- Use `get_or_create()` pattern for safe creation

## Security Considerations

- Always use `check_csrf(request)` for POST handlers
- Use `bleach.clean()` for user-provided HTML (see `description_bleached` pattern)
- Never store plaintext passwords; use the auth system's hashing
- Check permissions with `user_can_admin_election()` and similar helpers

## Configuration

Settings use environment variables with defaults:

```python
from settings import get_from_env
MY_SETTING = get_from_env('MY_SETTING', 'default_value')
```

Key environment variables: `DEBUG`, `SECRET_KEY`, `DATABASE_URL`, `CELERY_BROKER_URL`, `AUTH_ENABLED_AUTH_SYSTEMS`

## Testing

- Tests use Django's TestCase with django-webtest
- Fixtures are in `helios/fixtures/`
- Test classes: `ElectionModelTests`, `VoterModelTests`, `ElectionBlackboxTests`, etc.
3 changes: 3 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ Significant contributors:
- Olivier de Marneffe
- Emily Stark, Mike Hamburg, Tom Wu, and Dan Boneh for SJCL and integration of javascript crypto.
- Nicholas Chang-Fong and Aleksander Essex for security reports and fixes.
- Shirley Chaves
- Marco Ciotola
- Lucas Araujo
61 changes: 40 additions & 21 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,69 @@
* install PostgreSQL 8.3+
# Helios Server Installation

* make sure you have virtualenv installed:
http://www.virtualenv.org/en/latest/
## Prerequisites

* download helios-server
* Install PostgreSQL 12+

* cd into the helios-server directory
* Install RabbitMQ
This is needed for Celery to work, which does background processing such as
the processing of uploaded list-of-voter CSV files.

* create a virtualenv:
* Download helios-server

* `cd` into the helios-server directory

## Python Setup

* Install Python 3.13 including dev packages

```
virtualenv venv
sudo apt install python3 python3-dev
```

* activate virtual environment
* Install uv (modern Python package manager)

```
source venv/bin/activate
````
curl -LsSf https://astral.sh/uv/install.sh | sh
```

* install requirements
* You'll also need Postgres dev libraries. For example on Ubuntu:

```
pip install -r requirements.txt
sudo apt install libpq-dev
```

* reset database
* Install dependencies (uv creates a virtual environment automatically)

```
uv sync
```

## Database Setup

* Reset database

```
./reset.sh
```

* start server
## Running the Server

* Start server

```
python manage.py runserver
uv run python manage.py runserver
```

* to get Google Auth working:
## Google Auth Configuration

To get Google Auth working:

** go to https://console.developers.google.com
* Go to https://console.developers.google.com

** create an application
* Create an application

** set up oauth2 credentials as a web application, with your origin, e.g. https://myhelios.example.com, and your auth callback, which, based on our example, is https://myhelios.example.com/auth/after/
* Set up OAuth2 credentials as a web application, with your origin, e.g. `https://myhelios.example.com`, and your auth callback, which based on our example is `https://myhelios.example.com/auth/after/`

** still in the developer console, enable the Google+ API.
* In the developer console, enable the Google People API

** set the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET configuration variables accordingly.
* Set the `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` configuration variables accordingly
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: gunicorn wsgi:application -b 0.0.0.0:$PORT -w 8
worker: python manage.py celeryd -E -B --beat --concurrency=1
worker: celery --app helios worker --events --beat --concurrency 1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Helios is an end-to-end verifiable voting system.

![Travis Build Status](https://travis-ci.org/benadida/helios-server.svg?branch=master)
[![Travis Build Status](https://travis-ci.org/benadida/helios-server.svg?branch=master)](https://travis-ci.org/benadida/helios-server)

[![Stories in Ready](https://badge.waffle.io/benadida/helios-server.png?label=ready&title=Ready)](https://waffle.io/benadida/helios-server)
Loading