File tree Expand file tree Collapse file tree 4 files changed +20
-7
lines changed Expand file tree Collapse file tree 4 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ ENV ARCH="${ARCH}" \
4545 CONTAINER_GROUP="node" \
4646 CONTAINER_USER="node" \
4747 DOCKER_CONTAINER=true \
48+ DATA_DIR="/data" \
4849 HOME="/root" \
4950 NODE_ENV="production" \
5051 PS1="\[\e ]0;\u @\h : \w\a\]\[\0 33[01;32m\]\u @\h\[\0 33[00m\] :\[\0 33[01;34m\]\w\[\0 33[00m\]\$ " \
@@ -68,6 +69,8 @@ COPY root /
6869COPY --from=build-backend /root/backend/dist /root/backend/package.json /root/backend/package-lock.json /app/
6970RUN cd /app && \
7071 mkdir -p static && \
72+ mkdir -p /data && \
73+ chown -R ${CONTAINER_USER}:${CONTAINER_GROUP} /data && \
7174 npm install --only=prod
7275
7376# Frontend files
Original file line number Diff line number Diff line change 1- import { Injectable , OnModuleInit } from '@nestjs/common' ;
1+ import { Injectable , OnModuleInit , Logger } from '@nestjs/common' ;
22import { ConfigService } from '@nestjs/config' ;
33import { MulterOptionsFactory } from '@nestjs/platform-express' ;
44import { MulterOptions } from '@nestjs/platform-express/multer/interfaces/multer-options.interface' ;
@@ -7,15 +7,20 @@ import * as path from 'path';
77
88@Injectable ( )
99export class MulterConfigService implements MulterOptionsFactory , OnModuleInit {
10+ private readonly logger : Logger = new Logger ( MulterConfigService . name ) ;
1011
1112 constructor (
1213 private readonly configService : ConfigService ,
1314 ) { }
1415
1516 onModuleInit ( ) {
1617 const p = path . join ( this . configService . get < string > ( 'DATA_DIR' ) , 'tmpupload' ) ;
17- if ( ! fs . existsSync ( p ) )
18- fs . mkdirSync ( p ) ;
18+ try {
19+ if ( ! fs . existsSync ( p ) )
20+ fs . mkdirSync ( p ) ;
21+ } catch ( ex ) {
22+ this . logger . warn ( ex . message ) ;
23+ }
1924 }
2025
2126 createMulterOptions ( ) : MulterOptions | Promise < MulterOptions > {
Original file line number Diff line number Diff line change 1- import { Injectable } from '@nestjs/common' ;
1+ import { Injectable , Logger } from '@nestjs/common' ;
22import { ConfigService } from '@nestjs/config' ;
33
44import * as fs from 'fs' ;
@@ -8,6 +8,7 @@ import sanitize = require('sanitize-filename');
88
99@Injectable ( )
1010export class DocumentationService {
11+ private readonly logger : Logger = new Logger ( DocumentationService . name ) ;
1112
1213 private readonly rootDirectoryPath : string ;
1314
@@ -17,8 +18,12 @@ export class DocumentationService {
1718 this . rootDirectoryPath = path . join ( this . configService . get < string > ( 'DATA_DIR' ) , 'project' ) ;
1819
1920 // Create directory if not exits
20- if ( ! fs . existsSync ( this . rootDirectoryPath ) )
21- fs . mkdirSync ( this . rootDirectoryPath ) ;
21+ try {
22+ if ( ! fs . existsSync ( this . rootDirectoryPath ) )
23+ fs . mkdirSync ( this . rootDirectoryPath ) ;
24+ } catch ( ex ) {
25+ this . logger . warn ( ex . message ) ;
26+ }
2227 }
2328
2429 getProjectDirPath ( projectId : number ) : string {
Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ function SprintBacklog() {
281281
282282 const isTaskFinished = ( task : any ) => {
283283 // return task.dateEnded != null;
284- return task . category === 4 ;
284+ return task . category === 250 ;
285285 } ;
286286
287287 const renderStatus = ( task : any ) => {
You can’t perform that action at this time.
0 commit comments