diff --git a/.github/workflows/push-docker.yml b/.github/workflows/push-docker.yml index 329d69cf..50d03bcc 100644 --- a/.github/workflows/push-docker.yml +++ b/.github/workflows/push-docker.yml @@ -22,7 +22,7 @@ jobs: - uses: gradle/gradle-build-action@v2.4.2 env: - ENABLE_SECURITY: false + DOCKER_ENABLE_SECURITY: false with: gradle-version: 7.6 arguments: clean build diff --git a/.github/workflows/releaseArtifacts.yml b/.github/workflows/releaseArtifacts.yml index ae8f5c59..f57aacd4 100644 --- a/.github/workflows/releaseArtifacts.yml +++ b/.github/workflows/releaseArtifacts.yml @@ -30,7 +30,7 @@ jobs: - name: Generate jar (With Security=${{ matrix.enable_security }}) run: ./gradlew clean createExe env: - ENABLE_SECURITY: ${{ matrix.enable_security }} + DOCKER_ENABLE_SECURITY: ${{ matrix.enable_security }} - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 diff --git a/Dockerfile b/Dockerfile index e9d1a149..6b17228e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM frooodle/stirling-pdf-base:beta4 ARG VERSION_TAG ENV VERSION_TAG=$VERSION_TAG -ENV ENABLE_SECURITY=false +ENV DOCKER_ENABLE_SECURITY=false # Create scripts folder and copy local scripts RUN mkdir /scripts diff --git a/Dockerfile-lite b/Dockerfile-lite index c75e5571..0f3fcb5f 100644 --- a/Dockerfile-lite +++ b/Dockerfile-lite @@ -20,7 +20,7 @@ EXPOSE 8080 # Set environment variables ENV GROUPS_TO_REMOVE=Python,OpenCV,OCRmyPDF -ENV ENABLE_SECURITY=false +ENV DOCKER_ENABLE_SECURITY=false # Run the application CMD ["java", "-jar", "/app.jar"] diff --git a/Dockerfile-ultra-lite b/Dockerfile-ultra-lite index be08689f..04e58c42 100644 --- a/Dockerfile-ultra-lite +++ b/Dockerfile-ultra-lite @@ -11,7 +11,7 @@ EXPOSE 8080 # Set environment variables ENV GROUPS_TO_REMOVE=CLI -ENV ENABLE_SECURITY=false +ENV DOCKER_ENABLE_SECURITY=false # Run the application CMD ["java", "-jar", "/app.jar"] diff --git a/build.gradle b/build.gradle index 97616561..c2b5532e 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ repositories { sourceSets { main { java { - if (System.getenv('ENABLE_SECURITY') == 'false') { + if (System.getenv('DOCKER_ENABLE_SECURITY') == 'false') { exclude 'stirling/software/SPDF/config/security/**' exclude 'stirling/software/SPDF/controller/api/UserController.java' exclude 'stirling/software/SPDF/controller/web/AccountWebController.java' @@ -67,7 +67,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web:3.1.2' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.1.2' - if (System.getenv('ENABLE_SECURITY') != 'false') { + if (System.getenv('DOCKER_ENABLE_SECURITY') != 'false') { implementation 'org.springframework.boot:spring-boot-starter-security:3.1.2' implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:3.1.2.RELEASE' implementation "org.springframework.boot:spring-boot-starter-data-jpa" diff --git a/scripts/init.sh b/scripts/init.sh index 336c3526..a9b2af11 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -16,8 +16,8 @@ if [[ -n "$TESSERACT_LANGS" ]]; then done fi -# Check for ENABLE_SECURITY and download the appropriate JAR if required -if [ "$ENABLE_SECURITY" = "true" ] && [ "$VERSION_TAG" != "alpha" ]; then +# Check for DOCKER_ENABLE_SECURITY and download the appropriate JAR if required +if [ "$DOCKER_ENABLE_SECURITY" = "true" ] && [ "$VERSION_TAG" != "alpha" ]; then echo "Downloading from: https://github.com/Frooodle/Stirling-PDF/releases/download/$VERSION_TAG/Stirling-PDF-with-login.jar" curl -L -o new-app.jar https://github.com/Frooodle/Stirling-PDF/releases/download/$VERSION_TAG/Stirling-PDF-with-login.jar if [ $? -eq 0 ]; then # checks if curl was successful diff --git a/src/main/resources/static/js/darkmode.js b/src/main/resources/static/js/darkmode.js index 9139e801..fe239583 100644 --- a/src/main/resources/static/js/darkmode.js +++ b/src/main/resources/static/js/darkmode.js @@ -19,7 +19,7 @@ function setMode(mode) { elements.lightModeStyles.disabled = mode !== "off"; elements.darkModeStyles.disabled = mode !== "on"; elements.rainbowModeStyles.disabled = mode !== "rainbow"; - + var jumbotron = document.getElementById('jumbotron'); if (mode === "on") { elements.darkModeIcon.src = "moon.svg"; // Add the table-dark class to tables for dark mode @@ -27,6 +27,10 @@ function setMode(mode) { tables.forEach(table => { table.classList.add('table-dark'); }); + if(jumbotron) { + jumbotron.classList.add('bg-dark'); + jumbotron.classList.remove('bg-light'); + } } else if (mode === "off") { elements.darkModeIcon.src = "sun.svg"; // Remove the table-dark class for light mode @@ -34,6 +38,11 @@ function setMode(mode) { tables.forEach(table => { table.classList.remove('table-dark'); }); + if(jumbotron){ + console.log(mode) + jumbotron.classList.remove('bg-dark'); + jumbotron.classList.add('bg-light'); + } } else if (mode === "rainbow") { elements.darkModeIcon.src = "rainbow.svg"; } @@ -71,7 +80,7 @@ document.addEventListener("DOMContentLoaded", function() { } else { setMode("off"); } - + document.getElementById("dark-mode-toggle").addEventListener("click", function(event) { event.preventDefault(); toggleDarkMode(); diff --git a/src/main/resources/templates/fragments/common.html b/src/main/resources/templates/fragments/common.html index f20edf79..36ee712a 100644 --- a/src/main/resources/templates/fragments/common.html +++ b/src/main/resources/templates/fragments/common.html @@ -51,8 +51,6 @@ - - diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html index d54b198e..009445e8 100644 --- a/src/main/resources/templates/fragments/navbar.html +++ b/src/main/resources/templates/fragments/navbar.html @@ -5,7 +5,7 @@ const currentVersion = /*[[${@appVersion}]]*/ ''; const noFavourites = /*[[#{noFavourites}]]*/ ''; - + diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html index 69a9230e..dcea42b8 100644 --- a/src/main/resources/templates/home.html +++ b/src/main/resources/templates/home.html @@ -12,7 +12,7 @@
-
+

diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index c2dfec9a..be819cd4 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -59,17 +59,17 @@ body {
-
+

Stirling-PDF

Please sign in

-
-
diff --git a/src/main/resources/templates/other/change-metadata.html b/src/main/resources/templates/other/change-metadata.html index ccb6fb0b..2db40ed2 100644 --- a/src/main/resources/templates/other/change-metadata.html +++ b/src/main/resources/templates/other/change-metadata.html @@ -13,7 +13,7 @@

- +

diff --git a/src/main/resources/templates/other/compress-pdf.html b/src/main/resources/templates/other/compress-pdf.html index 50c2b5cc..99612271 100644 --- a/src/main/resources/templates/other/compress-pdf.html +++ b/src/main/resources/templates/other/compress-pdf.html @@ -15,7 +15,7 @@

- +
diff --git a/src/main/resources/templates/other/ocr-pdf.html b/src/main/resources/templates/other/ocr-pdf.html index a7fece4b..52836b9e 100644 --- a/src/main/resources/templates/other/ocr-pdf.html +++ b/src/main/resources/templates/other/ocr-pdf.html @@ -38,7 +38,7 @@

- +