activeSecurity > disableSecurity

This commit is contained in:
Dario Ghunney Ware 2025-05-21 17:07:39 +01:00
parent ae2e16867f
commit f8b2b0e6d7
31 changed files with 92 additions and 122 deletions

View File

@ -156,9 +156,9 @@ jobs:
- name: Run Gradle Command - name: Run Gradle Command
run: | run: |
if [ "${{ needs.check-comment.outputs.enable_security }}" == "true" ]; then if [ "${{ needs.check-comment.outputs.enable_security }}" == "true" ]; then
export ADDITIONAL_FEATURES=true export WITHOUT_ENHANCED_FEATURES=false
else else
export ADDITIONAL_FEATURES=false export WITHOUT_ENHANCED_FEATURES=true
fi fi
./gradlew clean build ./gradlew clean build
env: env:
@ -200,11 +200,11 @@ jobs:
run: | run: |
# Set security settings based on flags # Set security settings based on flags
if [ "${{ needs.check-comment.outputs.enable_security }}" == "true" ]; then if [ "${{ needs.check-comment.outputs.enable_security }}" == "true" ]; then
ADDITIONAL_FEATURES="true" WITHOUT_ENHANCED_FEATURES="false"
LOGIN_SECURITY="true" LOGIN_SECURITY="true"
SECURITY_STATUS="🔒 Security Enabled" SECURITY_STATUS="🔒 Security Enabled"
else else
ADDITIONAL_FEATURES="false" WITHOUT_ENHANCED_FEATURES="true"
LOGIN_SECURITY="false" LOGIN_SECURITY="false"
SECURITY_STATUS="Security Disabled" SECURITY_STATUS="Security Disabled"
fi 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 }}/config:/configs:rw
- /stirling/PR-${{ needs.check-comment.outputs.pr_number }}/logs:/logs:rw - /stirling/PR-${{ needs.check-comment.outputs.pr_number }}/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "${ADDITIONAL_FEATURES}" WITHOUT_ENHANCED_FEATURES: "${WITHOUT_ENHANCED_FEATURES}"
SECURITY_ENABLELOGIN: "${LOGIN_SECURITY}" SECURITY_ENABLELOGIN: "${LOGIN_SECURITY}"
SYSTEM_DEFAULTLOCALE: en-GB SYSTEM_DEFAULTLOCALE: en-GB
UI_APPNAME: "Stirling-PDF PR#${{ needs.check-comment.outputs.pr_number }}" UI_APPNAME: "Stirling-PDF PR#${{ needs.check-comment.outputs.pr_number }}"

View File

@ -40,12 +40,12 @@ jobs:
- name: Build with Gradle and no spring security - name: Build with Gradle and no spring security
run: ./gradlew clean build run: ./gradlew clean build
env: env:
ADDITIONAL_FEATURES: false WITHOUT_ENHANCED_FEATURES: true
- name: Build with Gradle and with spring security - name: Build with Gradle and with spring security
run: ./gradlew clean build run: ./gradlew clean build
env: env:
ADDITIONAL_FEATURES: true WITHOUT_ENHANCED_FEATURES: false
- name: Upload Test Reports - name: Upload Test Reports
if: always() if: always()

View File

@ -48,11 +48,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
enable_security: [true, false] disable_security: [true, false]
include: include:
- enable_security: true - disable_security: false
file_suffix: "-with-login" file_suffix: "-with-login"
- enable_security: false - disable_security: true
file_suffix: "" file_suffix: ""
steps: steps:
- name: Harden Runner - name: Harden Runner
@ -72,10 +72,10 @@ jobs:
with: with:
gradle-version: 8.14 gradle-version: 8.14
- name: Generate jar (With Security=${{ matrix.enable_security }}) - name: Generate jar (With Security=${{ matrix.disable_security }})
run: ./gradlew clean createExe run: ./gradlew clean createExe
env: env:
ADDITIONAL_FEATURES: ${{ matrix.enable_security }} WITHOUT_ENHANCED_FEATURES: ${{ matrix.disable_security }}
STIRLING_PDF_DESKTOP_UI: false STIRLING_PDF_DESKTOP_UI: false
- name: Rename binaries - name: Rename binaries
@ -98,11 +98,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
enable_security: [true, false] disable_security: [true, false]
include: include:
- enable_security: true - disable_security: false
file_suffix: "with-login-" file_suffix: "with-login-"
- enable_security: false - disable_security: true
file_suffix: "" file_suffix: ""
steps: steps:
- name: Harden Runner - name: Harden Runner
@ -171,7 +171,7 @@ jobs:
- name: Build Installer - name: Build Installer
run: ./gradlew build jpackage -x test --info run: ./gradlew build jpackage -x test --info
env: env:
ADDITIONAL_FEATURES: false WITHOUT_ENHANCED_FEATURES: true
STIRLING_PDF_DESKTOP_UI: true STIRLING_PDF_DESKTOP_UI: true
BROWSER_OPEN: true BROWSER_OPEN: true

View File

@ -37,7 +37,7 @@ jobs:
- name: Run Gradle Command - name: Run Gradle Command
run: ./gradlew clean build run: ./gradlew clean build
env: env:
ADDITIONAL_FEATURES: false WITHOUT_ENHANCED_FEATURES: true
STIRLING_PDF_DESKTOP_UI: false STIRLING_PDF_DESKTOP_UI: false
- name: Install cosign - name: Install cosign

View File

@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
enable_security: [true, false] disable_security: [true, false]
include: include:
- enable_security: true - disable_security: false
file_suffix: "-with-login" file_suffix: "-with-login"
- enable_security: false - disable_security: true
file_suffix: "" file_suffix: ""
outputs: outputs:
version: ${{ steps.versionNumber.outputs.versionNumber }} version: ${{ steps.versionNumber.outputs.versionNumber }}
@ -39,10 +39,10 @@ jobs:
with: with:
gradle-version: 8.14 gradle-version: 8.14
- name: Generate jar (With Security=${{ matrix.enable_security }}) - name: Generate jar (With Security=${{ matrix.disable_security }})
run: ./gradlew clean createExe run: ./gradlew clean createExe
env: env:
ADDITIONAL_FEATURES: ${{ matrix.enable_security }} WITHOUT_ENHANCED_FEATURES: ${{ matrix.disable_security }}
STIRLING_PDF_DESKTOP_UI: false STIRLING_PDF_DESKTOP_UI: false
- name: Get version number - name: Get version number
@ -75,11 +75,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
enable_security: [true, false] disable_security: [true, false]
include: include:
- enable_security: true - disable_security: false
file_suffix: "-with-login" file_suffix: "-with-login"
- enable_security: false - disable_security: true
file_suffix: "" file_suffix: ""
steps: steps:
- name: Harden Runner - name: Harden Runner
@ -153,11 +153,11 @@ jobs:
contents: write contents: write
strategy: strategy:
matrix: matrix:
enable_security: [true, false] disable_security: [true, false]
include: include:
- enable_security: true - disable_security: false
file_suffix: "-with-login" file_suffix: "-with-login"
- enable_security: false - disable_security: true
file_suffix: "" file_suffix: ""
steps: steps:
- name: Harden Runner - name: Harden Runner

View File

@ -33,7 +33,7 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ADDITIONAL_FEATURES: true WITHOUT_ENHANCED_FEATURES: false
STIRLING_PDF_DESKTOP_UI: true STIRLING_PDF_DESKTOP_UI: true
run: | run: |
./gradlew clean build sonar \ ./gradlew clean build sonar \

View File

@ -28,7 +28,7 @@ jobs:
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew clean build run: ./gradlew clean build
env: env:
ADDITIONAL_FEATURES: false WITHOUT_ENHANCED_FEATURES: false
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 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 }}/config:/configs:rw
- /stirling/test-${{ github.sha }}/logs:/logs:rw - /stirling/test-${{ github.sha }}/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "false" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "false" SECURITY_ENABLELOGIN: "false"
SYSTEM_DEFAULTLOCALE: en-GB SYSTEM_DEFAULTLOCALE: en-GB
UI_APPNAME: "Stirling-PDF Test" UI_APPNAME: "Stirling-PDF Test"

View File

@ -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. Visit the [Lombok website](https://projectlombok.org/setup/) for installation instructions specific to your IDE.
5. Add environment variable 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 ## 4. Project Structure
@ -141,7 +141,7 @@ services:
- /stirling/latest/config:/configs:rw - /stirling/latest/config:/configs:rw
- /stirling/latest/logs:/logs:rw - /stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "true"
SECURITY_ENABLELOGIN: "true" SECURITY_ENABLELOGIN: "true"
PUID: 1002 PUID: 1002
PGID: 1002 PGID: 1002
@ -170,7 +170,7 @@ Stirling-PDF uses different Docker images for various configurations. The build
1. Set the security environment variable: 1. Set the security environment variable:
```bash ```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: 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): For the fat version (with security enabled):
```bash ```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 . docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t stirlingtools/stirling-pdf:latest-fat -f ./Dockerfile.fat .
``` ```

View File

@ -23,7 +23,8 @@ LABEL org.opencontainers.image.version="${VERSION_TAG}"
LABEL org.opencontainers.image.keywords="PDF, manipulation, merge, split, convert, OCR, watermark" LABEL org.opencontainers.image.keywords="PDF, manipulation, merge, split, convert, OCR, watermark"
# Set Environment Variables # Set Environment Variables
ENV ADDITIONAL_FEATURES=false \ # todo: keep security off?
ENV WITHOUT_ENHANCED_FEATURES=true \
VERSION_TAG=$VERSION_TAG \ 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_BASE_OPTS="-XX:+UnlockExperimentalVMOptions -XX:MaxRAMPercentage=75 -XX:InitiatingHeapOccupancyPercent=20 -XX:+G1PeriodicGCInvokesConcurrent -XX:G1PeriodicGCInterval=10000 -XX:+UseStringDeduplication -XX:G1PeriodicGCSystemLoadThreshold=70" \
JAVA_CUSTOM_OPTS="" \ JAVA_CUSTOM_OPTS="" \

View File

@ -13,8 +13,8 @@ WORKDIR /app
# Copy the entire project to the working directory # Copy the entire project to the working directory
COPY . . COPY . .
# Build the application with ADDITIONAL_FEATURES=false # Build the application with WITHOUT_ENHANCED_FEATURES=false
RUN ADDITIONAL_FEATURES=true \ RUN WITHOUT_ENHANCED_FEATURES=false \
STIRLING_PDF_DESKTOP_UI=false \ STIRLING_PDF_DESKTOP_UI=false \
./gradlew clean build -x spotlessApply -x spotlessCheck -x test -x sonarqube ./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 ARG VERSION_TAG
# Set Environment Variables # Set Environment Variables
ENV ADDITIONAL_FEATURES=false \ ENV WITHOUT_ENHANCED_FEATURES=false \
VERSION_TAG=$VERSION_TAG \ 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_BASE_OPTS="-XX:+UnlockExperimentalVMOptions -XX:MaxRAMPercentage=75 -XX:InitiatingHeapOccupancyPercent=20 -XX:+G1PeriodicGCInvokesConcurrent -XX:G1PeriodicGCInterval=10000 -XX:+UseStringDeduplication -XX:G1PeriodicGCSystemLoadThreshold=70" \
JAVA_CUSTOM_OPTS="" \ JAVA_CUSTOM_OPTS="" \

View File

@ -4,7 +4,7 @@ FROM alpine:3.21.3@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff45
ARG VERSION_TAG ARG VERSION_TAG
# Set Environment Variables # Set Environment Variables
ENV ADDITIONAL_FEATURES=false \ ENV WITHOUT_ENHANCED_FEATURES=true \
HOME=/home/stirlingpdfuser \ HOME=/home/stirlingpdfuser \
VERSION_TAG=$VERSION_TAG \ 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_BASE_OPTS="-XX:+UnlockExperimentalVMOptions -XX:MaxRAMPercentage=75 -XX:InitiatingHeapOccupancyPercent=20 -XX:+G1PeriodicGCInvokesConcurrent -XX:G1PeriodicGCInterval=10000 -XX:+UseStringDeduplication -XX:G1PeriodicGCSystemLoadThreshold=70" \

View File

@ -45,11 +45,15 @@ bootJar {
sourceSets { sourceSets {
main { main {
java { 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/**' 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/**' exclude 'stirling/software/spdf/UI/impl/**'
} }
} }
@ -57,11 +61,15 @@ sourceSets {
test { test {
java { 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/**' 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/**' exclude 'stirling/software/spdf/UI/impl/**'
} }
} }

View File

@ -61,8 +61,8 @@ public class AppConfig {
} }
@Bean @Bean
public boolean activeSecurity() { public boolean disableSecurity() {
return env.getProperty("ADDITIONAL_FEATURES", Boolean.class, true); return env.getProperty("WITHOUT_ENHANCED_FEATURES", Boolean.class, false);
} }
@Bean(name = "appName") @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") @ConditionalOnMissingClass("stirling.software.proprietary.security.SecurityConfiguration")
public boolean missingActiveSecurity() { public boolean missingActiveSecurity() {
return true; return true;

View File

@ -208,7 +208,7 @@ public class PostHogService {
// New environment variables // New environment variables
dockerMetrics.put("version_tag", System.getenv("VERSION_TAG")); 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")); dockerMetrics.put("fat_docker", System.getenv("FAT_DOCKER"));
return dockerMetrics; return dockerMetrics;

View File

@ -20,7 +20,7 @@ services:
- ./stirling/latest/logs:/logs:rw - ./stirling/latest/logs:/logs:rw
- ../testing/allEndpointsRemovedSettings.yml:/configs/settings.yml:rw - ../testing/allEndpointsRemovedSettings.yml:/configs/settings.yml:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "false" SECURITY_ENABLELOGIN: "false"
PUID: 1002 PUID: 1002
PGID: 1002 PGID: 1002

View File

@ -20,7 +20,7 @@ services:
- ./stirling/latest/config:/configs:rw - ./stirling/latest/config:/configs:rw
- ./stirling/latest/logs:/logs:rw - ./stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "false" SECURITY_ENABLELOGIN: "false"
PUID: 1002 PUID: 1002
PGID: 1002 PGID: 1002

View File

@ -18,7 +18,7 @@ services:
- ./stirling/latest/config:/configs:rw - ./stirling/latest/config:/configs:rw
- ./stirling/latest/logs:/logs:rw - ./stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "false" SECURITY_ENABLELOGIN: "false"
PUID: 1002 PUID: 1002
PGID: 1002 PGID: 1002

View File

@ -18,7 +18,7 @@ services:
- /stirling/latest/config:/configs:rw - /stirling/latest/config:/configs:rw
- /stirling/latest/logs:/logs:rw - /stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "true" SECURITY_ENABLELOGIN: "true"
SECURITY_OAUTH2_ENABLED: "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 SECURITY_OAUTH2_AUTOCREATEUSER: "true" # This is set to true to allow auto-creation of non-existing users in Stirling-PDF

View File

@ -18,7 +18,7 @@ services:
- ./stirling/latest/config:/configs:rw - ./stirling/latest/config:/configs:rw
- ./stirling/latest/logs:/logs:rw - ./stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "true" SECURITY_ENABLELOGIN: "true"
PUID: 1002 PUID: 1002
PGID: 1002 PGID: 1002

View File

@ -18,7 +18,7 @@ services:
- /stirling/latest/config:/configs:rw - /stirling/latest/config:/configs:rw
- /stirling/latest/logs:/logs:rw - /stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "true" SECURITY_ENABLELOGIN: "true"
SYSTEM_DEFAULTLOCALE: en-US SYSTEM_DEFAULTLOCALE: en-US
UI_APPNAME: Stirling-PDF-Lite UI_APPNAME: Stirling-PDF-Lite

View File

@ -17,7 +17,7 @@ services:
- /stirling/latest/config:/configs:rw - /stirling/latest/config:/configs:rw
- /stirling/latest/logs:/logs:rw - /stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "false" WITHOUT_ENHANCED_FEATURES: "true"
SECURITY_ENABLELOGIN: "false" SECURITY_ENABLELOGIN: "false"
SYSTEM_DEFAULTLOCALE: en-US SYSTEM_DEFAULTLOCALE: en-US
UI_APPNAME: Stirling-PDF-Ultra-lite UI_APPNAME: Stirling-PDF-Ultra-lite

View File

@ -18,7 +18,7 @@ services:
- /stirling/latest/config:/configs:rw - /stirling/latest/config:/configs:rw
- /stirling/latest/logs:/logs:rw - /stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "false" WITHOUT_ENHANCED_FEATURES: "true"
SECURITY_ENABLELOGIN: "false" 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" 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 SYSTEM_DEFAULTLOCALE: en-US

View File

@ -18,7 +18,7 @@ services:
- /stirling/latest/config:/configs:rw - /stirling/latest/config:/configs:rw
- /stirling/latest/logs:/logs:rw - /stirling/latest/logs:/logs:rw
environment: environment:
ADDITIONAL_FEATURES: "true" WITHOUT_ENHANCED_FEATURES: "false"
SECURITY_ENABLELOGIN: "true" SECURITY_ENABLELOGIN: "true"
PUID: 1002 PUID: 1002
PGID: 1002 PGID: 1002

View File

@ -14,33 +14,6 @@ bootJar {
enabled = false 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 { dependencies {
implementation project(':common') implementation project(':common')

View File

@ -1,6 +1,6 @@
echo "Running Stirling PDF with ADDITIONAL_FEATURES=${ADDITIONAL_FEATURES} and VERSION_TAG=${VERSION_TAG}" echo "Running Stirling PDF with WITHOUT_ENHANCED_FEATURES=${WITHOUT_ENHANCED_FEATURES} and VERSION_TAG=${VERSION_TAG}"
# Check for ADDITIONAL_FEATURES and download the appropriate JAR if required # Check for WITHOUT_ENHANCED_FEATURES and download the appropriate JAR if required
if [ "ADDITIONAL_FEATURES" = "true" ] && [ "$VERSION_TAG" != "alpha" ]; then if [ "WITHOUT_ENHANCED_FEATURES" = "false" ] && [ "$VERSION_TAG" != "alpha" ]; then
if [ ! -f app-security.jar ]; then if [ ! -f app-security.jar ]; then
echo "Trying to download from: https://files.stirlingpdf.com/v$VERSION_TAG/Stirling-PDF-with-login.jar" 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 curl -L -o app-security.jar https://files.stirlingpdf.com/v$VERSION_TAG/Stirling-PDF-with-login.jar

View File

@ -3,18 +3,22 @@ plugins {
} }
repositories { repositories {
maven { url = "https://build.shibboleth.net/maven/releases" } maven { url = 'https://build.shibboleth.net/maven/releases' }
maven { url = "https://maven.pkg.github.com/jcefmaven/jcefmaven" } maven { url = 'https://maven.pkg.github.com/jcefmaven/jcefmaven' }
} }
dependencies { dependencies {
if (System.getenv("STIRLING_PDF_DESKTOP_UI") != "false") { if (System.getenv('STIRLING_PDF_DESKTOP_UI') != 'false'
implementation "me.friwi:jcefmaven:132.3.1" || (project.hasProperty('STIRLING_PDF_DESKTOP_UI')
implementation "org.openjfx:javafx-controls:21" && project.getProperty('STIRLING_PDF_DESKTOP_UI') != 'false')) {
implementation "org.openjfx:javafx-swing:21" 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') implementation project(':proprietary')
} }
@ -34,9 +38,9 @@ dependencies {
implementation "org.commonmark:commonmark-ext-gfm-tables:$commonmarkVersion" implementation "org.commonmark:commonmark-ext-gfm-tables:$commonmarkVersion"
// General PDF dependencies // 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:preflight:$pdfboxVersion"
implementation ("org.apache.pdfbox:xmpbox:$pdfboxVersion") implementation "org.apache.pdfbox:xmpbox:$pdfboxVersion"
// https://mvnrepository.com/artifact/technology.tabula/tabula // https://mvnrepository.com/artifact/technology.tabula/tabula
implementation ('technology.tabula:tabula:1.0.5') { implementation ('technology.tabula:tabula:1.0.5') {
@ -45,7 +49,7 @@ dependencies {
exclude group: 'com.google.code.gson', module: 'gson' exclude group: 'com.google.code.gson', module: 'gson'
} }
implementation 'org.apache.pdfbox:jbig2-imageio:3.0.4' 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 // Batik
implementation 'org.apache.xmlgraphics:batik-all:1.18' implementation 'org.apache.xmlgraphics:batik-all:1.18'
@ -81,6 +85,7 @@ sourceSets {
jar { jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
zip64 = true
from { from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
@ -89,27 +94,12 @@ jar {
manifest { manifest {
attributes( attributes(
'Main-Class': 'stirling.software.spdf.SPDFApplication', 'Main-Class': 'stirling.software.spdf.SPDFApplication',
"Implementation-Title": "Stirling-PDF", 'Implementation-Title': 'Stirling-PDF',
"Implementation-Version": project.version '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' jar.dependsOn ':common:jar'
shadowJar.dependsOn ':common:jar'
jar.dependsOn ':proprietary:jar' jar.dependsOn ':proprietary:jar'
shadowJar.dependsOn ':proprietary:jar'

View File

@ -31,7 +31,6 @@ spring.mvc.async.request-timeout=${SYSTEM_CONNECTIONTIMEOUTMILLISECONDS:1200000}
management.endpoints.web.exposure.include=beans management.endpoints.web.exposure.include=beans
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration 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.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.driver-class-name=org.h2.Driver
spring.datasource.username=sa spring.datasource.username=sa

View File

@ -253,11 +253,11 @@
<label for="cacheInputs" th:text="#{settings.cacheInputs.name}"></label> <label for="cacheInputs" th:text="#{settings.cacheInputs.name}"></label>
</div> </div>
<a th:if="${@loginEnabled and @activeSecurity}" th:href="@{'/account'}" class="btn btn-sm btn-outline-primary" <a th:if="${@loginEnabled and !@deactivateSecurity}" th:href="@{'/account'}" class="btn btn-sm btn-outline-primary"
role="button" th:text="#{settings.accountSettings}" target="_blank">Account Settings</a> role="button" th:text="#{settings.accountSettings}" target="_blank">Account Settings</a>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a th:if="${@loginEnabled and @activeSecurity}" class="btn btn-danger" role="button" <a th:if="${@loginEnabled and !@deactivateSecurity}" class="btn btn-danger" role="button"
th:text="#{settings.signOut}" th:href="@{'/logout'}">Sign Out</a> th:text="#{settings.signOut}" th:href="@{'/logout'}">Sign Out</a>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" th:text="#{close}"></button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" th:text="#{close}"></button>
</div> </div>

View File

@ -31,7 +31,6 @@ spring.mvc.async.request-timeout=${SYSTEM_CONNECTIONTIMEOUTMILLISECONDS:1200000}
management.endpoints.web.exposure.include=beans management.endpoints.web.exposure.include=beans
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration 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.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.driver-class-name=org.h2.Driver
spring.datasource.username=sa spring.datasource.username=sa

View File

@ -253,11 +253,11 @@
<label for="cacheInputs" th:text="#{settings.cacheInputs.name}"></label> <label for="cacheInputs" th:text="#{settings.cacheInputs.name}"></label>
</div> </div>
<a th:if="${@loginEnabled and @activeSecurity}" th:href="@{'/account'}" class="btn btn-sm btn-outline-primary" <a th:if="${@loginEnabled and !@disableSecurity}" th:href="@{'/account'}" class="btn btn-sm btn-outline-primary"
role="button" th:text="#{settings.accountSettings}" target="_blank">Account Settings</a> role="button" th:text="#{settings.accountSettings}" target="_blank">Account Settings</a>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a th:if="${@loginEnabled and @activeSecurity}" class="btn btn-danger" role="button" <a th:if="${@loginEnabled and !@disableSecurity}" class="btn btn-danger" role="button"
th:text="#{settings.signOut}" th:href="@{'/logout'}">Sign Out</a> th:text="#{settings.signOut}" th:href="@{'/logout'}">Sign Out</a>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" th:text="#{close}"></button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" th:text="#{close}"></button>
</div> </div>

View File

@ -214,7 +214,7 @@ main() {
export DOCKER_CLI_EXPERIMENTAL=enabled export DOCKER_CLI_EXPERIMENTAL=enabled
export COMPOSE_DOCKER_CLI_BUILD=0 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 # Run the gradlew build command and check if it fails
if ! ./gradlew clean build; then if ! ./gradlew clean build; then
echo "Gradle build failed with security disabled, exiting script." echo "Gradle build failed with security disabled, exiting script."
@ -242,7 +242,7 @@ main() {
# run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml" # run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml"
# docker-compose -f "./exampleYmlFiles/docker-compose-latest.yml" down # 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 # Run the gradlew build command and check if it fails
if ! ./gradlew clean build; then if ! ./gradlew clean build; then
echo "Gradle build failed with security enabled, exiting script." echo "Gradle build failed with security enabled, exiting script."