Compare commits
No commits in common. "25b5e0dd93b11b6c26aebc522d4cd662af161413" and "7381ce356dfea693820a05977863facf74e1f453" have entirely different histories.
25b5e0dd93
...
7381ce356d
@ -32,9 +32,8 @@ COPY --from=builder /app/dist ./dist
|
|||||||
RUN addgroup -g 1001 -S nodejs
|
RUN addgroup -g 1001 -S nodejs
|
||||||
RUN adduser -S nestjs -u 1001
|
RUN adduser -S nestjs -u 1001
|
||||||
|
|
||||||
# Dossiers écriture runtime (nestjs non-root) : photos + documents légaux (PDF)
|
# Créer le dossier uploads et donner les permissions
|
||||||
RUN mkdir -p /app/uploads/photos /app/documents/legaux && \
|
RUN mkdir -p /app/uploads/photos && chown -R nestjs:nodejs /app/uploads
|
||||||
chown -R nestjs:nodejs /app/uploads /app/documents
|
|
||||||
|
|
||||||
USER nestjs
|
USER nestjs
|
||||||
|
|
||||||
|
|||||||
@ -101,9 +101,8 @@ export class DocumentsLegauxController {
|
|||||||
throw new BadRequestException('Aucun fichier fourni');
|
throw new BadRequestException('Aucun fichier fourni');
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Récupérer l'ID utilisateur depuis le guard quand l'auth sera branchée.
|
// TODO: Récupérer l'ID utilisateur depuis le guard
|
||||||
// En attendant, on n'associe pas d'utilisateur plutôt que d'envoyer un UUID fictif invalide.
|
const userId = '00000000-0000-0000-0000-000000000000'; // Temporaire
|
||||||
const userId: string | null = null;
|
|
||||||
|
|
||||||
const document = await this.documentsService.uploadNouvelleVersion(
|
const document = await this.documentsService.uploadNouvelleVersion(
|
||||||
uploadDto.type,
|
uploadDto.type,
|
||||||
|
|||||||
@ -43,7 +43,7 @@ export class DocumentsLegauxService {
|
|||||||
async uploadNouvelleVersion(
|
async uploadNouvelleVersion(
|
||||||
type: 'cgu' | 'privacy',
|
type: 'cgu' | 'privacy',
|
||||||
file: Express.Multer.File,
|
file: Express.Multer.File,
|
||||||
userId?: string | null,
|
userId: string,
|
||||||
): Promise<DocumentLegal> {
|
): Promise<DocumentLegal> {
|
||||||
// Validation du type de fichier
|
// Validation du type de fichier
|
||||||
if (file.mimetype !== 'application/pdf') {
|
if (file.mimetype !== 'application/pdf') {
|
||||||
@ -84,7 +84,7 @@ export class DocumentsLegauxService {
|
|||||||
fichier_path: filePath,
|
fichier_path: filePath,
|
||||||
fichier_hash: hash,
|
fichier_hash: hash,
|
||||||
actif: false, // Pas actif par défaut
|
actif: false, // Pas actif par défaut
|
||||||
televersePar: userId ? ({ id: userId } as any) : null,
|
televersePar: { id: userId } as any,
|
||||||
televerseLe: new Date(),
|
televerseLe: new Date(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -61,8 +61,6 @@ services:
|
|||||||
UPLOAD_PHOTOS_DIR: ${UPLOAD_PHOTOS_DIR:-/app/uploads/photos}
|
UPLOAD_PHOTOS_DIR: ${UPLOAD_PHOTOS_DIR:-/app/uploads/photos}
|
||||||
volumes:
|
volumes:
|
||||||
- backend_uploads:/app/uploads/photos
|
- backend_uploads:/app/uploads/photos
|
||||||
# PDF CGU / privacy (upload admin) — persistance entre redémarrages
|
|
||||||
- backend_documents_legaux:/app/documents/legaux
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
labels:
|
labels:
|
||||||
@ -107,7 +105,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
backend_uploads:
|
backend_uploads:
|
||||||
backend_documents_legaux:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
ptitspas_network:
|
ptitspas_network:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user