Skip to content

Commit 9bbccbe

Browse files
authored
fix/KD-63 개발 서버 도커 볼륨 설정/ file 저장시 uuid추가 (#317)
1 parent bcc6f79 commit 9bbccbe

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

aics-admin/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spring:
3535

3636
file:
3737
url: /cloud
38-
upload-path: ${user.dir}/cloud
38+
upload-path: /app/cloud
3939
secret-key: ${FILE_SECRET_KEY}
4040
disallowed-extensions: exe, bat, sh, cmd, js, html, jsp, php, asp, aspx, dll, so, ps1, vbs, msi, htaccess, phtml, jar, war
4141

aics-api/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spring:
3232

3333
file:
3434
url: /cloud
35-
upload-path: ${user.dir}/cloud
35+
upload-path: /app/cloud
3636
secret-key: ${FILE_SECRET_KEY}
3737
disallowed-extensions: exe, bat, sh, cmd, js, html, jsp, php, asp, aspx, dll, so, ps1, vbs, msi, htaccess, phtml, jar, war
3838

aics-auth/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spring:
3535

3636
file:
3737
url: /cloud
38-
upload-path: ${user.dir}/cloud
38+
upload-path: /app/cloud
3939
secret-key: ${FILE_SECRET_KEY}
4040
disallowed-extensions: exe, bat, sh, cmd, js, html, jsp, php, asp, aspx, dll, so, ps1, vbs, msi, htaccess, phtml, jar, war
4141

aics-domain/src/main/java/kgu/developers/domain/file/infrastructure/repository/FileStorageServiceImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.time.format.DateTimeFormatter;
1212
import java.util.Objects;
1313
import java.util.Set;
14+
import java.util.UUID;
1415

1516
import org.springframework.beans.factory.annotation.Autowired;
1617
import org.springframework.core.io.Resource;
@@ -55,7 +56,8 @@ public FileStorageServiceImpl(FilePathProperties filePathProperties,
5556
@Override
5657
public String store(MultipartFile file, FileDomain fileDomain) {
5758
String fileName = StringUtils.cleanPath(Objects.requireNonNull(file.getOriginalFilename()));
58-
String path = getFullPath(fileDomain, fileName);
59+
String fileNameWithUuid = UUID.randomUUID() + "_" + fileName;
60+
String path = getFullPath(fileDomain, fileNameWithUuid);
5961
validateAttributes(path, fileName);
6062
try {
6163
Path targetLocation = this.rootLocation.resolve(path);

docker/development/docker-compose.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ services:
1313
depends_on:
1414
- postgres
1515
- redis
16+
volumes:
17+
- upload-data:/app/cloud
1618
networks:
1719
- aics-network
1820

@@ -28,6 +30,8 @@ services:
2830
depends_on:
2931
- postgres
3032
- redis
33+
volumes:
34+
- upload-data:/app/cloud
3135
networks:
3236
- aics-network
3337

@@ -43,6 +47,8 @@ services:
4347
depends_on:
4448
- postgres
4549
- redis
50+
volumes:
51+
- upload-data:/app/cloud
4652
networks:
4753
- aics-network
4854

@@ -92,4 +98,5 @@ networks:
9298
volumes:
9399
postgres-data:
94100
caddy_data:
95-
caddy_config:
101+
caddy_config:
102+
upload-data:

0 commit comments

Comments
 (0)