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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __pycache__/

# Virtual environments
.venv/
**/.venv/
.env
.env.*

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
# GH actions workflow in the future. The direct method is supposed to be faster so we'll leave it for
# now. When we start to have more complex dependencies within the dockerfile we can swap over.
# Sample run commands:
# docker build -t form-submission-mvp:ci .
# docker run --rm form-submission-mvp:ci uv run pytest -q
# docker build -t litefile:ci .
# docker run --rm litefile:ci uv run pytest -q
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Form Submission MVP
# LITEFile

A minimal Django app for form submission and review. The Django project lives under `efile_app/` with settings in `efile_app/efile/`.

Expand Down Expand Up @@ -80,7 +80,7 @@ The application uses AWS S3 for document storage and file uploads. Follow these
### 1. Create an S3 Bucket

- Log into the AWS Console and navigate to S3
- Create a new bucket (e.g., `forms-mvp-your-suffix`)
- Create a new bucket (e.g., `litefile-your-suffix`)
- Choose your preferred region (default: `us-east-1`)
- Initially, turn off "Block all public access" in the S3 bucket settings. We will need this off initially so that the bucket policy can be applied. After we have created the bucket policy, we will block all public access by toggling back on "Block all public access".
- Tags can be created to help track ownership of resources and is useful for cost tracking, environment tracking, etc.
Expand Down
6 changes: 3 additions & 3 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
DEBUG: "${DEBUG:-0}"
SERVICES: s3
AWS_DEFAULT_REGION: us-east-1
AWS_S3_BUCKET_NAME: forms-mvp-xf6361
AWS_S3_BUCKET_NAME: litefile-staging
volumes:
- localstack:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
Expand All @@ -25,7 +25,7 @@ services:
build:
context: .
dockerfile: Dockerfile
image: form-submission-mvp:web
image: litefile:web
command: >-
sh -c "uv run python manage.py migrate --noinput --fake-initial &&
uv run python manage.py runserver 0.0.0.0:8000"
Expand All @@ -39,7 +39,7 @@ services:
PYTHONUNBUFFERED: "1"
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_S3_BUCKET_NAME: forms-mvp-xf6361
AWS_S3_BUCKET_NAME: litefile-staging
AWS_S3_REGION_NAME: us-east-1
AWS_S3_ENDPOINT_URL: http://localstack:4566
# botocore >= 1.35 routes S3 through account-ID-specific endpoints, which
Expand Down
2 changes: 1 addition & 1 deletion efile_app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EFSP_TEST_DOCUMENT_URL = "https://raw.githubusercontent.com/SuffolkLITLab/LITEFi
AWS_S3_ENDPOINT_URL = "http://localstack:4566" # if mocking S3 locally, see [testing README](../testing/README.md).
AWS_ACCESS_KEY_ID = "your-aws-access-key-id-here"
AWS_SECRET_ACCESS_KEY = r"your-aws-secret-access-key-here" # Raw string to handle special chars
AWS_S3_BUCKET_NAME = "forms-mvp-xf6361"
AWS_S3_BUCKET_NAME = "litefile-staging"
AWS_S3_REGION_NAME = "us-east-1"

# Tyler test-EFM login, shared by the Python suite (efile/tests/) and the
Expand Down
4 changes: 2 additions & 2 deletions efile_app/efile/api/s3_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def mock_s3_upload(request):
mock_upload_results.append(
{
"original_name": uploaded_file.name,
"url": f"https://forms-mvp-xf6361.s3.amazonaws.com/efile-documents/{file_type}/{file_id}.pdf",
"public_url": f"https://forms-mvp-xf6361.s3.amazonaws.com/efile-documents/{file_type}/{file_id}.pdf",
"url": f"https://litefile-staging.s3.amazonaws.com/efile-documents/{file_type}/{file_id}.pdf",
"public_url": f"https://litefile-staging.s3.amazonaws.com/efile-documents/{file_type}/{file_id}.pdf",
"key": f"efile-documents/{file_type}/{file_id}.pdf",
"size": uploaded_file.size,
"type": file_type,
Expand Down
5 changes: 3 additions & 2 deletions efile_app/efile/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ def authenticate(self, request, username=None, password=None, **kwargs):

try:
auth_data = auth_with_tyler_api(username, password, jurisdiction)
request.session["auth_tokens"] = auth_data["tokens"]
if not auth_data:
if not auth_data or "tokens" not in auth_data:
logger.info("Tyler auth failed for user %s", username)
return None

request.session["auth_tokens"] = auth_data["tokens"]

logger.info("Auth data: %s", auth_data)

user = self._get_or_create_user(username, auth_data, jurisdiction)
Expand Down
4 changes: 2 additions & 2 deletions efile_app/efile/settings_prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
DATABASES = BASE_DATABASES

DEBUG = False
ALLOWED_HOSTS = ["forms-mvp-prod.fly.dev"]
CSRF_TRUSTED_ORIGINS = ["https://forms-mvp-prod.fly.dev"]
ALLOWED_HOSTS = ["litefile-prod.fly.dev"]
CSRF_TRUSTED_ORIGINS = ["https://litefile-prod.fly.dev"]

# Static files (WhiteNoise), mirroring settings_staging.
#
Expand Down
4 changes: 2 additions & 2 deletions efile_app/efile/settings_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
DATABASES = BASE_DATABASES

DEBUG = False
ALLOWED_HOSTS = ["forms-mvp-staging.fly.dev"]
CSRF_TRUSTED_ORIGINS = ["https://forms-mvp-staging.fly.dev"]
ALLOWED_HOSTS = ["litefile-staging.fly.dev"]
CSRF_TRUSTED_ORIGINS = ["https://litefile-staging.fly.dev"]

# Security hardening suitable for staging
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY")
Expand Down
4 changes: 2 additions & 2 deletions efile_app/efile/tests/test_efsp_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
validate_required_party_types,
)

REAL_S3_URL = "https://forms-mvp-xf6361.s3.us-east-1.amazonaws.com/efile-documents/lead/abc.pdf?X-Amz-Signature=x"
REAL_S3_URL = "https://litefile-staging.s3.us-east-1.amazonaws.com/efile-documents/lead/abc.pdf?X-Amz-Signature=x"
STAND_IN_URL = "https://example.org/fixtures/blank.pdf"


Expand Down Expand Up @@ -117,7 +117,7 @@ def test_stand_in_url_replaces_every_document_url():
efile_data = {
"al_court_bundle": [
{"data_url": REAL_S3_URL},
{"data_url": "https://forms-mvp-xf6361.s3.us-east-1.amazonaws.com/efile-documents/supporting/d.pdf"},
{"data_url": "https://litefile-staging.s3.us-east-1.amazonaws.com/efile-documents/supporting/d.pdf"},
]
}

Expand Down
2 changes: 1 addition & 1 deletion efile_app/efile/tests/test_stand_in_document_guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_dev_settings_refuse_to_load_on_a_deployed_host(monkeypatch):
A deploy that loses DJANGO_SETTINGS_MODULE would otherwise come up with
DEBUG=True, where every DEBUG-keyed guard below is inert.
"""
monkeypatch.setenv("FLY_APP_NAME", "forms-mvp-staging")
monkeypatch.setenv("FLY_APP_NAME", "litefile-staging")

import efile.settings_dev

Expand Down
9 changes: 6 additions & 3 deletions efile_app/efile/utils/proxy_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ def auth_with_tyler_api(username, password, jurisdiction):
try:
api_key = getattr(settings, "SUFFOLK_EFILE_API_KEY", None)
payload = {"api_key": api_key, f"tyler-{jurisdiction}": {"username": username, "password": password}}
headers = {"Content-Type": "application/json", "User-Agent": f"{jurisdiction.title()}-eFile-Client/1.0"}
headers = get_headers()
headers["User-Agent"] = f"{jurisdiction.title()}-eFile-Client/1.0"
response = requests.post(url, json=payload, headers=headers, timeout=10)
logger.debug("Auth API response: status=%s url=%s", response.status_code, url)
logger.info("Auth API response: status=%s url=%s", response.status_code, url)

if response.status_code == 200:
return response.json()
else:
logger.warning("Auth endpoint returned status %s for user %s", response.status_code, username)
except Exception as e:
logger.debug("Auth endpoint failed: %s - %s", url, str(e))
logger.error("Auth endpoint failed: %s - %s", url, str(e))

return None

Expand Down
2 changes: 1 addition & 1 deletion efile_app/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "form-submission-mvp"
name = "litefile"
version = "0.1.0"
description = "Minimal Django app for form submission and review"
requires-python = ">=3.12"
Expand Down
138 changes: 69 additions & 69 deletions efile_app/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# fly.toml app configuration file generated for forms-mvp-staging on 2025-08-20T14:42:16-07:00
# fly.toml app configuration file generated for litefile-staging on 2025-08-20T14:42:16-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'forms-mvp-staging'
app = 'litefile-staging'
primary_region = 'lax'

[build]
Expand Down
2 changes: 1 addition & 1 deletion testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To poke at the bucket by hand, install

```bash
pip install 'awscli-local[ver1]'
awslocal s3 ls s3://forms-mvp-xf6361/efile-documents/ --recursive
awslocal s3 ls s3://litefile-staging/efile-documents/ --recursive
```

Also make sure that `AWS_S3_ENDPOINT_URL = "http://host.docker.internal:4566"` and `AWS_ACCOUNT_ID_ENDPOINT_MODE = "disabled"` in your env.
Expand Down
2 changes: 1 addition & 1 deletion testing/localstack-init/ready.d/01-create-s3-bucket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
set -e

awslocal s3api create-bucket \
--bucket "${AWS_S3_BUCKET_NAME:-forms-mvp-xf6361}" \
--bucket "${AWS_S3_BUCKET_NAME:-litefile-staging}" \
--region "${AWS_DEFAULT_REGION:-us-east-1}" \
2>/dev/null || true