properly persist upload dir

Signed-off-by: MiniDigger <admin@minidigger.me>
This commit is contained in:
MiniDigger 2020-10-30 14:50:25 +01:00
parent 483c59ecdb
commit b86ccf0edf
4 changed files with 13 additions and 3 deletions

View File

@ -21,6 +21,8 @@ services:
- "traefik.http.routers.hangar.tls.certresolver=default"
- "traefik.http.routers.hangar.tls.domains[0].main=minidigger.me"
- "traefik.http.routers.hangar.tls.domains[0].sans=*.minidigger.me"
volumes:
- hangar_data:/hangar/uploads
networks:
- web
db:
@ -98,4 +100,4 @@ networks:
volumes:
db_data:
uploads:
hangar_data:

View File

@ -2,8 +2,10 @@ FROM openjdk:16-jdk-alpine
LABEL maintainer="Yannick Lamprecht <yannicklamprecht@live.de>"
ADD target/hangar-*.jar app.jar
ADD docker/deployment/hangar/application.yml application.yml
WORKDIR hangar
ADD target/hangar-*.jar /hangar/app.jar
ADD docker/deployment/hangar/application.yml /hangar/application.yml
ENV TERM xterm-256color

View File

@ -16,6 +16,7 @@ hangar:
use-webpack: false
auth-url: "https://hangar-auth.minidigger.me"
base-url: "https://hangar.minidigger.me"
plugin-upload-dir: "/hangar/uploads"
sso:
secret: "changeme"

View File

@ -2,6 +2,8 @@ package io.papermc.hangar.service.pluginupload;
import io.papermc.hangar.config.hangar.HangarConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -14,6 +16,8 @@ import java.util.stream.Stream;
@Component
public class ProjectFiles {
private static final Logger logger = LoggerFactory.getLogger(ProjectFiles.class);
private final Path pluginsDir;
private final Path tmpDir;
@ -22,6 +26,7 @@ public class ProjectFiles {
Path uploadsDir = Path.of(hangarConfig.getPluginUploadDir());
pluginsDir = uploadsDir.resolve("plugins");
tmpDir = uploadsDir.resolve("tmp");
logger.info("Init work dir {} ", uploadsDir);
}
public Path getProjectDir(String owner, String name) {