Merge branch 'https'

This commit is contained in:
Gregor Lohaus
2026-02-25 17:50:46 +01:00
5 changed files with 49 additions and 0 deletions

View File

@@ -55,6 +55,16 @@ public class ConfigRuntimeHints implements RuntimeHintsRegistrar {
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS,
MemberCategory.ACCESS_DECLARED_FIELDS,
MemberCategory.ACCESS_PUBLIC_FIELDS);
hints.reflection().registerType(ServerConfig.class,
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS,
MemberCategory.ACCESS_DECLARED_FIELDS,
MemberCategory.ACCESS_PUBLIC_FIELDS);
hints.reflection().registerType(SslConfig.class,
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS,
MemberCategory.ACCESS_DECLARED_FIELDS,
MemberCategory.ACCESS_PUBLIC_FIELDS);
hints.reflection().registerType(TypeAdapter.class,
MemberCategory.ACCESS_DECLARED_FIELDS,
MemberCategory.ACCESS_PUBLIC_FIELDS);

View File

@@ -6,8 +6,10 @@ import com.gregor_lohaus.gtransfer.config.types.Config;
import com.gregor_lohaus.gtransfer.config.types.DataSourceConfig;
import com.gregor_lohaus.gtransfer.config.types.JpaConfig;
import com.gregor_lohaus.gtransfer.config.types.MultipartConfig;
import com.gregor_lohaus.gtransfer.config.types.ServerConfig;
import com.gregor_lohaus.gtransfer.config.types.ServletConfig;
import com.gregor_lohaus.gtransfer.config.types.SpringConfig;
import com.gregor_lohaus.gtransfer.config.types.SslConfig;
import com.gregor_lohaus.gtransfer.config.types.StorageService;
import com.gregor_lohaus.gtransfer.config.types.StorageServiceType;
import com.gregor_lohaus.gtransfer.config.types.UploadConfig;
@@ -44,6 +46,13 @@ public class DefaultConfig {
c.springConfig = sc;
ServerConfig svc2 = new ServerConfig();
svc2.port = 8080;
SslConfig ssl = new SslConfig();
ssl.enabled = false;
svc2.sslConfig = ssl;
c.serverConfig = svc2;
UploadConfig uc = new UploadConfig();
uc.maxDownloadLimit = 100;
uc.maxExpiryDays = 30;

View File

@@ -9,6 +9,9 @@ public class Config implements TomlSerializable {
@Nested(name = "spring")
@NoPrefix
public SpringConfig springConfig;
@Nested(name = "server")
@NoPrefix
public ServerConfig serverConfig;
@Nested(name = "storageService")
public StorageService storageService;
@Nested(name = "upload")

View File

@@ -0,0 +1,13 @@
package com.gregor_lohaus.gtransfer.config.types;
import com.gregor_lohaus.gtransfer.config.annotations.Nested;
import com.gregor_lohaus.gtransfer.config.annotations.Property;
import io.github.wasabithumb.jtoml.serial.TomlSerializable;
public class ServerConfig implements TomlSerializable {
@Property(name = "port")
public Integer port;
@Nested(name = "ssl")
public SslConfig sslConfig;
}

View File

@@ -0,0 +1,14 @@
package com.gregor_lohaus.gtransfer.config.types;
import com.gregor_lohaus.gtransfer.config.annotations.Property;
import io.github.wasabithumb.jtoml.serial.TomlSerializable;
public class SslConfig implements TomlSerializable {
@Property(name = "enabled")
public Boolean enabled;
@Property(name = "certificate")
public String certificate;
@Property(name = "certificate-private-key")
public String certificatePrivateKey;
}