2023-08-26 18:30:49 +02:00
|
|
|
package stirling.software.SPDF.model;
|
|
|
|
|
2023-08-27 01:39:22 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.PropertySource;
|
|
|
|
|
|
|
|
import stirling.software.SPDF.config.YamlPropertySourceFactory;
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@ConfigurationProperties(prefix = "")
|
2023-08-26 23:33:23 +02:00
|
|
|
@PropertySource(value = "file:./configs/settings.yml", factory = YamlPropertySourceFactory.class)
|
2023-08-26 18:30:49 +02:00
|
|
|
public class ApplicationProperties {
|
|
|
|
private Security security;
|
|
|
|
private System system;
|
|
|
|
private Ui ui;
|
|
|
|
private Endpoints endpoints;
|
|
|
|
private Metrics metrics;
|
|
|
|
private AutomaticallyGenerated automaticallyGenerated;
|
2023-08-26 23:33:23 +02:00
|
|
|
private AutoPipeline autoPipeline;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 23:33:23 +02:00
|
|
|
public AutoPipeline getAutoPipeline() {
|
|
|
|
return autoPipeline != null ? autoPipeline : new AutoPipeline();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 23:33:23 +02:00
|
|
|
public void setAutoPipeline(AutoPipeline autoPipeline) {
|
|
|
|
this.autoPipeline = autoPipeline;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Security getSecurity() {
|
|
|
|
return security != null ? security : new Security();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setSecurity(Security security) {
|
|
|
|
this.security = security;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public System getSystem() {
|
|
|
|
return system != null ? system : new System();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setSystem(System system) {
|
|
|
|
this.system = system;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Ui getUi() {
|
|
|
|
return ui != null ? ui : new Ui();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setUi(Ui ui) {
|
|
|
|
this.ui = ui;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Endpoints getEndpoints() {
|
|
|
|
return endpoints != null ? endpoints : new Endpoints();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setEndpoints(Endpoints endpoints) {
|
|
|
|
this.endpoints = endpoints;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Metrics getMetrics() {
|
|
|
|
return metrics != null ? metrics : new Metrics();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setMetrics(Metrics metrics) {
|
|
|
|
this.metrics = metrics;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public AutomaticallyGenerated getAutomaticallyGenerated() {
|
|
|
|
return automaticallyGenerated != null
|
|
|
|
? automaticallyGenerated
|
|
|
|
: new AutomaticallyGenerated();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setAutomaticallyGenerated(AutomaticallyGenerated automaticallyGenerated) {
|
|
|
|
this.automaticallyGenerated = automaticallyGenerated;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "ApplicationProperties [security="
|
|
|
|
+ security
|
|
|
|
+ ", system="
|
|
|
|
+ system
|
|
|
|
+ ", ui="
|
|
|
|
+ ui
|
|
|
|
+ ", endpoints="
|
2023-08-26 23:33:23 +02:00
|
|
|
+ endpoints
|
|
|
|
+ ", metrics="
|
|
|
|
+ metrics
|
|
|
|
+ ", automaticallyGenerated="
|
|
|
|
+ automaticallyGenerated
|
|
|
|
+ ", autoPipeline="
|
|
|
|
+ autoPipeline
|
|
|
|
+ "]";
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 23:33:23 +02:00
|
|
|
public static class AutoPipeline {
|
|
|
|
private String outputFolder;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 23:33:23 +02:00
|
|
|
public String getOutputFolder() {
|
|
|
|
return outputFolder;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 23:33:23 +02:00
|
|
|
public void setOutputFolder(String outputFolder) {
|
|
|
|
this.outputFolder = outputFolder;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 23:33:23 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "AutoPipeline [outputFolder=" + outputFolder + "]";
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
}
|
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public static class Security {
|
|
|
|
private Boolean enableLogin;
|
|
|
|
private Boolean csrfDisabled;
|
2023-09-30 00:58:37 +02:00
|
|
|
private InitialLogin initialLogin;
|
2023-12-29 21:48:21 +01:00
|
|
|
private int loginAttemptCount;
|
|
|
|
private long loginResetTimeMinutes;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-12-29 21:48:21 +01:00
|
|
|
public int getLoginAttemptCount() {
|
|
|
|
return loginAttemptCount;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-12-29 21:48:21 +01:00
|
|
|
public void setLoginAttemptCount(int loginAttemptCount) {
|
|
|
|
this.loginAttemptCount = loginAttemptCount;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-12-29 21:48:21 +01:00
|
|
|
public long getLoginResetTimeMinutes() {
|
|
|
|
return loginResetTimeMinutes;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-12-29 21:48:21 +01:00
|
|
|
public void setLoginResetTimeMinutes(long loginResetTimeMinutes) {
|
|
|
|
this.loginResetTimeMinutes = loginResetTimeMinutes;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
public InitialLogin getInitialLogin() {
|
|
|
|
return initialLogin != null ? initialLogin : new InitialLogin();
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
public void setInitialLogin(InitialLogin initialLogin) {
|
|
|
|
this.initialLogin = initialLogin;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Boolean getEnableLogin() {
|
|
|
|
return enableLogin;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setEnableLogin(Boolean enableLogin) {
|
|
|
|
this.enableLogin = enableLogin;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Boolean getCsrfDisabled() {
|
|
|
|
return csrfDisabled;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setCsrfDisabled(Boolean csrfDisabled) {
|
|
|
|
this.csrfDisabled = csrfDisabled;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
2023-09-30 00:58:37 +02:00
|
|
|
return "Security [enableLogin="
|
|
|
|
+ enableLogin
|
|
|
|
+ ", initialLogin="
|
|
|
|
+ initialLogin
|
|
|
|
+ ", csrfDisabled="
|
2023-08-26 18:30:49 +02:00
|
|
|
+ csrfDisabled
|
|
|
|
+ "]";
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
public static class InitialLogin {
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
private String username;
|
|
|
|
private String password;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
public String getUsername() {
|
|
|
|
return username;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
public void setUsername(String username) {
|
|
|
|
this.username = username;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
public String getPassword() {
|
|
|
|
return password;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
public void setPassword(String password) {
|
|
|
|
this.password = password;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-09-30 00:58:37 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "InitialLogin [username="
|
|
|
|
+ username
|
|
|
|
+ ", password="
|
|
|
|
+ (password != null && !password.isEmpty() ? "MASKED" : "NULL")
|
|
|
|
+ "]";
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public static class System {
|
|
|
|
private String defaultLocale;
|
|
|
|
private Boolean googlevisibility;
|
2023-08-27 01:38:17 +02:00
|
|
|
private String rootURIPath;
|
|
|
|
private String customStaticFilePath;
|
2023-08-26 18:30:49 +02:00
|
|
|
private Integer maxFileSize;
|
2024-04-21 13:15:18 +02:00
|
|
|
private boolean showUpdate;
|
|
|
|
private Boolean showUpdateOnlyAdmin;
|
|
|
|
|
|
|
|
public boolean getShowUpdateOnlyAdmin() {
|
|
|
|
return showUpdateOnlyAdmin;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setShowUpdateOnlyAdmin(boolean showUpdateOnlyAdmin) {
|
|
|
|
this.showUpdateOnlyAdmin = showUpdateOnlyAdmin;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean getShowUpdate() {
|
|
|
|
return showUpdate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setShowUpdate(boolean showUpdate) {
|
|
|
|
this.showUpdate = showUpdate;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-12-26 21:10:37 +01:00
|
|
|
private Boolean enableAlphaFunctionality;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-12-26 21:10:37 +01:00
|
|
|
public Boolean getEnableAlphaFunctionality() {
|
|
|
|
return enableAlphaFunctionality;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-12-26 21:10:37 +01:00
|
|
|
public void setEnableAlphaFunctionality(Boolean enableAlphaFunctionality) {
|
|
|
|
this.enableAlphaFunctionality = enableAlphaFunctionality;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public String getDefaultLocale() {
|
|
|
|
return defaultLocale;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setDefaultLocale(String defaultLocale) {
|
|
|
|
this.defaultLocale = defaultLocale;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Boolean getGooglevisibility() {
|
|
|
|
return googlevisibility;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setGooglevisibility(Boolean googlevisibility) {
|
|
|
|
this.googlevisibility = googlevisibility;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public String getRootURIPath() {
|
|
|
|
return rootURIPath;
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public void setRootURIPath(String rootURIPath) {
|
|
|
|
this.rootURIPath = rootURIPath;
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public String getCustomStaticFilePath() {
|
|
|
|
return customStaticFilePath;
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public void setCustomStaticFilePath(String customStaticFilePath) {
|
|
|
|
this.customStaticFilePath = customStaticFilePath;
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Integer getMaxFileSize() {
|
|
|
|
return maxFileSize;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setMaxFileSize(Integer maxFileSize) {
|
|
|
|
this.maxFileSize = maxFileSize;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
2023-12-26 21:10:37 +01:00
|
|
|
return "System [defaultLocale="
|
|
|
|
+ defaultLocale
|
|
|
|
+ ", googlevisibility="
|
|
|
|
+ googlevisibility
|
|
|
|
+ ", rootURIPath="
|
|
|
|
+ rootURIPath
|
|
|
|
+ ", customStaticFilePath="
|
|
|
|
+ customStaticFilePath
|
|
|
|
+ ", maxFileSize="
|
|
|
|
+ maxFileSize
|
|
|
|
+ ", enableAlphaFunctionality="
|
|
|
|
+ enableAlphaFunctionality
|
2024-04-21 13:15:18 +02:00
|
|
|
+ ", showUpdate="
|
|
|
|
+ showUpdate
|
|
|
|
+ ", showUpdateOnlyAdmin="
|
|
|
|
+ showUpdateOnlyAdmin
|
2023-12-26 21:10:37 +01:00
|
|
|
+ "]";
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
}
|
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public static class Ui {
|
2023-08-27 01:38:17 +02:00
|
|
|
private String appName;
|
|
|
|
private String homeDescription;
|
|
|
|
private String appNameNavbar;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public String getAppName() {
|
2023-10-08 00:35:28 +02:00
|
|
|
if (appName != null && appName.trim().length() == 0) return null;
|
2023-08-27 01:38:17 +02:00
|
|
|
return appName;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public void setAppName(String appName) {
|
|
|
|
this.appName = appName;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public String getHomeDescription() {
|
2023-10-08 00:35:28 +02:00
|
|
|
if (homeDescription != null && homeDescription.trim().length() == 0) return null;
|
2023-08-27 01:38:17 +02:00
|
|
|
return homeDescription;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public void setHomeDescription(String homeDescription) {
|
|
|
|
this.homeDescription = homeDescription;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public String getAppNameNavbar() {
|
2023-10-08 00:35:28 +02:00
|
|
|
if (appNameNavbar != null && appNameNavbar.trim().length() == 0) return null;
|
2023-08-27 01:38:17 +02:00
|
|
|
return appNameNavbar;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
public void setAppNameNavbar(String appNameNavbar) {
|
|
|
|
this.appNameNavbar = appNameNavbar;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-27 01:38:17 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "UserInterface [appName="
|
|
|
|
+ appName
|
|
|
|
+ ", homeDescription="
|
|
|
|
+ homeDescription
|
|
|
|
+ ", appNameNavbar="
|
|
|
|
+ appNameNavbar
|
|
|
|
+ "]";
|
2023-08-26 18:30:49 +02:00
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
}
|
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public static class Endpoints {
|
|
|
|
private List<String> toRemove;
|
|
|
|
private List<String> groupsToRemove;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public List<String> getToRemove() {
|
|
|
|
return toRemove;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setToRemove(List<String> toRemove) {
|
|
|
|
this.toRemove = toRemove;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public List<String> getGroupsToRemove() {
|
|
|
|
return groupsToRemove;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setGroupsToRemove(List<String> groupsToRemove) {
|
|
|
|
this.groupsToRemove = groupsToRemove;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Endpoints [toRemove=" + toRemove + ", groupsToRemove=" + groupsToRemove + "]";
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
}
|
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public static class Metrics {
|
|
|
|
private Boolean enabled;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public Boolean getEnabled() {
|
|
|
|
return enabled;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setEnabled(Boolean enabled) {
|
|
|
|
this.enabled = enabled;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Metrics [enabled=" + enabled + "]";
|
|
|
|
}
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public static class AutomaticallyGenerated {
|
|
|
|
private String key;
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public String getKey() {
|
|
|
|
return key;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
public void setKey(String key) {
|
|
|
|
this.key = key;
|
|
|
|
}
|
2023-12-30 20:11:27 +01:00
|
|
|
|
2023-08-26 18:30:49 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "AutomaticallyGenerated [key="
|
|
|
|
+ (key != null && !key.isEmpty() ? "MASKED" : "NULL")
|
|
|
|
+ "]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|