diff --git a/Dockerfile-fat b/Dockerfile-fat index 04183bf4..f0b7bc6b 100644 --- a/Dockerfile-fat +++ b/Dockerfile-fat @@ -12,7 +12,7 @@ RUN DOCKER_ENABLE_SECURITY=true \ ./gradlew clean build # Main stage -FROM alpine:3.20 +FROM alpine:3.20.3 # Copy necessary files COPY scripts /scripts @@ -40,7 +40,6 @@ RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /et echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" | tee -a /etc/apk/repositories && \ apk upgrade --no-cache -a && \ apk add --no-cache \ - calibre@testing \ ca-certificates \ tzdata \ tini \ @@ -65,9 +64,7 @@ RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /et python3 \ py3-pip && \ # uno unoconv and HTML - apk add --no-cache gcc g++ make musl-dev linux-headers python3-dev && \ - pip install --break-system-packages --no-cache-dir --upgrade unoconv PyQt6-sip==13.8.0 WeasyPrint pdf2image pillow && \ - apk del gcc g++ make musl-dev linux-headers python3-dev && \ + pip install --break-system-packages --no-cache-dir --upgrade unoconv WeasyPrint pdf2image pillow && \ mv /usr/share/tessdata /usr/share/tessdata-original && \ mkdir -p $HOME /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders && \ fc-cache -f -v && \ diff --git a/exampleYmlFiles/docker-compose-latest-fat-security.yml b/exampleYmlFiles/docker-compose-latest-fat-security.yml index 8a98513f..44d5ebef 100644 --- a/exampleYmlFiles/docker-compose-latest-fat-security.yml +++ b/exampleYmlFiles/docker-compose-latest-fat-security.yml @@ -30,5 +30,4 @@ services: SYSTEM_MAXFILESIZE: "100" METRICS_ENABLED: "true" SYSTEM_GOOGLEVISIBILITY: "true" - INSTALL_BOOK_AND_ADVANCED_HTML_OPS: "true" restart: on-failure:5 diff --git a/scripts/init-without-ocr.sh b/scripts/init-without-ocr.sh index 593c4c63..49218f76 100644 --- a/scripts/init-without-ocr.sh +++ b/scripts/init-without-ocr.sh @@ -12,8 +12,8 @@ fi umask "$UMASK" || true if [[ "$INSTALL_BOOK_AND_ADVANCED_HTML_OPS" == "true" && "$FAT_DOCKER" != "true" ]]; then - #echo "issue with calibre in current version, feature currently disabled on Stirling-PDF" - apk add --no-cache calibre@testing + echo "issue with calibre in current version, feature currently disabled on Stirling-PDF" + #apk add --no-cache calibre@testing fi if [[ "$FAT_DOCKER" != "true" ]]; then diff --git a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertBookToPDFController.java b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertBookToPDFController.java index 05bcbe55..778aab04 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertBookToPDFController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertBookToPDFController.java @@ -5,22 +5,19 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import io.github.pixee.security.Filenames; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import stirling.software.SPDF.model.api.GeneralFile; import stirling.software.SPDF.service.CustomPDDocumentFactory; import stirling.software.SPDF.utils.FileToPdf; import stirling.software.SPDF.utils.WebResponseUtils; -@RestController -@Tag(name = "Convert", description = "Convert APIs") -@RequestMapping("/api/v1/convert") +// @RestController +// @Tag(name = "Convert", description = "Convert APIs") +// @RequestMapping("/api/v1/convert") public class ConvertBookToPDFController { private final boolean bookAndHtmlFormatsInstalled; diff --git a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertPDFToBookController.java b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertPDFToBookController.java index c8b9dd4d..f1c672e1 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertPDFToBookController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertPDFToBookController.java @@ -11,22 +11,19 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import io.github.pixee.security.Filenames; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import stirling.software.SPDF.model.api.converters.PdfToBookRequest; import stirling.software.SPDF.utils.ProcessExecutor; import stirling.software.SPDF.utils.ProcessExecutor.ProcessExecutorResult; import stirling.software.SPDF.utils.WebResponseUtils; -@RestController -@Tag(name = "Convert", description = "Convert APIs") -@RequestMapping("/api/v1/convert") +// @RestController +// @Tag(name = "Convert", description = "Convert APIs") +// @RequestMapping("/api/v1/convert") public class ConvertPDFToBookController { @Autowired diff --git a/test.sh b/test.sh index 36cfeb11..872c071c 100644 --- a/test.sh +++ b/test.sh @@ -73,16 +73,16 @@ main() { # Building Docker images - docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest -f ./Dockerfile . - docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest-ultra-lite -f ./Dockerfile-ultra-lite . + # docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest -f ./Dockerfile . + # docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest-ultra-lite -f ./Dockerfile-ultra-lite . # Test each configuration - run_tests "Stirling-PDF-Ultra-Lite" "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" - docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" down + #run_tests "Stirling-PDF-Ultra-Lite" "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" + #docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" down - run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml" - docker-compose -f "./exampleYmlFiles/docker-compose-latest.yml" down + # run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml" + #docker-compose -f "./exampleYmlFiles/docker-compose-latest.yml" down export DOCKER_ENABLE_SECURITY=true # Run the gradlew build command and check if it fails @@ -93,16 +93,16 @@ main() { # Building Docker images with security enabled - docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest -f ./Dockerfile . - docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest-ultra-lite -f ./Dockerfile-ultra-lite . + # docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest -f ./Dockerfile . + # docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest-ultra-lite -f ./Dockerfile-ultra-lite . docker build --no-cache --pull --build-arg VERSION_TAG=alpha -t frooodle/s-pdf:latest-fat -f ./Dockerfile-fat . # Test each configuration with security - run_tests "Stirling-PDF-Ultra-Lite-Security" "./exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml" - docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml" down - run_tests "Stirling-PDF-Security" "./exampleYmlFiles/docker-compose-latest-security.yml" - docker-compose -f "./exampleYmlFiles/docker-compose-latest-security.yml" down + # run_tests "Stirling-PDF-Ultra-Lite-Security" "./exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml" + #docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml" down + # run_tests "Stirling-PDF-Security" "./exampleYmlFiles/docker-compose-latest-security.yml" +# docker-compose -f "./exampleYmlFiles/docker-compose-latest-security.yml" down run_tests "Stirling-PDF-Security-Fat" "./exampleYmlFiles/docker-compose-latest-fat-security.yml" if [ $? -eq 0 ]; then