mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-27 06:01:08 +08:00
properly persist upload dir
Signed-off-by: MiniDigger <admin@minidigger.me>
This commit is contained in:
parent
483c59ecdb
commit
b86ccf0edf
@ -21,6 +21,8 @@ services:
|
|||||||
- "traefik.http.routers.hangar.tls.certresolver=default"
|
- "traefik.http.routers.hangar.tls.certresolver=default"
|
||||||
- "traefik.http.routers.hangar.tls.domains[0].main=minidigger.me"
|
- "traefik.http.routers.hangar.tls.domains[0].main=minidigger.me"
|
||||||
- "traefik.http.routers.hangar.tls.domains[0].sans=*.minidigger.me"
|
- "traefik.http.routers.hangar.tls.domains[0].sans=*.minidigger.me"
|
||||||
|
volumes:
|
||||||
|
- hangar_data:/hangar/uploads
|
||||||
networks:
|
networks:
|
||||||
- web
|
- web
|
||||||
db:
|
db:
|
||||||
@ -98,4 +100,4 @@ networks:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db_data:
|
db_data:
|
||||||
uploads:
|
hangar_data:
|
||||||
|
@ -2,8 +2,10 @@ FROM openjdk:16-jdk-alpine
|
|||||||
|
|
||||||
LABEL maintainer="Yannick Lamprecht <yannicklamprecht@live.de>"
|
LABEL maintainer="Yannick Lamprecht <yannicklamprecht@live.de>"
|
||||||
|
|
||||||
ADD target/hangar-*.jar app.jar
|
WORKDIR hangar
|
||||||
ADD docker/deployment/hangar/application.yml application.yml
|
|
||||||
|
ADD target/hangar-*.jar /hangar/app.jar
|
||||||
|
ADD docker/deployment/hangar/application.yml /hangar/application.yml
|
||||||
|
|
||||||
ENV TERM xterm-256color
|
ENV TERM xterm-256color
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ hangar:
|
|||||||
use-webpack: false
|
use-webpack: false
|
||||||
auth-url: "https://hangar-auth.minidigger.me"
|
auth-url: "https://hangar-auth.minidigger.me"
|
||||||
base-url: "https://hangar.minidigger.me"
|
base-url: "https://hangar.minidigger.me"
|
||||||
|
plugin-upload-dir: "/hangar/uploads"
|
||||||
|
|
||||||
sso:
|
sso:
|
||||||
secret: "changeme"
|
secret: "changeme"
|
||||||
|
@ -2,6 +2,8 @@ package io.papermc.hangar.service.pluginupload;
|
|||||||
|
|
||||||
import io.papermc.hangar.config.hangar.HangarConfig;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@ -14,6 +16,8 @@ import java.util.stream.Stream;
|
|||||||
@Component
|
@Component
|
||||||
public class ProjectFiles {
|
public class ProjectFiles {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ProjectFiles.class);
|
||||||
|
|
||||||
private final Path pluginsDir;
|
private final Path pluginsDir;
|
||||||
private final Path tmpDir;
|
private final Path tmpDir;
|
||||||
|
|
||||||
@ -22,6 +26,7 @@ public class ProjectFiles {
|
|||||||
Path uploadsDir = Path.of(hangarConfig.getPluginUploadDir());
|
Path uploadsDir = Path.of(hangarConfig.getPluginUploadDir());
|
||||||
pluginsDir = uploadsDir.resolve("plugins");
|
pluginsDir = uploadsDir.resolve("plugins");
|
||||||
tmpDir = uploadsDir.resolve("tmp");
|
tmpDir = uploadsDir.resolve("tmp");
|
||||||
|
logger.info("Init work dir {} ", uploadsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Path getProjectDir(String owner, String name) {
|
public Path getProjectDir(String owner, String name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user