mirror of
https://github.com/velocitatem/cvfs.git
synced 2026-05-31 08:43:37 +00:00
Prepare repository for public deployment
- Replace ReportLab PDF export with LibreOffice headless for proper DOCX formatting preservation - Add libreoffice-writer + fonts-liberation to backend Dockerfile - Proxy public CV PDFs through frontend (/cv/[slug]) instead of redirecting to MinIO storage directly - Fix docker-compose: route backend/worker to internal MinIO URL (http://cvfs-minio:9000), remove MinIO from public network, parameterize all domain/env vars - Add storage cleanup (MinIO artifact deletion) when a document is deleted - Add docker-compose.standalone.yml for self-deployment without Traefik/dokploy - Update .env.example with comprehensive self-deployment documentation https://claude.ai/code/session_017HGM9VPptZG52asT5pbL6Y
This commit is contained in:
@@ -8,7 +8,7 @@ from sqlalchemy.orm import selectinload
|
||||
from dlib.cv import parse_docx_bytes
|
||||
|
||||
from app.models import CvDocument, CvVersion, PublicAsset
|
||||
from app.services.storage import persist_upload
|
||||
from app.services.storage import persist_upload, storage_client
|
||||
|
||||
|
||||
async def create_document(
|
||||
@@ -93,11 +93,14 @@ async def delete_document(
|
||||
doc = await get_document(session, owner_id, document_id)
|
||||
if not doc:
|
||||
return False
|
||||
version_ids = [version.id for version in doc.versions]
|
||||
artifact_keys = {v.artifact_docx_key for v in doc.versions if v.artifact_docx_key}
|
||||
version_ids = [v.id for v in doc.versions]
|
||||
if version_ids:
|
||||
await session.execute(
|
||||
delete(PublicAsset).where(PublicAsset.version_id.in_(version_ids))
|
||||
)
|
||||
await session.delete(doc)
|
||||
await session.commit()
|
||||
for key in artifact_keys:
|
||||
storage_client.delete_object(key=key)
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user