Compare commits
1 Commits
405714a6ae
...
https
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb1f47fec1 |
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user