-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: #493 Add Celery workers to the stack
- Loading branch information
Showing
116 changed files
with
3,870 additions
and
2,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ ENVIRONMENT_NAME=local | |
[email protected] | ||
ADMIN_DEFAULT_PASSWORD=password | ||
|
||
TASKS_LOCAL_URL=http://workers:3005 | ||
TASKS_BASE_HANDLER=common.tasks.TaskLocalInvoke | ||
LAMBDA_TASKS_LOCAL_URL=http://workers:3005 | ||
LAMBDA_TASKS_BASE_HANDLER=common.tasks.LambdaTaskLocalInvoke | ||
|
||
DB_CONNECTION={"dbname":"backend","username":"backend","password":"backend","host":"db","port":5432} | ||
REDIS_CONNECTION=redis://redis:6379 | ||
|
@@ -43,4 +43,13 @@ AWS_XRAY_SDK_ENABLED=False | |
|
||
OTP_AUTH_ISSUER_NAME=example.com | ||
|
||
OPENAI_API_KEY=<CHANGE_ME> | ||
OPENAI_API_KEY=<CHANGE_ME> | ||
|
||
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend | ||
EMAIL_HOST=mailcatcher | ||
EMAIL_PORT=1025 | ||
[email protected] | ||
[email protected] | ||
|
||
VITE_EMAIL_ASSETS_URL=http://localhost:3000/email-assets | ||
VITE_WEB_APP_URL=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,6 @@ docs/ | |
|
||
# Coverage | ||
.coverage | ||
coverage.xml | ||
coverage.xml | ||
|
||
scripts/runtime/email/renderer/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ REDIS_CONNECTION=redis://redis:6379 | |
|
||
WORKERS_EVENT_BUS_NAME=local-workers | ||
|
||
TASKS_BASE_HANDLER=common.tasks.Task | ||
LAMBDA_TASKS_BASE_HANDLER=common.tasks.LambdaTask | ||
|
||
AWS_DEFAULT_REGION=eu-west-1 | ||
PARENT_HOST=example.org | ||
|
@@ -26,9 +26,16 @@ STRIPE_LIVE_MODE=False | |
DJSTRIPE_WEBHOOK_SECRET=whsec_12345 | ||
|
||
AWS_STORAGE_BUCKET_NAME=test-bucket | ||
AWS_EXPORTS_STORAGE_BUCKET_NAME=exports-bucket | ||
AWS_S3_CUSTOM_DOMAIN=cdn.example.com | ||
AWS_ENDPOINT_URL= | ||
|
||
OTP_AUTH_ISSUER_NAME=example.com | ||
|
||
OPENAI_API_KEY=sk-example | ||
OPENAI_API_KEY=sk-example | ||
|
||
EMAIL_BACKEND=django.core.mail.backends.locmem.EmailBackend | ||
EMAIL_FROM_ADDRESS=[email protected] | ||
EMAIL_REPLY_ADDRESS=[email protected] | ||
VITE_EMAIL_ASSETS_URL=http://localhost:3000/email-assets | ||
VITE_WEB_APP_URL=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
packages/backend/apps/users/services/export/email_serializers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from rest_framework import serializers | ||
|
||
|
||
class UserDataExportEmailBaseSerializer(serializers.Serializer): | ||
email = serializers.CharField() | ||
export_url = serializers.CharField() | ||
|
||
|
||
class UserDataExportEmailSerializer(serializers.Serializer): | ||
data = UserDataExportEmailBaseSerializer() | ||
|
||
|
||
class AdminDataExportEmailSerializer(serializers.Serializer): | ||
data = UserDataExportEmailBaseSerializer(many=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from common import emails | ||
from . import email_serializers | ||
from . import constants | ||
|
||
|
||
class DataExportEmail(emails.Email): | ||
def __init__(self, to: str, data: dict): | ||
super().__init__(to=to, data=data) | ||
|
||
|
||
class UserDataExportEmail(DataExportEmail): | ||
name = constants.UserEmails.USER_EXPORT | ||
serializer_class = email_serializers.UserDataExportEmailSerializer | ||
|
||
|
||
class AdminDataExportEmail(DataExportEmail): | ||
name = constants.UserEmails.USER_EXPORT_ADMIN | ||
serializer_class = email_serializers.AdminDataExportEmailSerializer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from typing import Protocol, Type, Union | ||
from pydantic import BaseModel | ||
from ...models import User | ||
|
||
|
||
class UserDataExportable(Protocol): | ||
export_key: str | ||
schema_class: Type[BaseModel] | ||
|
||
@classmethod | ||
def export(cls, user: User) -> Union[str, list[str]]: | ||
... | ||
|
||
|
||
class UserFilesExportable(Protocol): | ||
@classmethod | ||
def export(cls, user: User) -> list[str]: | ||
... |
File renamed without changes.
Oops, something went wrong.