mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-12 17:52:13 +02:00
Merge branch 'main' into session_2025_03_22
This commit is contained in:
commit
89fb771fd2
@ -153,6 +153,7 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//security updates
|
//security updates
|
||||||
implementation "org.springframework:spring-webmvc:6.2.5"
|
implementation "org.springframework:spring-webmvc:6.2.6"
|
||||||
|
|
||||||
implementation("io.github.pixee:java-security-toolkit:1.2.1")
|
implementation("io.github.pixee:java-security-toolkit:1.2.1")
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ dependencies {
|
|||||||
implementation "org.springframework.boot:spring-boot-starter-oauth2-client:$springBootVersion"
|
implementation "org.springframework.boot:spring-boot-starter-oauth2-client:$springBootVersion"
|
||||||
|
|
||||||
implementation "org.springframework.session:spring-session-core:3.4.2"
|
implementation "org.springframework.session:spring-session-core:3.4.2"
|
||||||
implementation "org.springframework:spring-jdbc:6.2.5"
|
implementation "org.springframework:spring-jdbc:6.2.6"
|
||||||
|
|
||||||
implementation 'com.unboundid.product.scim2:scim2-sdk-client:2.3.5'
|
implementation 'com.unboundid.product.scim2:scim2-sdk-client:2.3.5'
|
||||||
// Don't upgrade h2database
|
// Don't upgrade h2database
|
||||||
@ -525,7 +525,7 @@ dependencies {
|
|||||||
implementation "org.commonmark:commonmark-ext-gfm-tables:0.24.0"
|
implementation "org.commonmark:commonmark-ext-gfm-tables:0.24.0"
|
||||||
// https://mvnrepository.com/artifact/com.bucket4j/bucket4j_jdk17
|
// https://mvnrepository.com/artifact/com.bucket4j/bucket4j_jdk17
|
||||||
implementation "com.bucket4j:bucket4j_jdk17-core:8.14.0"
|
implementation "com.bucket4j:bucket4j_jdk17-core:8.14.0"
|
||||||
implementation "com.fathzer:javaluator:3.0.5"
|
implementation "com.fathzer:javaluator:3.0.6"
|
||||||
|
|
||||||
implementation 'com.vladsch.flexmark:flexmark-html2md-converter:0.64.8'
|
implementation 'com.vladsch.flexmark:flexmark-html2md-converter:0.64.8'
|
||||||
|
|
||||||
|
@ -32,4 +32,5 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
@ -36,6 +36,7 @@ services:
|
|||||||
SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf"
|
SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf"
|
||||||
SYSTEM_DATASOURCE_USERNAME: "admin"
|
SYSTEM_DATASOURCE_USERNAME: "admin"
|
||||||
SYSTEM_DATASOURCE_PASSWORD: "stirling"
|
SYSTEM_DATASOURCE_PASSWORD: "stirling"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
|
||||||
db:
|
db:
|
||||||
|
@ -30,4 +30,5 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
@ -38,4 +38,5 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
@ -30,4 +30,5 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
@ -27,4 +27,5 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
@ -26,4 +26,5 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
@ -28,4 +28,5 @@ services:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "true"
|
SYSTEM_GOOGLEVISIBILITY: "true"
|
||||||
|
SHOW_SURVEY: "true"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
|
@ -390,7 +390,7 @@ public class KeygenLicenseVerifier {
|
|||||||
// Extract max users and isEnterprise from policy or metadata
|
// Extract max users and isEnterprise from policy or metadata
|
||||||
int users = policyObj.optInt("users", 0);
|
int users = policyObj.optInt("users", 0);
|
||||||
isEnterpriseLicense = policyObj.optBoolean("isEnterprise", false);
|
isEnterpriseLicense = policyObj.optBoolean("isEnterprise", false);
|
||||||
|
|
||||||
if (users > 0) {
|
if (users > 0) {
|
||||||
applicationProperties.getPremium().setMaxUsers(users);
|
applicationProperties.getPremium().setMaxUsers(users);
|
||||||
log.info("License allows for {} users", users);
|
log.info("License allows for {} users", users);
|
||||||
@ -402,7 +402,7 @@ public class KeygenLicenseVerifier {
|
|||||||
users = metadata.optInt("users", 1);
|
users = metadata.optInt("users", 1);
|
||||||
applicationProperties.getPremium().setMaxUsers(users);
|
applicationProperties.getPremium().setMaxUsers(users);
|
||||||
log.info("License allows for {} users (from metadata)", users);
|
log.info("License allows for {} users (from metadata)", users);
|
||||||
|
|
||||||
// Check for isEnterprise flag in metadata
|
// Check for isEnterprise flag in metadata
|
||||||
isEnterpriseLicense = metadata.optBoolean("isEnterprise", false);
|
isEnterpriseLicense = metadata.optBoolean("isEnterprise", false);
|
||||||
} else {
|
} else {
|
||||||
@ -411,7 +411,7 @@ public class KeygenLicenseVerifier {
|
|||||||
log.info("Using default of 1 user for license");
|
log.info("Using default of 1 user for license");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -507,16 +507,16 @@ public class KeygenLicenseVerifier {
|
|||||||
.path("users")
|
.path("users")
|
||||||
.asInt(0);
|
.asInt(0);
|
||||||
applicationProperties.getPremium().setMaxUsers(users);
|
applicationProperties.getPremium().setMaxUsers(users);
|
||||||
|
|
||||||
// Extract isEnterprise flag
|
// Extract isEnterprise flag
|
||||||
isEnterpriseLicense =
|
isEnterpriseLicense =
|
||||||
jsonResponse
|
jsonResponse
|
||||||
.path("data")
|
.path("data")
|
||||||
.path("attributes")
|
.path("attributes")
|
||||||
.path("metadata")
|
.path("metadata")
|
||||||
.path("isEnterprise")
|
.path("isEnterprise")
|
||||||
.asBoolean(false);
|
.asBoolean(false);
|
||||||
|
|
||||||
log.info(applicationProperties.toString());
|
log.info(applicationProperties.toString());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -409,6 +409,8 @@ public class UserService implements UserServiceInterface {
|
|||||||
|
|
||||||
if (principal instanceof UserDetails detailsUser) {
|
if (principal instanceof UserDetails detailsUser) {
|
||||||
return detailsUser.getUsername();
|
return detailsUser.getUsername();
|
||||||
|
} else if (principal instanceof stirling.software.SPDF.model.User domainUser) {
|
||||||
|
return domainUser.getUsername();
|
||||||
} else if (principal instanceof OAuth2User oAuth2User) {
|
} else if (principal instanceof OAuth2User oAuth2User) {
|
||||||
return oAuth2User.getAttribute(
|
return oAuth2User.getAttribute(
|
||||||
applicationProperties.getSecurity().getOauth2().getUseAsUsername());
|
applicationProperties.getSecurity().getOauth2().getUseAsUsername());
|
||||||
|
@ -67,6 +67,9 @@ public class HomeWebController {
|
|||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
public String home(Model model) {
|
public String home(Model model) {
|
||||||
model.addAttribute("currentPage", "home");
|
model.addAttribute("currentPage", "home");
|
||||||
|
String showSurvey = System.getenv("SHOW_SURVEY");
|
||||||
|
boolean showSurveyValue = showSurvey == null || "true".equalsIgnoreCase(showSurvey);
|
||||||
|
model.addAttribute("showSurveyFromDocker", showSurveyValue);
|
||||||
return "home";
|
return "home";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public class UploadLimitService {
|
|||||||
private ApplicationProperties applicationProperties;
|
private ApplicationProperties applicationProperties;
|
||||||
|
|
||||||
public long getUploadLimit() {
|
public long getUploadLimit() {
|
||||||
String maxUploadSize =
|
String maxUploadSize =
|
||||||
applicationProperties.getSystem().getFileUploadLimit() != null
|
applicationProperties.getSystem().getFileUploadLimit() != null
|
||||||
? applicationProperties.getSystem().getFileUploadLimit()
|
? applicationProperties.getSystem().getFileUploadLimit()
|
||||||
: "";
|
: "";
|
||||||
@ -52,4 +52,4 @@ public class UploadLimitService {
|
|||||||
String pre = "KMGTPE".charAt(exp - 1) + "B";
|
String pre = "KMGTPE".charAt(exp - 1) + "B";
|
||||||
return String.format("%.1f %s", bytes / Math.pow(1024, exp), pre);
|
return String.format("%.1f %s", bytes / Math.pow(1024, exp), pre);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"moduleName": "com.fathzer:javaluator",
|
"moduleName": "com.fathzer:javaluator",
|
||||||
"moduleVersion": "3.0.5",
|
"moduleVersion": "3.0.6",
|
||||||
"moduleLicense": "Apache License, Version 2.0",
|
"moduleLicense": "Apache License, Version 2.0",
|
||||||
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||||
},
|
},
|
||||||
@ -1673,7 +1673,7 @@
|
|||||||
{
|
{
|
||||||
"moduleName": "org.springframework:spring-jdbc",
|
"moduleName": "org.springframework:spring-jdbc",
|
||||||
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
||||||
"moduleVersion": "6.2.5",
|
"moduleVersion": "6.2.6",
|
||||||
"moduleLicense": "Apache License, Version 2.0",
|
"moduleLicense": "Apache License, Version 2.0",
|
||||||
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
||||||
},
|
},
|
||||||
@ -1701,7 +1701,7 @@
|
|||||||
{
|
{
|
||||||
"moduleName": "org.springframework:spring-webmvc",
|
"moduleName": "org.springframework:spring-webmvc",
|
||||||
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
||||||
"moduleVersion": "6.2.5",
|
"moduleVersion": "6.2.6",
|
||||||
"moduleLicense": "Apache License, Version 2.0",
|
"moduleLicense": "Apache License, Version 2.0",
|
||||||
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
||||||
},
|
},
|
||||||
|
@ -61,6 +61,10 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
localStorage.setItem('pageViews', pageViews.toString());
|
localStorage.setItem('pageViews', pageViews.toString());
|
||||||
|
|
||||||
function shouldShowSurvey() {
|
function shouldShowSurvey() {
|
||||||
|
if(!window.showSurvey) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (localStorage.getItem('dontShowSurvey') === 'true' || localStorage.getItem('surveyTaken') === 'true') {
|
if (localStorage.getItem('dontShowSurvey') === 'true' || localStorage.getItem('surveyTaken') === 'true') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -112,7 +116,7 @@ function setAsDefault(value) {
|
|||||||
|
|
||||||
function adjustVisibleElements() {
|
function adjustVisibleElements() {
|
||||||
const container = document.querySelector('.recent-features');
|
const container = document.querySelector('.recent-features');
|
||||||
if(!container) return;
|
if(!container) return;
|
||||||
const subElements = Array.from(container.children);
|
const subElements = Array.from(container.children);
|
||||||
|
|
||||||
let totalWidth = 0;
|
let totalWidth = 0;
|
||||||
|
@ -218,6 +218,8 @@
|
|||||||
/*<![CDATA[*/
|
/*<![CDATA[*/
|
||||||
window.analyticsPromptBoolean = /*[[${@analyticsPrompt}]]*/ false;
|
window.analyticsPromptBoolean = /*[[${@analyticsPrompt}]]*/ false;
|
||||||
/*]]>*/
|
/*]]>*/
|
||||||
|
|
||||||
|
window.showSurvey = /*[[${showSurveyFromDocker}]]*/ true
|
||||||
</script>
|
</script>
|
||||||
<script th:src="@{'/js/pages/home.js'}" th:inline="javascript"></script>
|
<script th:src="@{'/js/pages/home.js'}" th:inline="javascript"></script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user