diff --git a/.github/workflows/PR-Demo-Comment-with-react.yml b/.github/workflows/PR-Demo-Comment-with-react.yml index a971eac2f..5953f6905 100644 --- a/.github/workflows/PR-Demo-Comment-with-react.yml +++ b/.github/workflows/PR-Demo-Comment-with-react.yml @@ -156,9 +156,9 @@ jobs: - name: Run Gradle Command run: | if [ "${{ needs.check-comment.outputs.enable_security }}" == "true" ]; then - export ADDITIONAL_FEATURES=true + export WITHOUT_ENHANCED_FEATURES=false else - export ADDITIONAL_FEATURES=false + export WITHOUT_ENHANCED_FEATURES=true fi ./gradlew clean build env: @@ -200,11 +200,11 @@ jobs: run: | # Set security settings based on flags if [ "${{ needs.check-comment.outputs.enable_security }}" == "true" ]; then - ADDITIONAL_FEATURES="true" + WITHOUT_ENHANCED_FEATURES="false" LOGIN_SECURITY="true" SECURITY_STATUS="🔒 Security Enabled" else - ADDITIONAL_FEATURES="false" + WITHOUT_ENHANCED_FEATURES="true" LOGIN_SECURITY="false" SECURITY_STATUS="Security Disabled" fi @@ -223,7 +223,7 @@ jobs: - /stirling/PR-${{ needs.check-comment.outputs.pr_number }}/config:/configs:rw - /stirling/PR-${{ needs.check-comment.outputs.pr_number }}/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "${ADDITIONAL_FEATURES}" + WITHOUT_ENHANCED_FEATURES: "${WITHOUT_ENHANCED_FEATURES}" SECURITY_ENABLELOGIN: "${LOGIN_SECURITY}" SYSTEM_DEFAULTLOCALE: en-GB UI_APPNAME: "Stirling-PDF PR#${{ needs.check-comment.outputs.pr_number }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83e071d5e..7628cb64d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,12 +40,12 @@ jobs: - name: Build with Gradle and no spring security run: ./gradlew clean build env: - ADDITIONAL_FEATURES: false + WITHOUT_ENHANCED_FEATURES: true - name: Build with Gradle and with spring security run: ./gradlew clean build env: - ADDITIONAL_FEATURES: true + WITHOUT_ENHANCED_FEATURES: false - name: Upload Test Reports if: always() diff --git a/.github/workflows/multiOSReleases.yml b/.github/workflows/multiOSReleases.yml index 8f219a957..58ccf0bc3 100644 --- a/.github/workflows/multiOSReleases.yml +++ b/.github/workflows/multiOSReleases.yml @@ -48,11 +48,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - enable_security: [true, false] + disable_security: [true, false] include: - - enable_security: true + - disable_security: false file_suffix: "-with-login" - - enable_security: false + - disable_security: true file_suffix: "" steps: - name: Harden Runner @@ -72,10 +72,10 @@ jobs: with: gradle-version: 8.14 - - name: Generate jar (With Security=${{ matrix.enable_security }}) + - name: Generate jar (With Security=${{ matrix.disable_security }}) run: ./gradlew clean createExe env: - ADDITIONAL_FEATURES: ${{ matrix.enable_security }} + WITHOUT_ENHANCED_FEATURES: ${{ matrix.disable_security }} STIRLING_PDF_DESKTOP_UI: false - name: Rename binaries @@ -98,11 +98,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - enable_security: [true, false] + disable_security: [true, false] include: - - enable_security: true + - disable_security: false file_suffix: "with-login-" - - enable_security: false + - disable_security: true file_suffix: "" steps: - name: Harden Runner @@ -171,7 +171,7 @@ jobs: - name: Build Installer run: ./gradlew build jpackage -x test --info env: - ADDITIONAL_FEATURES: false + WITHOUT_ENHANCED_FEATURES: true STIRLING_PDF_DESKTOP_UI: true BROWSER_OPEN: true diff --git a/.github/workflows/push-docker.yml b/.github/workflows/push-docker.yml index 6ab99a58f..2daff11b2 100644 --- a/.github/workflows/push-docker.yml +++ b/.github/workflows/push-docker.yml @@ -37,7 +37,7 @@ jobs: - name: Run Gradle Command run: ./gradlew clean build env: - ADDITIONAL_FEATURES: false + WITHOUT_ENHANCED_FEATURES: true STIRLING_PDF_DESKTOP_UI: false - name: Install cosign diff --git a/.github/workflows/releaseArtifacts.yml b/.github/workflows/releaseArtifacts.yml index 220dc620b..4ca4d4045 100644 --- a/.github/workflows/releaseArtifacts.yml +++ b/.github/workflows/releaseArtifacts.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - enable_security: [true, false] + disable_security: [true, false] include: - - enable_security: true + - disable_security: false file_suffix: "-with-login" - - enable_security: false + - disable_security: true file_suffix: "" outputs: version: ${{ steps.versionNumber.outputs.versionNumber }} @@ -39,10 +39,10 @@ jobs: with: gradle-version: 8.14 - - name: Generate jar (With Security=${{ matrix.enable_security }}) + - name: Generate jar (With Security=${{ matrix.disable_security }}) run: ./gradlew clean createExe env: - ADDITIONAL_FEATURES: ${{ matrix.enable_security }} + WITHOUT_ENHANCED_FEATURES: ${{ matrix.disable_security }} STIRLING_PDF_DESKTOP_UI: false - name: Get version number @@ -75,11 +75,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - enable_security: [true, false] + disable_security: [true, false] include: - - enable_security: true + - disable_security: false file_suffix: "-with-login" - - enable_security: false + - disable_security: true file_suffix: "" steps: - name: Harden Runner @@ -153,11 +153,11 @@ jobs: contents: write strategy: matrix: - enable_security: [true, false] + disable_security: [true, false] include: - - enable_security: true + - disable_security: false file_suffix: "-with-login" - - enable_security: false + - disable_security: true file_suffix: "" steps: - name: Harden Runner diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index d145fc6ff..e24eda4bd 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -33,7 +33,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - ADDITIONAL_FEATURES: true + WITHOUT_ENHANCED_FEATURES: false STIRLING_PDF_DESKTOP_UI: true run: | ./gradlew clean build sonar \ diff --git a/.github/workflows/testdriver.yml b/.github/workflows/testdriver.yml index c9a921d13..3a4bb0337 100644 --- a/.github/workflows/testdriver.yml +++ b/.github/workflows/testdriver.yml @@ -28,7 +28,7 @@ jobs: - name: Build with Gradle run: ./gradlew clean build env: - ADDITIONAL_FEATURES: false + WITHOUT_ENHANCED_FEATURES: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 @@ -76,7 +76,7 @@ jobs: - /stirling/test-${{ github.sha }}/config:/configs:rw - /stirling/test-${{ github.sha }}/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "false" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "false" SYSTEM_DEFAULTLOCALE: en-GB UI_APPNAME: "Stirling-PDF Test" diff --git a/DeveloperGuide.md b/DeveloperGuide.md index 9e9929305..a4cac3d62 100644 --- a/DeveloperGuide.md +++ b/DeveloperGuide.md @@ -55,7 +55,7 @@ Stirling-PDF uses Lombok to reduce boilerplate code. Some IDEs, like Eclipse, do Visit the [Lombok website](https://projectlombok.org/setup/) for installation instructions specific to your IDE. 5. Add environment variable -For local testing, you should generally be testing the full 'Security' version of Stirling-PDF. To do this, you must add the environment flag ADDITIONAL_FEATURES=true to your system and/or IDE build/run step. +For local testing, you should generally be testing the full 'Security' version of Stirling-PDF. Security is enabled by default. To disable it, you must add the environment flag WITHOUT_ENHANCED_FEATURES=true to your system and/or IDE build/run step. ## 4. Project Structure @@ -141,7 +141,7 @@ services: - /stirling/latest/config:/configs:rw - /stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "true" SECURITY_ENABLELOGIN: "true" PUID: 1002 PGID: 1002 @@ -170,7 +170,7 @@ Stirling-PDF uses different Docker images for various configurations. The build 1. Set the security environment variable: ```bash - export ADDITIONAL_FEATURES=false # or true for security-enabled builds + export WITHOUT_ENHANCED_FEATURES=false # or true for security-enabled builds ``` 2. Build the project with Gradle: @@ -196,7 +196,7 @@ Stirling-PDF uses different Docker images for various configurations. The build For the fat version (with security enabled): ```bash - export ADDITIONAL_FEATURES=true + export WITHOUT_ENHANCED_FEATURES=true docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t stirlingtools/stirling-pdf:latest-fat -f ./Dockerfile.fat . ``` diff --git a/Dockerfile b/Dockerfile index a0ad92c29..9f13b8137 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,8 @@ LABEL org.opencontainers.image.version="${VERSION_TAG}" LABEL org.opencontainers.image.keywords="PDF, manipulation, merge, split, convert, OCR, watermark" # Set Environment Variables -ENV ADDITIONAL_FEATURES=false \ +# todo: keep security off? +ENV WITHOUT_ENHANCED_FEATURES=true \ VERSION_TAG=$VERSION_TAG \ JAVA_BASE_OPTS="-XX:+UnlockExperimentalVMOptions -XX:MaxRAMPercentage=75 -XX:InitiatingHeapOccupancyPercent=20 -XX:+G1PeriodicGCInvokesConcurrent -XX:G1PeriodicGCInterval=10000 -XX:+UseStringDeduplication -XX:G1PeriodicGCSystemLoadThreshold=70" \ JAVA_CUSTOM_OPTS="" \ diff --git a/Dockerfile.fat b/Dockerfile.fat index 31e027647..7b0ff650a 100644 --- a/Dockerfile.fat +++ b/Dockerfile.fat @@ -13,8 +13,8 @@ WORKDIR /app # Copy the entire project to the working directory COPY . . -# Build the application with ADDITIONAL_FEATURES=false -RUN ADDITIONAL_FEATURES=true \ +# Build the application with WITHOUT_ENHANCED_FEATURES=false +RUN WITHOUT_ENHANCED_FEATURES=false \ STIRLING_PDF_DESKTOP_UI=false \ ./gradlew clean build -x spotlessApply -x spotlessCheck -x test -x sonarqube @@ -30,7 +30,7 @@ COPY --from=build /app/build/libs/*.jar app.jar ARG VERSION_TAG # Set Environment Variables -ENV ADDITIONAL_FEATURES=false \ +ENV WITHOUT_ENHANCED_FEATURES=false \ VERSION_TAG=$VERSION_TAG \ JAVA_BASE_OPTS="-XX:+UnlockExperimentalVMOptions -XX:MaxRAMPercentage=75 -XX:InitiatingHeapOccupancyPercent=20 -XX:+G1PeriodicGCInvokesConcurrent -XX:G1PeriodicGCInterval=10000 -XX:+UseStringDeduplication -XX:G1PeriodicGCSystemLoadThreshold=70" \ JAVA_CUSTOM_OPTS="" \ diff --git a/Dockerfile.ultra-lite b/Dockerfile.ultra-lite index 7e9718f6e..3ea5e8cc4 100644 --- a/Dockerfile.ultra-lite +++ b/Dockerfile.ultra-lite @@ -4,7 +4,7 @@ FROM alpine:3.21.3@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff45 ARG VERSION_TAG # Set Environment Variables -ENV ADDITIONAL_FEATURES=false \ +ENV WITHOUT_ENHANCED_FEATURES=true \ HOME=/home/stirlingpdfuser \ VERSION_TAG=$VERSION_TAG \ JAVA_BASE_OPTS="-XX:+UnlockExperimentalVMOptions -XX:MaxRAMPercentage=75 -XX:InitiatingHeapOccupancyPercent=20 -XX:+G1PeriodicGCInvokesConcurrent -XX:G1PeriodicGCInterval=10000 -XX:+UseStringDeduplication -XX:G1PeriodicGCSystemLoadThreshold=70" \ diff --git a/build.gradle b/build.gradle index ad2e9d3e7..332ee8a59 100644 --- a/build.gradle +++ b/build.gradle @@ -45,11 +45,15 @@ bootJar { sourceSets { main { java { - if (System.getenv('ADDITIONAL_FEATURES') == 'false') { + if (System.getenv('WITHOUT_ENHANCED_FEATURES') == 'false' + || (project.hasProperty('WITHOUT_ENHANCED_FEATURES') + && System.getProperty('WITHOUT_ENHANCED_FEATURES') == 'false')) { exclude 'stirling/software/proprietary/security/**' } - if (System.getenv('STIRLING_PDF_DESKTOP_UI') == 'false') { + if (System.getenv('STIRLING_PDF_DESKTOP_UI') != 'false' + || (project.hasProperty('STIRLING_PDF_DESKTOP_UI') + && project.getProperty('STIRLING_PDF_DESKTOP_UI') != 'false')) { exclude 'stirling/software/spdf/UI/impl/**' } } @@ -57,11 +61,15 @@ sourceSets { test { java { - if (System.getenv('ADDITIONAL_FEATURES') == 'false') { + if (System.getenv('WITHOUT_ENHANCED_FEATURES') == 'false' + || (project.hasProperty('WITHOUT_ENHANCED_FEATURES') + && System.getProperty('WITHOUT_ENHANCED_FEATURES') == 'false')) { exclude 'stirling/software/proprietary/security/**' } - if (System.getenv('STIRLING_PDF_DESKTOP_UI') == 'false') { + if (System.getenv('STIRLING_PDF_DESKTOP_UI') != 'false' + || (project.hasProperty('STIRLING_PDF_DESKTOP_UI') + && project.getProperty('STIRLING_PDF_DESKTOP_UI') != 'false')) { exclude 'stirling/software/spdf/UI/impl/**' } } 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 771efa9dc..26d0e026c 100644 --- a/common/src/main/java/stirling/software/common/configuration/AppConfig.java +++ b/common/src/main/java/stirling/software/common/configuration/AppConfig.java @@ -61,8 +61,8 @@ public class AppConfig { } @Bean - public boolean activeSecurity() { - return env.getProperty("ADDITIONAL_FEATURES", Boolean.class, true); + public boolean disableSecurity() { + return env.getProperty("WITHOUT_ENHANCED_FEATURES", Boolean.class, false); } @Bean(name = "appName") @@ -148,7 +148,7 @@ public class AppConfig { } } - @Bean(name = "missingActiveSecurity") + @Bean(name = "missingActiveSecurity") // todo: may not be needed anymore @ConditionalOnMissingClass("stirling.software.proprietary.security.SecurityConfiguration") public boolean missingActiveSecurity() { return true; diff --git a/common/src/main/java/stirling/software/common/service/PostHogService.java b/common/src/main/java/stirling/software/common/service/PostHogService.java index 6f5a0cca2..6965027dd 100644 --- a/common/src/main/java/stirling/software/common/service/PostHogService.java +++ b/common/src/main/java/stirling/software/common/service/PostHogService.java @@ -208,7 +208,7 @@ public class PostHogService { // New environment variables dockerMetrics.put("version_tag", System.getenv("VERSION_TAG")); - dockerMetrics.put("additional_features", System.getenv("ADDITIONAL_FEATURES")); + dockerMetrics.put("without_enhanced_features", System.getenv("WITHOUT_ENHANCED_FEATURES")); dockerMetrics.put("fat_docker", System.getenv("FAT_DOCKER")); return dockerMetrics; diff --git a/exampleYmlFiles/docker-compose-latest-fat-endpoints-disabled.yml b/exampleYmlFiles/docker-compose-latest-fat-endpoints-disabled.yml index 7cf739ae6..66d79c900 100644 --- a/exampleYmlFiles/docker-compose-latest-fat-endpoints-disabled.yml +++ b/exampleYmlFiles/docker-compose-latest-fat-endpoints-disabled.yml @@ -20,7 +20,7 @@ services: - ./stirling/latest/logs:/logs:rw - ../testing/allEndpointsRemovedSettings.yml:/configs/settings.yml:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "false" PUID: 1002 PGID: 1002 diff --git a/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml b/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml index 954a106d4..d92fbe1ee 100644 --- a/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml +++ b/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml @@ -20,7 +20,7 @@ services: - ./stirling/latest/config:/configs:rw - ./stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "false" PUID: 1002 PGID: 1002 diff --git a/exampleYmlFiles/docker-compose-latest-fat-security.yml b/exampleYmlFiles/docker-compose-latest-fat-security.yml index ce4cbfa1b..6db9ea38b 100644 --- a/exampleYmlFiles/docker-compose-latest-fat-security.yml +++ b/exampleYmlFiles/docker-compose-latest-fat-security.yml @@ -18,7 +18,7 @@ services: - ./stirling/latest/config:/configs:rw - ./stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "false" PUID: 1002 PGID: 1002 diff --git a/exampleYmlFiles/docker-compose-latest-security-with-sso.yml b/exampleYmlFiles/docker-compose-latest-security-with-sso.yml index b889e90fb..2b564fce5 100644 --- a/exampleYmlFiles/docker-compose-latest-security-with-sso.yml +++ b/exampleYmlFiles/docker-compose-latest-security-with-sso.yml @@ -18,7 +18,7 @@ services: - /stirling/latest/config:/configs:rw - /stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "true" SECURITY_OAUTH2_ENABLED: "true" SECURITY_OAUTH2_AUTOCREATEUSER: "true" # This is set to true to allow auto-creation of non-existing users in Stirling-PDF diff --git a/exampleYmlFiles/docker-compose-latest-security.yml b/exampleYmlFiles/docker-compose-latest-security.yml index 347e30633..9936b0963 100644 --- a/exampleYmlFiles/docker-compose-latest-security.yml +++ b/exampleYmlFiles/docker-compose-latest-security.yml @@ -18,7 +18,7 @@ services: - ./stirling/latest/config:/configs:rw - ./stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "true" PUID: 1002 PGID: 1002 diff --git a/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml b/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml index 2133fb9c9..af4660dc4 100644 --- a/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml +++ b/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml @@ -18,7 +18,7 @@ services: - /stirling/latest/config:/configs:rw - /stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "true" SYSTEM_DEFAULTLOCALE: en-US UI_APPNAME: Stirling-PDF-Lite diff --git a/exampleYmlFiles/docker-compose-latest-ultra-lite.yml b/exampleYmlFiles/docker-compose-latest-ultra-lite.yml index 968ac99a3..b26ce3fa4 100644 --- a/exampleYmlFiles/docker-compose-latest-ultra-lite.yml +++ b/exampleYmlFiles/docker-compose-latest-ultra-lite.yml @@ -17,7 +17,7 @@ services: - /stirling/latest/config:/configs:rw - /stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "false" + WITHOUT_ENHANCED_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 5676a2e8b..315ef5ec7 100644 --- a/exampleYmlFiles/docker-compose-latest.yml +++ b/exampleYmlFiles/docker-compose-latest.yml @@ -18,7 +18,7 @@ services: - /stirling/latest/config:/configs:rw - /stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "false" + WITHOUT_ENHANCED_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/exampleYmlFiles/test_cicd.yml b/exampleYmlFiles/test_cicd.yml index 3a1f72697..40c0f83a8 100644 --- a/exampleYmlFiles/test_cicd.yml +++ b/exampleYmlFiles/test_cicd.yml @@ -18,7 +18,7 @@ services: - /stirling/latest/config:/configs:rw - /stirling/latest/logs:/logs:rw environment: - ADDITIONAL_FEATURES: "true" + WITHOUT_ENHANCED_FEATURES: "false" SECURITY_ENABLELOGIN: "true" PUID: 1002 PGID: 1002 diff --git a/proprietary/build.gradle b/proprietary/build.gradle index c3109339c..afcffd52d 100644 --- a/proprietary/build.gradle +++ b/proprietary/build.gradle @@ -14,33 +14,6 @@ bootJar { enabled = false } -// todo: check if needed here -sourceSets { - main { - java { - if (System.getenv('ADDITIONAL_FEATURES') == 'false') { - exclude 'stirling/software/proprietary/security/**' - } - - if (System.getenv('STIRLING_PDF_DESKTOP_UI') == 'false') { - exclude 'stirling/software/spdf/UI/impl/**' - } - } - - test { - java { - if (System.getenv('ADDITIONAL_FEATURES') == 'false') { - exclude 'stirling/software/proprietary/security/**' - } - - if (System.getenv('STIRLING_PDF_DESKTOP_UI') == 'false') { - exclude 'stirling/software/spdf/UI/impl/**' - } - } - } - } -} - dependencies { implementation project(':common') diff --git a/scripts/download-security-jar.sh b/scripts/download-security-jar.sh index 3a71d3f25..a1d3959c0 100644 --- a/scripts/download-security-jar.sh +++ b/scripts/download-security-jar.sh @@ -1,6 +1,6 @@ -echo "Running Stirling PDF with ADDITIONAL_FEATURES=${ADDITIONAL_FEATURES} and VERSION_TAG=${VERSION_TAG}" -# Check for ADDITIONAL_FEATURES and download the appropriate JAR if required -if [ "ADDITIONAL_FEATURES" = "true" ] && [ "$VERSION_TAG" != "alpha" ]; then +echo "Running Stirling PDF with WITHOUT_ENHANCED_FEATURES=${WITHOUT_ENHANCED_FEATURES} and VERSION_TAG=${VERSION_TAG}" +# Check for WITHOUT_ENHANCED_FEATURES and download the appropriate JAR if required +if [ "WITHOUT_ENHANCED_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 diff --git a/stirling-pdf/build.gradle b/stirling-pdf/build.gradle index e0424abe3..c95a8d263 100644 --- a/stirling-pdf/build.gradle +++ b/stirling-pdf/build.gradle @@ -3,18 +3,22 @@ plugins { } repositories { - maven { url = "https://build.shibboleth.net/maven/releases" } - maven { url = "https://maven.pkg.github.com/jcefmaven/jcefmaven" } + maven { url = 'https://build.shibboleth.net/maven/releases' } + maven { url = 'https://maven.pkg.github.com/jcefmaven/jcefmaven' } } dependencies { - if (System.getenv("STIRLING_PDF_DESKTOP_UI") != "false") { - implementation "me.friwi:jcefmaven:132.3.1" - implementation "org.openjfx:javafx-controls:21" - implementation "org.openjfx:javafx-swing:21" + if (System.getenv('STIRLING_PDF_DESKTOP_UI') != 'false' + || (project.hasProperty('STIRLING_PDF_DESKTOP_UI') + && project.getProperty('STIRLING_PDF_DESKTOP_UI') != 'false')) { + implementation 'me.friwi:jcefmaven:132.3.1' + implementation 'org.openjfx:javafx-controls:21' + implementation 'org.openjfx:javafx-swing:21' } - if (System.getenv("ADDITIONAL_FEATURES") == "true") { + if (System.getenv('WITHOUT_ENHANCED_FEATURES') == 'false' + || (project.hasProperty('WITHOUT_ENHANCED_FEATURES') + && System.getProperty('WITHOUT_ENHANCED_FEATURES') == 'false')) { implementation project(':proprietary') } @@ -34,9 +38,9 @@ dependencies { implementation "org.commonmark:commonmark-ext-gfm-tables:$commonmarkVersion" // General PDF dependencies - implementation ("org.apache.pdfbox:pdfbox:$pdfboxVersion") + implementation "org.apache.pdfbox:pdfbox:$pdfboxVersion" implementation "org.apache.pdfbox:preflight:$pdfboxVersion" - implementation ("org.apache.pdfbox:xmpbox:$pdfboxVersion") + implementation "org.apache.pdfbox:xmpbox:$pdfboxVersion" // https://mvnrepository.com/artifact/technology.tabula/tabula implementation ('technology.tabula:tabula:1.0.5') { @@ -45,7 +49,7 @@ dependencies { exclude group: 'com.google.code.gson', module: 'gson' } implementation 'org.apache.pdfbox:jbig2-imageio:3.0.4' - implementation ('com.opencsv:opencsv:5.11') // https://mvnrepository.com/artifact/com.opencsv/opencsv + implementation 'com.opencsv:opencsv:5.11' // https://mvnrepository.com/artifact/com.opencsv/opencsv // Batik implementation 'org.apache.xmlgraphics:batik-all:1.18' @@ -81,6 +85,7 @@ sourceSets { jar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE + zip64 = true from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } @@ -89,27 +94,12 @@ jar { manifest { attributes( 'Main-Class': 'stirling.software.spdf.SPDFApplication', - "Implementation-Title": "Stirling-PDF", - "Implementation-Version": project.version + 'Implementation-Title': 'Stirling-PDF', + 'Implementation-Version': project.version ) } } -shadowJar { - archiveClassifier.set('shadow') - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - manifest { - attributes( - 'Main-Class': 'stirling.software.spdf.SPDFApplication' - ) - } - zip64 = true - mergeServiceFiles() -} - -build.dependsOn shadowJar jar.dependsOn ':common:jar' -shadowJar.dependsOn ':common:jar' jar.dependsOn ':proprietary:jar' -shadowJar.dependsOn ':proprietary:jar' diff --git a/stirling-pdf/build/resources/main/application.properties b/stirling-pdf/build/resources/main/application.properties index 64b658906..cf5c35314 100644 --- a/stirling-pdf/build/resources/main/application.properties +++ b/stirling-pdf/build/resources/main/application.properties @@ -31,7 +31,6 @@ spring.mvc.async.request-timeout=${SYSTEM_CONNECTIONTIMEOUTMILLISECONDS:1200000} management.endpoints.web.exposure.include=beans spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration -#spring.config.additional-location=classpath:configs/settings.yml 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 diff --git a/stirling-pdf/build/resources/main/templates/fragments/navbar.html b/stirling-pdf/build/resources/main/templates/fragments/navbar.html index e6fe91fc9..c673cabb0 100644 --- a/stirling-pdf/build/resources/main/templates/fragments/navbar.html +++ b/stirling-pdf/build/resources/main/templates/fragments/navbar.html @@ -253,11 +253,11 @@ - Account Settings
diff --git a/stirling-pdf/src/main/resources/application.properties b/stirling-pdf/src/main/resources/application.properties index 64b658906..cf5c35314 100644 --- a/stirling-pdf/src/main/resources/application.properties +++ b/stirling-pdf/src/main/resources/application.properties @@ -31,7 +31,6 @@ spring.mvc.async.request-timeout=${SYSTEM_CONNECTIONTIMEOUTMILLISECONDS:1200000} management.endpoints.web.exposure.include=beans spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration -#spring.config.additional-location=classpath:configs/settings.yml 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 diff --git a/stirling-pdf/src/main/resources/templates/fragments/navbar.html b/stirling-pdf/src/main/resources/templates/fragments/navbar.html index e6fe91fc9..f4bc6f96d 100644 --- a/stirling-pdf/src/main/resources/templates/fragments/navbar.html +++ b/stirling-pdf/src/main/resources/templates/fragments/navbar.html @@ -253,11 +253,11 @@ - Account Settings diff --git a/testing/test.sh b/testing/test.sh index 62ba2aa7c..9623213ce 100644 --- a/testing/test.sh +++ b/testing/test.sh @@ -214,7 +214,7 @@ main() { export DOCKER_CLI_EXPERIMENTAL=enabled export COMPOSE_DOCKER_CLI_BUILD=0 - export ADDITIONAL_FEATURES=false + export WITHOUT_ENHANCED_FEATURES=true # Run the gradlew build command and check if it fails if ! ./gradlew clean build; then echo "Gradle build failed with security disabled, exiting script." @@ -242,7 +242,7 @@ main() { # run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml" # docker-compose -f "./exampleYmlFiles/docker-compose-latest.yml" down - export ADDITIONAL_FEATURES=true + export WITHOUT_ENHANCED_FEATURES=false # Run the gradlew build command and check if it fails if ! ./gradlew clean build; then echo "Gradle build failed with security enabled, exiting script."