From df4539dc3542f397f7559d2e684777e261ac69c1 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Mon, 7 Jul 2025 17:45:48 +0100 Subject: [PATCH 1/7] Fix release generation issues (#3898) # Description of Changes --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --- .github/workflows/multiOSReleases.yml | 20 ++++++++++++-------- build.gradle | 15 +++++++++++---- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/multiOSReleases.yml b/.github/workflows/multiOSReleases.yml index 42570d4de..b1fd22466 100644 --- a/.github/workflows/multiOSReleases.yml +++ b/.github/workflows/multiOSReleases.yml @@ -27,21 +27,25 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - # Get version number + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + + # ✅ Get version from Gradle - name: Get version number id: versionNumber run: | - VERSION=$(grep "^version =" build.gradle | awk -F'"' '{print $2}') + VERSION=$(./gradlew printVersion --quiet | tail -1) echo "versionNumber=$VERSION" >> $GITHUB_OUTPUT + # ✅ Get Mac-specific version from Gradle - name: Get version number mac id: versionNumberMac run: | - VERSION=$(grep "^version =" build.gradle | awk -F'"' '{print $2}') - CURRENT_YEAR=$(date +'%Y') - IFS='.' read -r -a VERSION_PARTS <<< "$VERSION" - MAC_VERSION="$CURRENT_YEAR.${VERSION_PARTS[1]:-0}.${VERSION_PARTS[2]:-0}" - echo "versionNumberMac=$MAC_VERSION" >> $GITHUB_OUTPUT + VERSION_MAC=$(./gradlew printMacVersion --quiet | tail -1) + echo "versionNumberMac=$VERSION_MAC" >> $GITHUB_OUTPUT build-portable: needs: read_versions @@ -82,7 +86,7 @@ jobs: run: | mkdir ./binaries mv ./build/launch4j/Stirling-PDF.exe ./binaries/win-Stirling-PDF-portable-Server${{ matrix.file_suffix }}.exe - mv ./build/libs/Stirling-PDF-${{ needs.read_versions.outputs.version }}.jar ./binaries/Stirling-PDF${{ matrix.file_suffix }}.jar + mv ./stirling-pdf/build/libs/stirling-pdf-${{ needs.read_versions.outputs.version }}.jar ./binaries/Stirling-PDF${{ matrix.file_suffix }}.jar - name: Upload build artifacts uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/build.gradle b/build.gradle index 728da9231..05dfeec8c 100644 --- a/build.gradle +++ b/build.gradle @@ -78,6 +78,10 @@ tasks.register('writeVersion') { } } +tasks.named('createExe') { + dependsOn(":stirling-pdf:bootJar") +} + subprojects { apply plugin: 'java' apply plugin: 'java-library' @@ -90,9 +94,11 @@ subprojects { sourceCompatibility = JavaVersion.VERSION_17 } - bootJar { - enabled = false - } + if (project.name != "stirling-pdf") { + bootJar { + enabled = false + } + } repositories { mavenCentral() @@ -202,6 +208,7 @@ static def getMacVersion(String version) { } jpackage { + dependsOn(":stirling-pdf:bootJar") input = layout.projectDirectory.dir("stirling-pdf/build/libs") destination = layout.projectDirectory.dir("build/jpackage") mainJar = "Stirling-PDF-${project.version}.jar" @@ -445,7 +452,7 @@ launch4j { } else { headerType = "console" } - jarTask = tasks.bootJar + jarTask = project(":stirling-pdf").tasks.bootJar errTitle="Encountered error, do you have Java 21?" downloadUrl="https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe" From 6496015af79b7b7845ff147ecab281783bf9672c Mon Sep 17 00:00:00 2001 From: StepSecurity Bot Date: Mon, 7 Jul 2025 11:21:58 -1000 Subject: [PATCH 2/7] [StepSecurity] ci: Harden GitHub Actions (#3901) ## Summary This pull request is created by [StepSecurity](https://app.stepsecurity.io/securerepo) at the request of @Ludy87. Please merge the Pull Request to incorporate the requested changes. Please tag @Ludy87 on your message if you have any questions related to the PR. ## Security Fixes ### Pinned Dependencies GitHub Action tags and Docker tags are mutable. This poses a security risk. GitHub's Security Hardening guide recommends pinning actions to full length commit. - [GitHub Security Guide](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions) - [The Open Source Security Foundation (OpenSSF) Security Guide](https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies) ## Feedback For bug reports, feature requests, and general feedback; please email support@stepsecurity.io. To create such PRs, please visit https://app.stepsecurity.io/securerepo. Signed-off-by: StepSecurity Bot Signed-off-by: StepSecurity Bot --- .github/workflows/multiOSReleases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/multiOSReleases.yml b/.github/workflows/multiOSReleases.yml index b1fd22466..cdd8c6580 100644 --- a/.github/workflows/multiOSReleases.yml +++ b/.github/workflows/multiOSReleases.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK - uses: actions/setup-java@v4 + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: 'temurin' java-version: '21' From 721cb8e0a35853f9582212f8f5ffd231a0e90a69 Mon Sep 17 00:00:00 2001 From: "stirlingbot[bot]" <195170888+stirlingbot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 22:33:30 +0100 Subject: [PATCH 3/7] Update 3rd Party Licenses (#3893) Auto-generated by stirlingbot[bot] Signed-off-by: stirlingbot[bot] Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com> --- .../resources/static/3rdPartyLicenses.json | 58 +------------------ 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/stirling-pdf/src/main/resources/static/3rdPartyLicenses.json b/stirling-pdf/src/main/resources/static/3rdPartyLicenses.json index 46984ad23..a7d899263 100644 --- a/stirling-pdf/src/main/resources/static/3rdPartyLicenses.json +++ b/stirling-pdf/src/main/resources/static/3rdPartyLicenses.json @@ -283,7 +283,7 @@ { "moduleName": "com.opencsv:opencsv", "moduleUrl": "http://opencsv.sf.net", - "moduleVersion": "5.11.1", + "moduleVersion": "5.11.2", "moduleLicense": "Apache 2", "moduleLicenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt" }, @@ -800,13 +800,6 @@ "moduleLicense": "GPL2 w/ CPE", "moduleLicenseUrl": "https://oss.oracle.com/licenses/CDDL+GPL-1.1" }, - { - "moduleName": "junit:junit", - "moduleUrl": "http://junit.org", - "moduleVersion": "4.13.2", - "moduleLicense": "Eclipse Public License 1.0", - "moduleLicenseUrl": "http://www.eclipse.org/legal/epl-v10.html" - }, { "moduleName": "me.friwi:gluegen-rt", "moduleUrl": "http://jogamp.org/gluegen/www/", @@ -1310,20 +1303,6 @@ "moduleLicense": "GNU General Public License, version 2 with the GNU Classpath Exception", "moduleLicenseUrl": "https://www.gnu.org/software/classpath/license.html" }, - { - "moduleName": "org.hamcrest:hamcrest", - "moduleUrl": "http://hamcrest.org/JavaHamcrest/", - "moduleVersion": "3.0", - "moduleLicense": "BSD-3-Clause", - "moduleLicenseUrl": "https://raw.githubusercontent.com/hamcrest/JavaHamcrest/master/LICENSE" - }, - { - "moduleName": "org.hamcrest:hamcrest-core", - "moduleUrl": "http://hamcrest.org/JavaHamcrest/", - "moduleVersion": "3.0", - "moduleLicense": "BSD-3-Clause", - "moduleLicenseUrl": "https://raw.githubusercontent.com/hamcrest/JavaHamcrest/master/LICENSE" - }, { "moduleName": "org.hdrhistogram:HdrHistogram", "moduleUrl": "http://hdrhistogram.github.io/HdrHistogram/", @@ -1379,34 +1358,6 @@ "moduleLicense": "The Apache License, Version 2.0", "moduleLicenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt" }, - { - "moduleName": "org.junit.platform:junit-platform-commons", - "moduleUrl": "https://junit.org/junit5/", - "moduleVersion": "1.12.2", - "moduleLicense": "Eclipse Public License v2.0", - "moduleLicenseUrl": "https://www.eclipse.org/legal/epl-v20.html" - }, - { - "moduleName": "org.junit.platform:junit-platform-engine", - "moduleUrl": "https://junit.org/junit5/", - "moduleVersion": "1.12.2", - "moduleLicense": "Eclipse Public License v2.0", - "moduleLicenseUrl": "https://www.eclipse.org/legal/epl-v20.html" - }, - { - "moduleName": "org.junit.vintage:junit-vintage-engine", - "moduleUrl": "https://junit.org/junit5/", - "moduleVersion": "5.12.2", - "moduleLicense": "Eclipse Public License v2.0", - "moduleLicenseUrl": "https://www.eclipse.org/legal/epl-v20.html" - }, - { - "moduleName": "org.junit:junit-bom", - "moduleUrl": "https://junit.org/junit5/", - "moduleVersion": "5.12.2", - "moduleLicense": "Eclipse Public License v2.0", - "moduleLicenseUrl": "https://www.eclipse.org/legal/epl-v20.html" - }, { "moduleName": "org.latencyutils:LatencyUtils", "moduleUrl": "http://latencyutils.github.io/LatencyUtils/", @@ -1516,13 +1467,6 @@ "moduleLicense": "The Apache Software License, Version 2.0", "moduleLicenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt" }, - { - "moduleName": "org.opentest4j:opentest4j", - "moduleUrl": "https://github.com/ota4j-team/opentest4j", - "moduleVersion": "1.3.0", - "moduleLicense": "The Apache License, Version 2.0", - "moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0.txt" - }, { "moduleName": "org.ow2.asm:asm", "moduleUrl": "http://asm.ow2.org", From e0746b468ec71842d9a00df12f65ae927a7a696b Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Mon, 7 Jul 2025 23:54:58 +0100 Subject: [PATCH 4/7] Fix for security not downloading and running correctly in V1.0.0 (#3902) # Description of Changes --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --- build.gradle | 2 +- .../docker-compose-latest-ultra-lite.yml | 1 - exampleYmlFiles/docker-compose-latest.yml | 1 - scripts/download-security-jar.sh | 30 ++++++++++--------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 05dfeec8c..3dba68daa 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ bootJar { allprojects { group = 'stirling.software' - version = '1.0.0' + version = '1.0.1' configurations.configureEach { exclude group: 'commons-logging', module: 'commons-logging' diff --git a/exampleYmlFiles/docker-compose-latest-ultra-lite.yml b/exampleYmlFiles/docker-compose-latest-ultra-lite.yml index 14e78b2ff..a3710ad82 100644 --- a/exampleYmlFiles/docker-compose-latest-ultra-lite.yml +++ b/exampleYmlFiles/docker-compose-latest-ultra-lite.yml @@ -17,7 +17,6 @@ services: - ./stirling/latest/config:/configs:rw - ./stirling/latest/logs:/logs:rw environment: - DISABLE_ADDITIONAL_FEATURES: "true" SECURITY_ENABLELOGIN: "false" SYSTEM_DEFAULTLOCALE: en-US UI_APPNAME: Stirling-PDF-Ultra-lite diff --git a/exampleYmlFiles/docker-compose-latest.yml b/exampleYmlFiles/docker-compose-latest.yml index 2db962e32..a68da538a 100644 --- a/exampleYmlFiles/docker-compose-latest.yml +++ b/exampleYmlFiles/docker-compose-latest.yml @@ -18,7 +18,6 @@ services: - ./stirling/latest/config:/configs:rw - ./stirling/latest/logs:/logs:rw environment: - DISABLE_ADDITIONAL_FEATURES: "true" SECURITY_ENABLELOGIN: "false" LANGS: "en_GB,en_US,ar_AR,de_DE,fr_FR,es_ES,zh_CN,zh_TW,ca_CA,it_IT,sv_SE,pl_PL,ro_RO,ko_KR,pt_BR,ru_RU,el_GR,hi_IN,hu_HU,tr_TR,id_ID" SYSTEM_DEFAULTLOCALE: en-US diff --git a/scripts/download-security-jar.sh b/scripts/download-security-jar.sh index 5df242921..f016f5962 100644 --- a/scripts/download-security-jar.sh +++ b/scripts/download-security-jar.sh @@ -1,21 +1,23 @@ echo "Running Stirling PDF with DISABLE_ADDITIONAL_FEATURES=${DISABLE_ADDITIONAL_FEATURES} and VERSION_TAG=${VERSION_TAG}" # Check for DISABLE_ADDITIONAL_FEATURES and download the appropriate JAR if required -if [ "$DISABLE_ADDITIONAL_FEATURES" = "false" ] && [ "$VERSION_TAG" != "alpha" ]; then - if [ ! -f app-security.jar ]; then - echo "Trying to download from: https://files.stirlingpdf.com/v$VERSION_TAG/Stirling-PDF-with-login.jar" - curl -L -o app-security.jar https://files.stirlingpdf.com/v$VERSION_TAG/Stirling-PDF-with-login.jar +if [ "$VERSION_TAG" != "alpha" ] && [ "$VERSION_TAG" != "ALPHA" ]; then + if [ "$DISABLE_ADDITIONAL_FEATURES" = "false" ] || [ "$DISABLE_ADDITIONAL_FEATURES" = "FALSE" ] || [ "$DOCKER_ENABLE_SECURITY" = "true" ] || [ "$DOCKER_ENABLE_SECURITY" = "TRUE" ]; then + if [ ! -f app-security.jar ]; then + echo "Trying to download from: https://files.stirlingpdf.com/v$VERSION_TAG/Stirling-PDF-with-login.jar" + curl -L -o app-security.jar https://files.stirlingpdf.com/v$VERSION_TAG/Stirling-PDF-with-login.jar - # If the first download attempt failed, try without the 'v' prefix - if [ $? -ne 0 ]; then - echo "Trying to download from: https://files.stirlingpdf.com/$VERSION_TAG/Stirling-PDF-with-login.jar" - curl -L -o app-security.jar https://files.stirlingpdf.com/$VERSION_TAG/Stirling-PDF-with-login.jar - fi + # If the first download attempt failed, try without the 'v' prefix + if [ $? -ne 0 ]; then + echo "Trying to download from: https://files.stirlingpdf.com/$VERSION_TAG/Stirling-PDF-with-login.jar" + curl -L -o app-security.jar https://files.stirlingpdf.com/$VERSION_TAG/Stirling-PDF-with-login.jar + fi - if [ $? -eq 0 ]; then # checks if curl was successful - rm -f app.jar - ln -s app-security.jar app.jar - chown stirlingpdfuser:stirlingpdfgroup app.jar || true - chmod 755 app.jar || true + if [ $? -eq 0 ]; then # checks if curl was successful + rm -f app.jar + ln -s app-security.jar app.jar + chown stirlingpdfuser:stirlingpdfgroup app.jar || true + chmod 755 app.jar || true + fi fi fi fi From 05c10d3a9fc1078e4f3c5dfa0406e9ea0a759d9e Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:57:49 +0100 Subject: [PATCH 5/7] fix for #3907 resource override (#3910) # Description of Changes --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --- .../main/java/stirling/software/SPDF/config/WebMvcConfig.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/stirling-pdf/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java b/stirling-pdf/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java index 3e84f6465..c3e204b3c 100644 --- a/stirling-pdf/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java +++ b/stirling-pdf/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java @@ -26,8 +26,6 @@ public class WebMvcConfig implements WebMvcConfigurer { registry.addResourceHandler("/**") .addResourceLocations( "file:" + InstallationPathConfig.getStaticPath(), "classpath:/static/"); - registry.addResourceHandler("/js/**").addResourceLocations("classpath:/static/js/"); - registry.addResourceHandler("/css/**").addResourceLocations("classpath:/static/css/"); // .setCachePeriod(0); // Optional: disable caching } } From 2218f0bffa34aaf070811091f88ad04d55861340 Mon Sep 17 00:00:00 2001 From: Dario Ghunney Ware Date: Tue, 8 Jul 2025 18:04:25 +0100 Subject: [PATCH 6/7] Fix for `generateOpenApiDocs` Task (#3911) # Description of Changes Fix for `generateOpenApiDocs` task --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --------- Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> --- build.gradle | 37 ++++++++++++++++--- .../common/configuration/AppConfig.java | 21 +++-------- stirling-pdf/build.gradle | 5 +++ 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 3dba68daa..a0d198c3a 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,8 @@ plugins { import com.github.jk1.license.render.* import org.gradle.internal.os.OperatingSystem +import org.panteleyev.jpackage.ImageType + import java.nio.file.Files import java.time.Year @@ -43,9 +45,19 @@ bootJar { enabled = false } +// Configure main class for the root project +springBoot { + mainClass = 'stirling.software.SPDF.SPDFApplication' +} + +repositories { + mavenCentral() + maven { url = 'https://build.shibboleth.net/maven/releases' } +} + allprojects { group = 'stirling.software' - version = '1.0.1' + version = '1.0.2' configurations.configureEach { exclude group: 'commons-logging', module: 'commons-logging' @@ -53,7 +65,6 @@ allprojects { } } - tasks.register('writeVersion') { def propsFile = file("$projectDir/common/src/main/resources/version.properties") def propsDir = propsFile.parentFile @@ -200,6 +211,14 @@ openApi { waitTimeInSeconds = 60 // Increase the wait time to 60 seconds } +// Configure the forked spring boot run task to properly delegate to the stirling-pdf module +tasks.named('forkedSpringBootRun') { + dependsOn ':stirling-pdf:bootRun' + doFirst { + println "Delegating forkedSpringBootRun to :stirling-pdf:bootRun" + } +} + //0.11.5 to 2024.11.5 static def getMacVersion(String version) { def currentYear = Year.now().getValue() @@ -251,7 +270,7 @@ jpackage { winUpgradeUuid = "2a43ed0c-b8c2-40cf-89e1-751129b87641" // Unique identifier for updates winHelpUrl = "https://github.com/Stirling-Tools/Stirling-PDF" winUpdateUrl = "https://github.com/Stirling-Tools/Stirling-PDF/releases" - type = "exe" + type = ImageType.EXE installDir = "C:/Program Files/Stirling-PDF" } @@ -259,7 +278,7 @@ jpackage { mac { appVersion = getMacVersion(project.version.toString()) icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.icns") - type = "dmg" + type = ImageType.DMG macPackageIdentifier = "Stirling PDF" macPackageName = "Stirling PDF" macAppCategory = "public.app-category.productivity" @@ -281,7 +300,7 @@ jpackage { linux { appVersion = project.version icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.png") - type = "deb" // Can also use "rpm" for Red Hat-based systems + type = ImageType.DEB // Can also use "rpm" for Red Hat-based systems // Debian package configuration //linuxPackageName = "stirlingpdf" @@ -514,6 +533,14 @@ swaggerhubUpload { } dependencies { + implementation project(':stirling-pdf') + implementation project(':common') + if (System.getenv('DISABLE_ADDITIONAL_FEATURES') != 'true' + || (project.hasProperty('DISABLE_ADDITIONAL_FEATURES') + && System.getProperty('DISABLE_ADDITIONAL_FEATURES') != 'true')) { + implementation project(':proprietary') + } + testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2' } diff --git a/common/src/main/java/stirling/software/common/configuration/AppConfig.java b/common/src/main/java/stirling/software/common/configuration/AppConfig.java index 02614584b..b983769a8 100644 --- a/common/src/main/java/stirling/software/common/configuration/AppConfig.java +++ b/common/src/main/java/stirling/software/common/configuration/AppConfig.java @@ -21,6 +21,7 @@ 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.springframework.util.ClassUtils; import org.thymeleaf.spring6.SpringTemplateEngine; import lombok.Getter; @@ -148,23 +149,11 @@ public class AppConfig { } @Bean(name = "activeSecurity") - public boolean activeSecurity() { - String disableAdditionalFeatures = env.getProperty("DISABLE_ADDITIONAL_FEATURES"); - - if (disableAdditionalFeatures != null) { - // DISABLE_ADDITIONAL_FEATURES=true means security OFF, so return false - // DISABLE_ADDITIONAL_FEATURES=false means security ON, so return true - return !Boolean.parseBoolean(disableAdditionalFeatures); - } - - return env.getProperty("DOCKER_ENABLE_SECURITY", Boolean.class, true); - } - - @Bean(name = "missingActiveSecurity") - @ConditionalOnMissingClass( - "stirling.software.proprietary.security.configuration.SecurityConfiguration") public boolean missingActiveSecurity() { - return true; + return ClassUtils.isPresent( + "stirling.software.proprietary.security.configuration.SecurityConfiguration", + this.getClass().getClassLoader() + ); } @Bean(name = "directoryFilter") diff --git a/stirling-pdf/build.gradle b/stirling-pdf/build.gradle index 7014d25fe..0974a0577 100644 --- a/stirling-pdf/build.gradle +++ b/stirling-pdf/build.gradle @@ -146,5 +146,10 @@ bootJar { } } +// Configure main class for Spring Boot +springBoot { + mainClass = 'stirling.software.SPDF.SPDFApplication' +} + bootJar.dependsOn ':common:jar' bootJar.dependsOn ':proprietary:jar' From 69bbb12ecec5d494436eae593fd843c6335b2109 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Tue, 8 Jul 2025 19:25:42 +0100 Subject: [PATCH 7/7] Survey change to reduce prompts to users (#3913) # Description of Changes --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --------- Co-authored-by: Dario Ghunney Ware --- .../src/main/resources/static/js/downloader.js | 12 ++++++++++++ .../resources/static/js/multitool/PdfContainer.js | 5 +++++ .../src/main/resources/static/js/pages/home.js | 15 ++++++--------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/stirling-pdf/src/main/resources/static/js/downloader.js b/stirling-pdf/src/main/resources/static/js/downloader.js index 301b0411b..42ba0c357 100644 --- a/stirling-pdf/src/main/resources/static/js/downloader.js +++ b/stirling-pdf/src/main/resources/static/js/downloader.js @@ -2,6 +2,13 @@ if (window.isDownloadScriptInitialized) return; // Prevent re-execution window.isDownloadScriptInitialized = true; + // Global PDF processing count tracking for survey system + window.incrementPdfProcessingCount = function() { + let pdfProcessingCount = parseInt(localStorage.getItem('pdfProcessingCount') || '0'); + pdfProcessingCount++; + localStorage.setItem('pdfProcessingCount', pdfProcessingCount.toString()); + }; + const { pdfPasswordPrompt, multipleInputsForSingleRequest, @@ -312,6 +319,11 @@ pdf_pages: pageCount, }); } + + // Increment PDF processing count for survey tracking + if (success && typeof window.incrementPdfProcessingCount === 'function') { + window.incrementPdfProcessingCount(); + } } } diff --git a/stirling-pdf/src/main/resources/static/js/multitool/PdfContainer.js b/stirling-pdf/src/main/resources/static/js/multitool/PdfContainer.js index 90d130b2f..125801a0a 100644 --- a/stirling-pdf/src/main/resources/static/js/multitool/PdfContainer.js +++ b/stirling-pdf/src/main/resources/static/js/multitool/PdfContainer.js @@ -271,6 +271,11 @@ class PdfContainer { pdf_pages: pageCount, }); } + + // Increment PDF processing count for survey tracking + if (success && typeof window.incrementPdfProcessingCount === 'function') { + window.incrementPdfProcessingCount(); + } } catch { } } diff --git a/stirling-pdf/src/main/resources/static/js/pages/home.js b/stirling-pdf/src/main/resources/static/js/pages/home.js index bb1e1ad4a..a2673ef6c 100644 --- a/stirling-pdf/src/main/resources/static/js/pages/home.js +++ b/stirling-pdf/src/main/resources/static/js/pages/home.js @@ -66,19 +66,16 @@ document.addEventListener('DOMContentLoaded', function () { const dontShowAgain = document.getElementById('dontShowAgain'); const takeSurveyButton = document.getElementById('takeSurvey'); - const viewThresholds = [5, 10, 15, 22, 30, 50, 75, 100, 150, 200]; + const pdfProcessingThresholds = [8, 15, 22, 35, 50, 75, 100, 150]; - // Check if survey version changed and reset page views if it did + // Check if survey version changed and reset PDF processing count if it did const storedVersion = localStorage.getItem('surveyVersion'); if (storedVersion && storedVersion !== surveyVersion) { - localStorage.setItem('pageViews', '0'); + localStorage.setItem('pdfProcessingCount', '0'); localStorage.setItem('surveyVersion', surveyVersion); } - let pageViews = parseInt(localStorage.getItem('pageViews') || '0'); - - pageViews++; - localStorage.setItem('pageViews', pageViews.toString()); + let pdfProcessingCount = parseInt(localStorage.getItem('pdfProcessingCount') || '0'); function shouldShowSurvey() { if(!window.showSurvey) { @@ -90,11 +87,11 @@ document.addEventListener('DOMContentLoaded', function () { } // If survey version changed and we hit a threshold, show the survey - if (localStorage.getItem('surveyVersion') !== surveyVersion && viewThresholds.includes(pageViews)) { + if (localStorage.getItem('surveyVersion') !== surveyVersion && pdfProcessingThresholds.includes(pdfProcessingCount)) { return true; } - return viewThresholds.includes(pageViews); + return pdfProcessingThresholds.includes(pdfProcessingCount); } if (shouldShowSurvey()) {