Compare commits
No commits in common. "ae4e52dfdb11e03f6844c3d4f33a3fc5572a654a" and "4d43eb5691f46cb0352b9bf8f6494fcc5d786134" have entirely different histories.
ae4e52dfdb
...
4d43eb5691
9 changed files with 3 additions and 139 deletions
|
@ -212,7 +212,7 @@ CHANNEL_LAYERS = {
|
||||||
'default': {
|
'default': {
|
||||||
'BACKEND': 'channels_redis.core.RedisChannelLayer',
|
'BACKEND': 'channels_redis.core.RedisChannelLayer',
|
||||||
'CONFIG': {
|
'CONFIG': {
|
||||||
'hosts': [(os.getenv('REDIS_HOST', 'localhost'), 6379)],
|
'hosts': [('localhost', 6379)],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
# Generated by Django 4.2.7 on 2024-11-08 20:37
|
|
||||||
from django.core.files.base import ContentFile
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('mail', '0006_alter_eventaddress_address'),
|
|
||||||
]
|
|
||||||
|
|
||||||
def move_raw_mails_to_file(apps, schema_editor):
|
|
||||||
Email = apps.get_model('mail', 'Email')
|
|
||||||
for email in Email.objects.all():
|
|
||||||
raw_content = email.raw
|
|
||||||
email.raw_file = ContentFile(raw_content)
|
|
||||||
email.raw = None
|
|
||||||
email.save()
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='email',
|
|
||||||
name='raw_file',
|
|
||||||
field=models.FileField(null=True, upload_to='raw_mail/'),
|
|
||||||
),
|
|
||||||
migrations.RunPython(move_raw_mails_to_file),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='email',
|
|
||||||
name='raw',
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='email',
|
|
||||||
name='raw_file',
|
|
||||||
field=models.FileField(upload_to='raw_mail/'),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -19,7 +19,7 @@ class Email(SoftDeleteModel):
|
||||||
recipient = models.CharField(max_length=255)
|
recipient = models.CharField(max_length=255)
|
||||||
reference = models.CharField(max_length=255, null=True, unique=True)
|
reference = models.CharField(max_length=255, null=True, unique=True)
|
||||||
in_reply_to = models.CharField(max_length=255, null=True)
|
in_reply_to = models.CharField(max_length=255, null=True)
|
||||||
raw_file = models.FileField(upload_to='raw_mail/')
|
raw = models.TextField()
|
||||||
issue_thread = models.ForeignKey(IssueThread, models.SET_NULL, null=True, related_name='emails')
|
issue_thread = models.ForeignKey(IssueThread, models.SET_NULL, null=True, related_name='emails')
|
||||||
event = models.ForeignKey(Event, models.SET_NULL, null=True)
|
event = models.ForeignKey(Event, models.SET_NULL, null=True)
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ def receive_email(envelope, log=None):
|
||||||
|
|
||||||
email = Email.objects.create(
|
email = Email.objects.create(
|
||||||
sender=sender, recipient=recipient, body=body, subject=subject, reference=header_message_id,
|
sender=sender, recipient=recipient, body=body, subject=subject, reference=header_message_id,
|
||||||
in_reply_to=header_in_reply_to, raw_file=ContentFile(envelope.content), event=target_event,
|
in_reply_to=header_in_reply_to, raw=envelope.content, event=target_event,
|
||||||
issue_thread=active_issue_thread)
|
issue_thread=active_issue_thread)
|
||||||
for attachment in attachments:
|
for attachment in attachments:
|
||||||
email.attachments.add(attachment)
|
email.attachments.add(attachment)
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
REDIS_HOST=localhost
|
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_NAME=c3lf_sys3
|
DB_NAME=c3lf_sys3
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
FROM python:3.11-bookworm
|
|
||||||
LABEL authors="lagertonne"
|
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
|
||||||
RUN mkdir /code
|
|
||||||
WORKDIR /code
|
|
||||||
COPY requirements.prod.txt /code/
|
|
||||||
RUN apt update && apt install -y mariadb-client
|
|
||||||
RUN pip install -r requirements.prod.txt
|
|
||||||
RUN pip install mysqlclient
|
|
||||||
COPY .. /code/
|
|
|
@ -1,6 +0,0 @@
|
||||||
FROM docker.io/node:22
|
|
||||||
|
|
||||||
RUN mkdir /web
|
|
||||||
WORKDIR /web
|
|
||||||
COPY package.json /web/
|
|
||||||
RUN npm install
|
|
|
@ -1,55 +0,0 @@
|
||||||
services:
|
|
||||||
redis:
|
|
||||||
image: redis
|
|
||||||
ports:
|
|
||||||
- "6379:6379"
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: mariadb
|
|
||||||
environment:
|
|
||||||
MARIADB_RANDOM_ROOT_PASSWORD: true
|
|
||||||
MARIADB_DATABASE: system3
|
|
||||||
MARIADB_USER: system3
|
|
||||||
MARIADB_PASSWORD: system3
|
|
||||||
volumes:
|
|
||||||
- mariadb_data:/var/lib/mysql
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
|
|
||||||
core:
|
|
||||||
build:
|
|
||||||
context: ../../core
|
|
||||||
dockerfile: ../deploy/testing/Dockerfile.backend
|
|
||||||
command: bash -c 'python manage.py migrate && python /code/server.py'
|
|
||||||
environment:
|
|
||||||
- HTTP_HOST=core
|
|
||||||
- REDIS_HOST=redis
|
|
||||||
- DB_HOST=db
|
|
||||||
- DB_PORT=3306
|
|
||||||
- DB_NAME=system3
|
|
||||||
- DB_USER=system3
|
|
||||||
- DB_PASSWORD=system3
|
|
||||||
volumes:
|
|
||||||
- ../../core:/code
|
|
||||||
ports:
|
|
||||||
- "8000:8000"
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- redis
|
|
||||||
|
|
||||||
frontend:
|
|
||||||
build:
|
|
||||||
context: ../../web
|
|
||||||
dockerfile: ../deploy/testing/Dockerfile.frontend
|
|
||||||
command: npm run serve
|
|
||||||
volumes:
|
|
||||||
- ../../web:/web:ro
|
|
||||||
- /web/node_modules
|
|
||||||
- ./vue.config.js:/web/vue.config.js
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
depends_on:
|
|
||||||
- core
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mariadb_data:
|
|
|
@ -1,27 +0,0 @@
|
||||||
// vue.config.js
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
devServer: {
|
|
||||||
headers: {
|
|
||||||
"Access-Control-Allow-Origin": "*",
|
|
||||||
"Access-Control-Allow-Headers": "*",
|
|
||||||
"Access-Control-Allow-Methods": "*"
|
|
||||||
},
|
|
||||||
proxy: {
|
|
||||||
'^/media/2': {
|
|
||||||
target: 'http://core:8000/',
|
|
||||||
},
|
|
||||||
'^/api/2': {
|
|
||||||
target: 'http://core:8000/',
|
|
||||||
},
|
|
||||||
'^/api/1': {
|
|
||||||
target: 'http://core:8000/',
|
|
||||||
},
|
|
||||||
'^/ws/2': {
|
|
||||||
target: 'http://core:8000/',
|
|
||||||
ws: true,
|
|
||||||
logLevel: 'debug',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue