Compare commits

..

No commits in common. "a31ba405dc4a223c7a44214aca097f90a4174868" and "9634e932c503677df7fb3d0af76e76e3c21c8c47" have entirely different histories.

12 changed files with 32 additions and 169 deletions

View File

@ -515,7 +515,7 @@ tasks.named("test") {
}
tasks.register('writeVersion') {
def propsFile = file("$projectDir/common/src/main/resources/version.properties")
def propsFile = file("$projectDir/stirling-pdf/src/main/resources/version.properties")
def propsDir = propsFile.parentFile
doLast {
@ -539,7 +539,6 @@ tasks.register('writeVersion') {
}
processResources.dependsOn(writeVersion)
project(':stirling-pdf').tasks.bootJar.dependsOn(writeVersion)
tasks.register('printVersion') {
doLast {
@ -565,13 +564,3 @@ tasks.named('bootRun') {
println "Delegating to :stirling-pdf:bootRun"
}
}
tasks.named('build') {
group = 'build'
description = 'Delegates to :stirling-pdf:bootJar'
dependsOn ':stirling-pdf:bootJar'
doFirst {
println "Delegating to :stirling-pdf:bootJar"
}
}

View File

@ -1,8 +1,3 @@
// Configure bootRun to disable it or point to a main class
bootRun {
enabled = false
}
dependencies {
api 'org.springframework.boot:spring-boot-starter-web'
api 'org.springframework.boot:spring-boot-starter-thymeleaf'

View File

@ -13,22 +13,18 @@ import java.util.function.Predicate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.Scope;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.thymeleaf.spring6.SpringTemplateEngine;
import org.springframework.core.Ordered;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -257,32 +253,6 @@ public class AppConfig {
return applicationProperties.getSystem().getDatasource();
}
@Bean(name = "runningProOrHigher")
@Profile("default")
public boolean runningProOrHigher() {
return false;
}
@Bean(name = "runningEE")
@Profile("default")
public boolean runningEnterprise() {
return false;
}
@Bean(name = "GoogleDriveEnabled")
@Profile("default")
public boolean googleDriveEnabled() {
return false;
}
@Bean(name = "license")
@Profile("default")
public String licenseType() {
return "NORMAL";
}
@Bean(name = "disablePixel")
public boolean disablePixel() {
return Boolean.parseBoolean(env.getProperty("DISABLE_PIXEL", "false"));

View File

@ -1,9 +1,7 @@
repositories {
maven { url = "https://build.shibboleth.net/maven/releases" }
}
bootRun {
enabled = false
}
dependencies {
implementation project(':common')

View File

@ -9,7 +9,6 @@ import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.jdbc.DatabaseDriver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import lombok.Getter;
@ -60,7 +59,6 @@ public class DatabaseConfig {
*/
@Bean
@Qualifier("dataSource")
@Primary
public DataSource dataSource() throws UnsupportedProviderException {
DataSourceBuilder<?> dataSourceBuilder = DataSourceBuilder.create();

View File

@ -2,10 +2,9 @@ package stirling.software.proprietary.security.configuration.ee;
import static stirling.software.proprietary.security.configuration.ee.KeygenLicenseVerifier.License;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
@ -29,23 +28,18 @@ public class EEAppConfig {
migrateEnterpriseSettingsToPremium(this.applicationProperties);
}
@Profile("security")
@Bean(name = "runningProOrHigher")
@Primary
@Qualifier("runningProOrHigher")
public boolean runningProOrHigher() {
return licenseKeyChecker.getPremiumLicenseEnabledResult() != License.NORMAL;
}
@Profile("security")
@Bean(name = "license")
@Primary
public String licenseType() {
return licenseKeyChecker.getPremiumLicenseEnabledResult().name();
}
@Profile("security")
@Bean(name = "runningEE")
@Primary
public boolean runningEnterprise() {
return licenseKeyChecker.getPremiumLicenseEnabledResult() == License.ENTERPRISE;
}
@ -55,9 +49,7 @@ public class EEAppConfig {
return applicationProperties.getPremium().getProFeatures().isSsoAutoLogin();
}
@Profile("security")
@Bean(name = "GoogleDriveEnabled")
@Primary
public boolean googleDriveEnabled() {
return runningProOrHigher()
&& applicationProperties.getPremium().getProFeatures().getGoogleDrive().isEnabled();

View File

@ -103,21 +103,13 @@ sourceSets {
}
// Disable regular jar
jar {
enabled = false
}
// Configure and enable bootJar for this project
bootJar {
enabled = true
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
zip64 = true
// Don't include all dependencies directly like the old jar task did
// from {
// configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
// }
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
// Exclude signature files to prevent "Invalid signature file digest" errors
exclude 'META-INF/*.SF'
@ -127,11 +119,12 @@ bootJar {
manifest {
attributes(
'Main-Class': 'stirling.software.SPDF.SPDFApplication',
'Implementation-Title': 'Stirling-PDF',
'Implementation-Version': project.version
)
}
}
bootJar.dependsOn ':common:jar'
bootJar.dependsOn ':proprietary:jar'
jar.dependsOn ':common:jar'
jar.dependsOn ':proprietary:jar'

View File

@ -39,6 +39,10 @@ import stirling.software.common.util.UrlUtils;
"stirling.software.SPDF",
"stirling.software.common",
"stirling.software.proprietary"
},
exclude = {
DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class
})
public class SPDFApplication {
@ -204,35 +208,17 @@ public class SPDFApplication {
}
private static String[] getActiveProfile(String[] args) {
// 1. Check for explicitly passed profiles
if (args != null) {
if (args == null) {
return new String[] {"default"};
}
for (String arg : args) {
if (arg.startsWith("--spring.profiles.active=")) {
String[] provided = arg.substring(arg.indexOf('=') + 1).split(",");
if (provided.length > 0) {
log.info("#######0000000000000###############################");
return provided;
if (arg.contains("spring.profiles.active")) {
return arg.substring(args[0].indexOf('=') + 1).split(", ");
}
}
}
}
log.info("######################################");
// 2. Detect if SecurityConfiguration is present on classpath
if (isClassPresent("stirling.software.proprietary.security.configuration.SecurityConfiguration")) {
log.info("security");
return new String[] { "security" };
} else {
log.info("default");
return new String[] { "default" };
}
}
private static boolean isClassPresent(String className) {
try {
Class.forName(className, false, SPDFApplication.class.getClassLoader());
return true;
} catch (ClassNotFoundException e) {
return false;
}
return new String[] {"default"};
}
public static String getStaticBaseUrl() {

View File

@ -29,11 +29,14 @@ spring.thymeleaf.encoding=UTF-8
spring.web.resources.mime-mappings.webmanifest=application/manifest+json
spring.mvc.async.request-timeout=${SYSTEM_CONNECTIONTIMEOUTMILLISECONDS:1200000}
management.endpoints.web.exposure.include=beans
# Exclusions are now handled in @SpringBootApplication annotation
#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
spring.datasource.url=jdbc:h2:file:./configs/stirling-pdf-DB-2.3.232;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=PostgreSQL
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.h2.console.enabled=false
spring.h2.console.enabled=true
spring.jpa.hibernate.ddl-auto=update
server.servlet.session.timeout:30m
# Change the default URL path for OpenAPI JSON
@ -43,5 +46,3 @@ springdoc.swagger-ui.url=/v1/api-docs
springdoc.swagger-ui.path=/index.html
posthog.api.key=phc_fiR65u5j6qmXTYL56MNrLZSWqLaDW74OrZH0Insd2xq
posthog.host=https://eu.i.posthog.com
spring.main.allow-bean-definition-overriding=true

View File

@ -130,65 +130,6 @@ enterpriseEdition.ssoAdvert=Looking for more user management features? Check out
enterpriseEdition.proTeamFeatureDisabled=Team management features require a Pro licence or higher
#################
# Analytics #
#################
analytics.title=Do you want make Stirling PDF better?
analytics.paragraph1=Stirling PDF has opt in analytics to help us improve the product. We do not track any personal information or file contents.
analytics.paragraph2=Please consider enabling analytics to help Stirling-PDF grow and to allow us to understand our users better.
analytics.enable=Enable analytics
analytics.disable=Disable analytics
analytics.settings=You can change the settings for analytics in the config/settings.yml file
#############
# NAVBAR #
#############
navbar.favorite=Favorites
navbar.recent=New and recently updated
navbar.darkmode=Dark Mode
navbar.language=Languages
navbar.settings=Settings
navbar.allTools=Tools
navbar.multiTool=Multi Tool
navbar.search=Search
navbar.sections.organize=Organize
navbar.sections.convertTo=Convert to PDF
navbar.sections.convertFrom=Convert from PDF
navbar.sections.security=Sign & Security
navbar.sections.advance=Advanced
navbar.sections.edit=View & Edit
navbar.sections.popular=Popular
#############
# SETTINGS #
#############
settings.title=Settings
settings.update=Update available
settings.updateAvailable={0} is the current installed version. A new version ({1}) is available.
settings.appVersion=App Version:
settings.downloadOption.title=Choose download option (For single file non zip downloads):
settings.downloadOption.1=Open in same window
settings.downloadOption.2=Open in new window
settings.downloadOption.3=Download file
settings.zipThreshold=Zip files when the number of downloaded files exceeds
settings.signOut=Sign Out
settings.accountSettings=Account Settings
settings.bored.help=Enables easter egg game
settings.cacheInputs.name=Save form inputs
settings.cacheInputs.help=Enable to store previously used inputs for future runs
changeCreds.title=Change Credentials
changeCreds.header=Update Your Account Details
changeCreds.changePassword=You are using default login credentials. Please enter a new password
changeCreds.newUsername=New Username
changeCreds.oldPassword=Current Password
changeCreds.newPassword=New Password
changeCreds.confirmNewPassword=Confirm New Password
changeCreds.submit=Submit Changes
account.title=Account Settings
account.accountSettings=Account Settings
account.adminSettings=Admin Settings - View and Add Users

View File

@ -22,13 +22,13 @@
<div class="mb-3">
<label th:text="#{PDFToText.selectText.1}"></label>
<select class="form-control" name="outputFormat">
<option th:if="${@endpointConfiguration.isEndpointEnabled('pdf-to-rtf')}" value="rtf">RTF</option>
<option th:if="${@endpointConfigurationService.isEndpointEnabled('pdf-to-rtf')}" value="rtf">RTF</option>
<option value="txt">TXT</option>
</select>
</div>
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{PDFToText.submit}"></button>
</form>
<p th:if="${@endpointConfiguration.isEndpointEnabled('pdf-to-rtf')}" class="mt-3" th:text="#{PDFToText.credit}"></p>
<p th:if="${@endpointConfigurationService.isEndpointEnabled('pdf-to-rtf')}" class="mt-3" th:text="#{PDFToText.credit}"></p>
<option th:if="${@endpointConfiguration.isEndpointEnabled('pdf-to-rtf')}" value="rtf">RTF</option>
<option value="txt">TXT</option>
</select>

View File

@ -1,5 +1,5 @@
<th:block th:fragment="navbarEntry(endpoint, toolIcon, titleKey, descKey, tagKey, toolGroup)"
th:if="${@endpointConfiguration.isEndpointEnabled(endpoint)}">
th:if="${@endpointConfigurationService.isEndpointEnabled(endpoint)}">
<a th:id="@{${endpoint}}" class="dropdown-item" style="position:relative" th:href="@{${endpoint}}"
th:data-bs-link="@{${endpoint}}"
th:classappend="${endpoint.equals(currentPage)} ? ${toolGroup} + ' active' : '' + ${toolGroup}"