Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eb7774979 | ||
|
|
10158fa408 | ||
|
|
dab6613f1b | ||
|
|
1d016df92e | ||
|
|
0631e3071c | ||
|
|
ba1b4b502c | ||
|
|
7865bf720f | ||
|
|
06abc82fbc | ||
|
|
3afacf2405 | ||
|
|
ba259a2d8d | ||
|
|
45895cd6bf |
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -37,6 +37,12 @@ jobs:
|
|||||||
java-version: ${{ matrix.jdk-version }}
|
java-version: ${{ matrix.jdk-version }}
|
||||||
distribution: "temurin"
|
distribution: "temurin"
|
||||||
|
|
||||||
|
- name: PR | Generate verification metadata with signatures and checksums for dependabot[bot]
|
||||||
|
if: github.event.pull_request.user.login == 'dependabot[bot]'
|
||||||
|
run: |
|
||||||
|
./gradlew clean dependencies buildEnvironment spotlessApply --write-verification-metadata sha256 --refresh-dependencies help
|
||||||
|
./gradlew clean dependencies buildEnvironment spotlessApply --write-verification-metadata sha256,pgp --refresh-keys --export-keys --refresh-dependencies help
|
||||||
|
|
||||||
- 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:
|
||||||
@@ -95,7 +101,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Docker Compose
|
- name: Install Docker Compose
|
||||||
run: |
|
run: |
|
||||||
sudo curl -SL "https://github.com/docker/compose/releases/download/v2.32.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
sudo curl -SL "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||||
sudo chmod +x /usr/local/bin/docker-compose
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
@@ -106,10 +112,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Pip requirements
|
- name: Pip requirements
|
||||||
run: |
|
run: |
|
||||||
pip install --require-hashes -r ./cucumber/requirements.txt
|
pip install --require-hashes -r ./testing/cucumber/requirements.txt
|
||||||
|
|
||||||
- name: Run Docker Compose Tests
|
- name: Run Docker Compose Tests
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./cucumber/test_webpages.sh
|
chmod +x ./testing/test_webpages.sh
|
||||||
chmod +x ./test.sh
|
chmod +x ./testing/test.sh
|
||||||
./test.sh
|
./testing/test.sh "${{ github.event.pull_request.user.login == 'dependabot[bot]' }}"
|
||||||
|
|||||||
4
.github/workflows/check_properties.yml
vendored
4
.github/workflows/check_properties.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Fetching PR changed files..."
|
echo "Fetching PR changed files..."
|
||||||
echo "Getting list of changed files from PR..."
|
echo "Getting list of changed files from PR..."
|
||||||
gh pr view ${{ steps.get-pr-data.outputs.pr_number }} --json files -q ".files[].path" | grep -E '^src/main/resources/messages_[a-zA-Z_]+\.properties$' > changed_files.txt # Filter only matching property files
|
gh pr view ${{ steps.get-pr-data.outputs.pr_number }} --json files -q ".files[].path" | grep -E '^src/main/resources/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}\.properties$' > changed_files.txt # Filter only matching property files
|
||||||
|
|
||||||
- name: Determine reference file test
|
- name: Determine reference file test
|
||||||
id: determine-file
|
id: determine-file
|
||||||
@@ -99,7 +99,7 @@ jobs:
|
|||||||
// Filter for relevant files based on the PR changes
|
// Filter for relevant files based on the PR changes
|
||||||
const changedFiles = files
|
const changedFiles = files
|
||||||
.map(file => file.filename)
|
.map(file => file.filename)
|
||||||
.filter(file => /^src\/main\/resources\/messages_[a-zA-Z_]+\.properties$/.test(file));
|
.filter(file => /^src\/main\/resources\/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}\.properties$/.test(file));
|
||||||
|
|
||||||
console.log("Changed files:", changedFiles);
|
console.log("Changed files:", changedFiles);
|
||||||
|
|
||||||
|
|||||||
63
.github/workflows/sync_files.yml
vendored
63
.github/workflows/sync_files.yml
vendored
@@ -1,12 +1,17 @@
|
|||||||
name: Sync Files
|
name: Sync Files
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "build.gradle"
|
- "build.gradle"
|
||||||
|
- "README.md"
|
||||||
|
- "gradle/verification-keyring.keys"
|
||||||
|
- "gradle/verification-metadata.xml"
|
||||||
- "src/main/resources/messages_*.properties"
|
- "src/main/resources/messages_*.properties"
|
||||||
|
- "src/main/resources/static/3rdPartyLicenses.json"
|
||||||
- "scripts/ignore_translation.toml"
|
- "scripts/ignore_translation.toml"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -84,21 +89,37 @@ jobs:
|
|||||||
|
|
||||||
- name: Run git add
|
- name: Run git add
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git add src/main/resources/messages_*.properties
|
||||||
git diff --staged --quiet || git commit -m ":memo: Sync translation files" || echo "no changes"
|
git diff --staged --quiet || git commit -m ":memo: Sync translation files" || echo "no changes"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install --require-hashes -r ./.github/scripts/requirements_sync_readme.txt
|
run: pip install --require-hashes -r ./.github/scripts/requirements_sync_readme.txt
|
||||||
|
|
||||||
- name: Sync README
|
- name: Sync README.md
|
||||||
run: |
|
run: |
|
||||||
python scripts/counter_translation.py
|
python scripts/counter_translation.py
|
||||||
|
|
||||||
- name: Run git add
|
- name: Run git add
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git add README.md
|
||||||
git diff --staged --quiet || git commit -m ":memo: Sync README.md" || echo "no changes"
|
git diff --staged --quiet || git commit -m ":memo: Sync README.md" || echo "no changes"
|
||||||
|
|
||||||
|
- name: Generate verification metadata with signatures and checksums
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
if [ -f ./gradle/verification-metadata.xml ]; then
|
||||||
|
rm ./gradle/verification-metadata.xml
|
||||||
|
fi
|
||||||
|
./gradlew clean dependencies buildEnvironment spotlessApply --write-verification-metadata sha256 help
|
||||||
|
./gradlew clean dependencies buildEnvironment spotlessApply --write-verification-metadata sha256,pgp --refresh-keys --export-keys --refresh-dependencies help
|
||||||
|
./gradlew clean build
|
||||||
|
|
||||||
|
- name: Run git add
|
||||||
|
run: |
|
||||||
|
git add gradle/verification-keyring.keys
|
||||||
|
git add gradle/verification-metadata.xml
|
||||||
|
git diff --staged --quiet || git commit -m ":memo: Generate verification metadata with signatures and checksums" || echo "no changes"
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
|
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
|
||||||
with:
|
with:
|
||||||
@@ -108,28 +129,42 @@ jobs:
|
|||||||
author: ${{ needs.read_bot_entries.outputs.committer }}
|
author: ${{ needs.read_bot_entries.outputs.committer }}
|
||||||
signoff: true
|
signoff: true
|
||||||
branch: sync_readme
|
branch: sync_readme
|
||||||
title: ":memo: Sync translation files + Update README.md (Translation Progress Table)"
|
title: ":globe_with_meridians: Sync Translations + Update README Progress Table + Update Verification Metadata"
|
||||||
body: |
|
body: |
|
||||||
#### Description
|
### Description of Changes
|
||||||
|
|
||||||
This Pull Request was automatically generated to synchronize updates to translation files and documentation. The changes include:
|
This Pull Request was automatically generated to synchronize updates to translation files, verification metadata, and documentation. Below are the details of the changes made:
|
||||||
|
|
||||||
1. **Synchronization of Translation Files:**
|
#### **1. Synchronization of Translation Files**
|
||||||
- Updated content based on the latest changes in `messages_en_GB.properties`.
|
- Updated translation files (`messages_*.properties`) to reflect changes in the reference file `messages_en_GB.properties`.
|
||||||
- Ensured consistency between all language files and the reference file.
|
- Ensured consistency and synchronization across all supported language files.
|
||||||
|
- Highlighted any missing or incomplete translations.
|
||||||
|
|
||||||
2. **Update README.md:**
|
#### **2. Update README.md**
|
||||||
- Generated the translation progress table.
|
- Generated the translation progress table in `README.md`.
|
||||||
- Displayed the current status of translations for all supported languages.
|
- Added a summary of the current translation status for all supported languages.
|
||||||
|
- Included up-to-date statistics on translation coverage.
|
||||||
|
|
||||||
|
#### **3. Verification Metadata Updates**
|
||||||
|
- Generated or refreshed the `verification-keyring.keys` and `verification-metadata.xml` files.
|
||||||
|
- Included the latest dependency signatures and checksums to enhance the build's integrity.
|
||||||
|
|
||||||
|
#### **Why these changes are necessary**
|
||||||
|
- Keeps translation files aligned with the latest reference updates.
|
||||||
|
- Ensures the documentation reflects the current translation progress.
|
||||||
|
- Strengthens dependency verification for a more secure build process.
|
||||||
|
|
||||||
---
|
---
|
||||||
Auto-generated by [create-pull-request][1]
|
|
||||||
|
Auto-generated by [create-pull-request][1].
|
||||||
|
|
||||||
[1]: https://github.com/peter-evans/create-pull-request
|
[1]: https://github.com/peter-evans/create-pull-request
|
||||||
draft: false
|
draft: false
|
||||||
delete-branch: true
|
delete-branch: true
|
||||||
labels: Documentation,Translation,github-actions
|
labels: github-actions
|
||||||
sign-commits: true
|
sign-commits: true
|
||||||
add-paths: |
|
add-paths: |
|
||||||
README.md
|
README.md
|
||||||
src/main/resources/messages_*.properties
|
src/main/resources/messages_*.properties
|
||||||
|
gradle/verification-keyring.keys
|
||||||
|
gradle/verification-metadata.xml
|
||||||
|
|||||||
2
.github/workflows/testdriver.yml
vendored
2
.github/workflows/testdriver.yml
vendored
@@ -122,7 +122,7 @@ jobs:
|
|||||||
Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "--load-extension=$(pwd)/node_modules/dashcam-chrome/build", "http://${{ secrets.VPS_HOST }}:1337"
|
Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "--load-extension=$(pwd)/node_modules/dashcam-chrome/build", "http://${{ secrets.VPS_HOST }}:1337"
|
||||||
Start-Sleep -Seconds 20
|
Start-Sleep -Seconds 20
|
||||||
prompt: |
|
prompt: |
|
||||||
1. /run testdriver/test.yml
|
1. /run testing/testdriver/test.yml
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
FORCE_COLOR: "3"
|
FORCE_COLOR: "3"
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,6 +25,7 @@ clientWebUI/
|
|||||||
!cucumber/
|
!cucumber/
|
||||||
!cucumber/exampleFiles/
|
!cucumber/exampleFiles/
|
||||||
!cucumber/exampleFiles/example_html.zip
|
!cucumber/exampleFiles/example_html.zip
|
||||||
|
exampleYmlFiles/stirling/
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
.gradle
|
.gradle
|
||||||
|
|||||||
@@ -25,11 +25,6 @@ repos:
|
|||||||
rev: v8.22.0
|
rev: v8.22.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: gitleaks
|
- id: gitleaks
|
||||||
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
|
||||||
rev: 3.0.0
|
|
||||||
hooks:
|
|
||||||
- id: shellcheck
|
|
||||||
files: ^.*(\.bash|\.sh|\.ksh|\.zsh)$
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v5.0.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
|
|||||||
@@ -25,7 +25,13 @@ LABEL org.opencontainers.image.keywords="PDF, manipulation, merge, split, conver
|
|||||||
# Set Environment Variables
|
# Set Environment Variables
|
||||||
ENV DOCKER_ENABLE_SECURITY=false \
|
ENV DOCKER_ENABLE_SECURITY=false \
|
||||||
VERSION_TAG=$VERSION_TAG \
|
VERSION_TAG=$VERSION_TAG \
|
||||||
JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75" \
|
JAVA_TOOL_OPTIONS="-XX:+UnlockExperimentalVMOptions \
|
||||||
|
-XX:MaxRAMPercentage=75 \
|
||||||
|
-XX:InitiatingHeapOccupancyPercent=20 \
|
||||||
|
-XX:+G1PeriodicGCInvokesConcurrent \
|
||||||
|
-XX:G1PeriodicGCInterval=10000 \
|
||||||
|
-XX:+UseStringDeduplication \
|
||||||
|
-XX:G1PeriodicGCSystemLoadThreshold=70" \
|
||||||
HOME=/home/stirlingpdfuser \
|
HOME=/home/stirlingpdfuser \
|
||||||
PUID=1000 \
|
PUID=1000 \
|
||||||
PGID=1000 \
|
PGID=1000 \
|
||||||
|
|||||||
@@ -25,7 +25,13 @@ ARG VERSION_TAG
|
|||||||
# Set Environment Variables
|
# Set Environment Variables
|
||||||
ENV DOCKER_ENABLE_SECURITY=false \
|
ENV DOCKER_ENABLE_SECURITY=false \
|
||||||
VERSION_TAG=$VERSION_TAG \
|
VERSION_TAG=$VERSION_TAG \
|
||||||
JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75" \
|
JAVA_TOOL_OPTIONS="-XX:+UnlockExperimentalVMOptions \
|
||||||
|
-XX:MaxRAMPercentage=75 \
|
||||||
|
-XX:InitiatingHeapOccupancyPercent=20 \
|
||||||
|
-XX:+G1PeriodicGCInvokesConcurrent \
|
||||||
|
-XX:G1PeriodicGCInterval=10000 \
|
||||||
|
-XX:+UseStringDeduplication \
|
||||||
|
-XX:G1PeriodicGCSystemLoadThreshold=70" \
|
||||||
HOME=/home/stirlingpdfuser \
|
HOME=/home/stirlingpdfuser \
|
||||||
PUID=1000 \
|
PUID=1000 \
|
||||||
PGID=1000 \
|
PGID=1000 \
|
||||||
|
|||||||
@@ -7,7 +7,13 @@ ARG VERSION_TAG
|
|||||||
ENV DOCKER_ENABLE_SECURITY=false \
|
ENV DOCKER_ENABLE_SECURITY=false \
|
||||||
HOME=/home/stirlingpdfuser \
|
HOME=/home/stirlingpdfuser \
|
||||||
VERSION_TAG=$VERSION_TAG \
|
VERSION_TAG=$VERSION_TAG \
|
||||||
JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75" \
|
JAVA_TOOL_OPTIONS="-XX:+UnlockExperimentalVMOptions \
|
||||||
|
-XX:MaxRAMPercentage=75 \
|
||||||
|
-XX:InitiatingHeapOccupancyPercent=20 \
|
||||||
|
-XX:+G1PeriodicGCInvokesConcurrent \
|
||||||
|
-XX:G1PeriodicGCInterval=10000 \
|
||||||
|
-XX:+UseStringDeduplication \
|
||||||
|
-XX:G1PeriodicGCSystemLoadThreshold=70" \
|
||||||
PUID=1000 \
|
PUID=1000 \
|
||||||
PGID=1000 \
|
PGID=1000 \
|
||||||
UMASK=022
|
UMASK=022
|
||||||
|
|||||||
@@ -123,12 +123,12 @@ Stirling-PDF currently supports 39 languages!
|
|||||||
| Bulgarian (Български) (bg_BG) |  |
|
| Bulgarian (Български) (bg_BG) |  |
|
||||||
| Catalan (Català) (ca_CA) |  |
|
| Catalan (Català) (ca_CA) |  |
|
||||||
| Croatian (Hrvatski) (hr_HR) |  |
|
| Croatian (Hrvatski) (hr_HR) |  |
|
||||||
| Czech (Česky) (cs_CZ) |  |
|
| Czech (Česky) (cs_CZ) |  |
|
||||||
| Danish (Dansk) (da_DK) |  |
|
| Danish (Dansk) (da_DK) |  |
|
||||||
| Dutch (Nederlands) (nl_NL) |  |
|
| Dutch (Nederlands) (nl_NL) |  |
|
||||||
| English (English) (en_GB) |  |
|
| English (English) (en_GB) |  |
|
||||||
| English (US) (en_US) |  |
|
| English (US) (en_US) |  |
|
||||||
| French (Français) (fr_FR) |  |
|
| French (Français) (fr_FR) |  |
|
||||||
| German (Deutsch) (de_DE) |  |
|
| German (Deutsch) (de_DE) |  |
|
||||||
| Greek (Ελληνικά) (el_GR) |  |
|
| Greek (Ελληνικά) (el_GR) |  |
|
||||||
| Hindi (हिंदी) (hi_IN) |  |
|
| Hindi (हिंदी) (hi_IN) |  |
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "stirling.software"
|
group = "stirling.software"
|
||||||
version = "0.38.0"
|
version = "0.39.0"
|
||||||
|
|
||||||
|
|
||||||
java {
|
java {
|
||||||
@@ -370,6 +370,8 @@ dependencies {
|
|||||||
implementation ("org.apache.pdfbox:pdfbox:$pdfboxVersion") {
|
implementation ("org.apache.pdfbox:pdfbox:$pdfboxVersion") {
|
||||||
exclude group: "commons-logging", module: "commons-logging"
|
exclude group: "commons-logging", module: "commons-logging"
|
||||||
}
|
}
|
||||||
|
implementation "org.apache.pdfbox:preflight:$pdfboxVersion"
|
||||||
|
|
||||||
|
|
||||||
implementation ("org.apache.pdfbox:xmpbox:$pdfboxVersion") {
|
implementation ("org.apache.pdfbox:xmpbox:$pdfboxVersion") {
|
||||||
exclude group: "commons-logging", module: "commons-logging"
|
exclude group: "commons-logging", module: "commons-logging"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
stirling-pdf:
|
stirling-pdf:
|
||||||
container_name: Stirling-PDF-Security-Fat
|
container_name: Stirling-PDF-Security-Fat-with-login
|
||||||
image: stirlingtools/stirling-pdf:latest-fat
|
image: stirlingtools/stirling-pdf:latest-fat
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
|
|||||||
@@ -5198,6 +5198,21 @@ BQJJZbt1AhsMBQkCAikAACEJEEEQY6Og/9EZFiEE3d7odhLp+5X1yNkeQRBjo6D/
|
|||||||
=KAHr
|
=KAHr
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
pub 436902AF59EDF60E
|
||||||
|
uid Sebastian Sampaoli <ssampaoli@equo.dev>
|
||||||
|
|
||||||
|
sub D94994D14B55169B
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
mDMEY4fp+xYJKwYBBAHaRw8BAQdArb04PVwQKvEhtUEmEu7/aASZivOWgEkZBqX0
|
||||||
|
Tovwvq+0J1NlYmFzdGlhbiBTYW1wYW9saSA8c3NhbXBhb2xpQGVxdW8uZGV2Prg4
|
||||||
|
BGOH6fsSCisGAQQBl1UBBQEBB0CSPWzZfBjKWyPW+D6RDRLFz5xlO9/30yGD/VhA
|
||||||
|
EPXybAMBCAeIfQQYFgoAJhYhBB0sfvitoPeUtYx8Y0NpAq9Z7fYOBQJjh+n7AhsM
|
||||||
|
BQkDwmcAAAoJEENpAq9Z7fYOTMMBAKfZb2ahnfGNBt8Hrbu1j99580a2IaFQddAk
|
||||||
|
xXZy2unHAPYyfxDLPkbTR7Mm4k8Cva8PCcXotDow4bDLm9rhwVkJ
|
||||||
|
=Hgs4
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
pub 4989E0E939C2999B
|
pub 4989E0E939C2999B
|
||||||
uid Scott Conway <scott@conwayfamily.name>
|
uid Scott Conway <scott@conwayfamily.name>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,6 @@ ignore = [
|
|||||||
[cs_CZ]
|
[cs_CZ]
|
||||||
ignore = [
|
ignore = [
|
||||||
'language.direction',
|
'language.direction',
|
||||||
'pipeline.header',
|
|
||||||
'text',
|
'text',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,180 @@
|
|||||||
|
package stirling.software.SPDF.controller.api;
|
||||||
|
|
||||||
|
import org.apache.pdfbox.Loader;
|
||||||
|
import org.apache.pdfbox.cos.COSName;
|
||||||
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||||
|
import org.apache.pdfbox.pdmodel.PDPage;
|
||||||
|
import org.apache.pdfbox.pdmodel.PDPageTree;
|
||||||
|
import org.apache.pdfbox.pdmodel.PDDocumentInformation;
|
||||||
|
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;
|
||||||
|
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
|
||||||
|
import org.apache.pdfbox.pdmodel.encryption.PDEncryption;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import stirling.software.SPDF.model.api.PDFFile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1/analysis")
|
||||||
|
@Tag(name = "Analysis", description = "Analysis APIs")
|
||||||
|
public class AnalysisController {
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/page-count", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get PDF page count",
|
||||||
|
description = "Returns total number of pages in PDF. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public Map<String, Integer> getPageCount(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
return Map.of("pageCount", document.getNumberOfPages());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value ="/basic-info", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get basic PDF information",
|
||||||
|
description = "Returns page count, version, file size. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public Map<String, Object> getBasicInfo(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
Map<String, Object> info = new HashMap<>();
|
||||||
|
info.put("pageCount", document.getNumberOfPages());
|
||||||
|
info.put("pdfVersion", document.getVersion());
|
||||||
|
info.put("fileSize", file.getFileInput().getSize());
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value ="/document-properties", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get PDF document properties",
|
||||||
|
description = "Returns title, author, subject, etc. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public Map<String, String> getDocumentProperties(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
PDDocumentInformation info = document.getDocumentInformation();
|
||||||
|
Map<String, String> properties = new HashMap<>();
|
||||||
|
properties.put("title", info.getTitle());
|
||||||
|
properties.put("author", info.getAuthor());
|
||||||
|
properties.put("subject", info.getSubject());
|
||||||
|
properties.put("keywords", info.getKeywords());
|
||||||
|
properties.put("creator", info.getCreator());
|
||||||
|
properties.put("producer", info.getProducer());
|
||||||
|
properties.put("creationDate", info.getCreationDate().toString());
|
||||||
|
properties.put("modificationDate", info.getModificationDate().toString());
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value ="/page-dimensions", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get page dimensions for all pages",
|
||||||
|
description = "Returns width and height of each page. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public List<Map<String, Float>> getPageDimensions(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
List<Map<String, Float>> dimensions = new ArrayList<>();
|
||||||
|
PDPageTree pages = document.getPages();
|
||||||
|
|
||||||
|
for (PDPage page : pages) {
|
||||||
|
Map<String, Float> pageDim = new HashMap<>();
|
||||||
|
pageDim.put("width", page.getBBox().getWidth());
|
||||||
|
pageDim.put("height", page.getBBox().getHeight());
|
||||||
|
dimensions.add(pageDim);
|
||||||
|
}
|
||||||
|
return dimensions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value ="/form-fields", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get form field information",
|
||||||
|
description = "Returns count and details of form fields. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public Map<String, Object> getFormFields(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
Map<String, Object> formInfo = new HashMap<>();
|
||||||
|
PDAcroForm form = document.getDocumentCatalog().getAcroForm();
|
||||||
|
|
||||||
|
if (form != null) {
|
||||||
|
formInfo.put("fieldCount", form.getFields().size());
|
||||||
|
formInfo.put("hasXFA", form.hasXFA());
|
||||||
|
formInfo.put("isSignaturesExist", form.isSignaturesExist());
|
||||||
|
} else {
|
||||||
|
formInfo.put("fieldCount", 0);
|
||||||
|
formInfo.put("hasXFA", false);
|
||||||
|
formInfo.put("isSignaturesExist", false);
|
||||||
|
}
|
||||||
|
return formInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value ="/annotation-info", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get annotation information",
|
||||||
|
description = "Returns count and types of annotations. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public Map<String, Object> getAnnotationInfo(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
Map<String, Object> annotInfo = new HashMap<>();
|
||||||
|
int totalAnnotations = 0;
|
||||||
|
Map<String, Integer> annotationTypes = new HashMap<>();
|
||||||
|
|
||||||
|
for (PDPage page : document.getPages()) {
|
||||||
|
for (PDAnnotation annot : page.getAnnotations()) {
|
||||||
|
totalAnnotations++;
|
||||||
|
String subType = annot.getSubtype();
|
||||||
|
annotationTypes.merge(subType, 1, Integer::sum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
annotInfo.put("totalCount", totalAnnotations);
|
||||||
|
annotInfo.put("typeBreakdown", annotationTypes);
|
||||||
|
return annotInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value ="/font-info", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get font information",
|
||||||
|
description = "Returns list of fonts used in the document. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public Map<String, Object> getFontInfo(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
Map<String, Object> fontInfo = new HashMap<>();
|
||||||
|
Set<String> fontNames = new HashSet<>();
|
||||||
|
|
||||||
|
for (PDPage page : document.getPages()) {
|
||||||
|
for (COSName font : page.getResources().getFontNames()) {
|
||||||
|
fontNames.add(font.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fontInfo.put("fontCount", fontNames.size());
|
||||||
|
fontInfo.put("fonts", fontNames);
|
||||||
|
return fontInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value ="/security-info", consumes = "multipart/form-data")
|
||||||
|
@Operation(summary = "Get security information",
|
||||||
|
description = "Returns encryption and permission details. Input:PDF Output:JSON Type:SISO")
|
||||||
|
public Map<String, Object> getSecurityInfo(@ModelAttribute PDFFile file) throws IOException {
|
||||||
|
try (PDDocument document = Loader.loadPDF(file.getFileInput().getBytes())) {
|
||||||
|
Map<String, Object> securityInfo = new HashMap<>();
|
||||||
|
PDEncryption encryption = document.getEncryption();
|
||||||
|
|
||||||
|
if (encryption != null) {
|
||||||
|
securityInfo.put("isEncrypted", true);
|
||||||
|
securityInfo.put("keyLength", encryption.getLength());
|
||||||
|
|
||||||
|
// Get permissions
|
||||||
|
Map<String, Boolean> permissions = new HashMap<>();
|
||||||
|
permissions.put("canPrint", document.getCurrentAccessPermission().canPrint());
|
||||||
|
permissions.put("canModify", document.getCurrentAccessPermission().canModify());
|
||||||
|
permissions.put("canExtractContent", document.getCurrentAccessPermission().canExtractContent());
|
||||||
|
permissions.put("canModifyAnnotations", document.getCurrentAccessPermission().canModifyAnnotations());
|
||||||
|
|
||||||
|
securityInfo.put("permissions", permissions);
|
||||||
|
} else {
|
||||||
|
securityInfo.put("isEncrypted", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return securityInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,7 +39,7 @@ public class MetricsAggregatorService {
|
|||||||
if (method == null || uri == null) {
|
if (method == null || uri == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!method.equals("GET") && !method.equals("POST")) {
|
if (!"GET".equals(method) && !"POST".equals(method)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Skip URIs that are 2 characters or shorter
|
// Skip URIs that are 2 characters or shorter
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -82,7 +82,7 @@ pages=Pages
|
|||||||
loading=Chargement...
|
loading=Chargement...
|
||||||
addToDoc=Ajouter au Document
|
addToDoc=Ajouter au Document
|
||||||
reset=Réinitialiser
|
reset=Réinitialiser
|
||||||
apply=Apply
|
apply=Appliquer
|
||||||
|
|
||||||
legal.privacy=Politique de Confidentialité
|
legal.privacy=Politique de Confidentialité
|
||||||
legal.terms=Conditions Générales
|
legal.terms=Conditions Générales
|
||||||
@@ -239,20 +239,20 @@ database.creationDate=Date de Création
|
|||||||
database.fileSize=Taille du Fichier
|
database.fileSize=Taille du Fichier
|
||||||
database.deleteBackupFile=Supprimer le fichier de sauvegarde
|
database.deleteBackupFile=Supprimer le fichier de sauvegarde
|
||||||
database.importBackupFile=Importer le fichier de sauvegarde
|
database.importBackupFile=Importer le fichier de sauvegarde
|
||||||
database.createBackupFile=Create Backup File
|
database.createBackupFile=Créer un fichier de sauvegarde
|
||||||
database.downloadBackupFile=Télécharger le fichier de sauvegarde
|
database.downloadBackupFile=Télécharger le fichier de sauvegarde
|
||||||
database.info_1=Lors de l'importation des données, il est crucial de garantir la structure correcte. Si vous n'êtes pas sûr de ce que vous faites, sollicitez un avis et un soutien d'un professionnel. Une erreur dans la structure peut entraîner des dysfonctionnements de l'application, allant jusqu'à l'incapacité totale d'exécuter l'application.
|
database.info_1=Lors de l'importation des données, il est crucial de garantir la structure correcte. Si vous n'êtes pas sûr de ce que vous faites, sollicitez un avis et un soutien d'un professionnel. Une erreur dans la structure peut entraîner des dysfonctionnements de l'application, allant jusqu'à l'incapacité totale d'exécuter l'application.
|
||||||
database.info_2=Le nom du fichier ne fait pas de différence lors de l'upload. Il sera renommé ultérieurement selon le format backup_user_yyyyMMddHHmm.sql, assurant ainsi une convention de nommage cohérente.
|
database.info_2=Le nom du fichier ne fait pas de différence lors de l'upload. Il sera renommé ultérieurement selon le format backup_user_yyyyMMddHHmm.sql, assurant ainsi une convention de nommage cohérente.
|
||||||
database.submit=Importer la sauvegarde
|
database.submit=Importer la sauvegarde
|
||||||
database.importIntoDatabaseSuccessed=Importation dans la base de données réussie
|
database.importIntoDatabaseSuccessed=Importation dans la base de données réussie
|
||||||
database.backupCreated=Database backup successful
|
database.backupCreated=Sauvegarde de la base de donnée réussie
|
||||||
database.fileNotFound=File not Found
|
database.fileNotFound=Fichier introuvable
|
||||||
database.fileNullOrEmpty=Fichier ne peut pas être null ou vide
|
database.fileNullOrEmpty=Fichier ne peut pas être null ou vide
|
||||||
database.failedImportFile=Failed Import File
|
database.failedImportFile=Échec de l'imporation du fichier
|
||||||
database.notSupported=This function is not available for your database connection.
|
database.notSupported=Cette fonctionnalité n'est pas supportée avec votre base de donnée
|
||||||
|
|
||||||
session.expired=Votre session a expiré. Veuillez recharger la page et réessayer.
|
session.expired=Votre session a expiré. Veuillez recharger la page et réessayer.
|
||||||
session.refreshPage=Refresh Page
|
session.refreshPage=Rafraichir la page
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# HOME-PAGE #
|
# HOME-PAGE #
|
||||||
@@ -479,8 +479,8 @@ home.autoRedact.title=Caviarder automatiquement
|
|||||||
home.autoRedact.desc=Caviardez automatiquement les informations sensibles d'un PDF.
|
home.autoRedact.desc=Caviardez automatiquement les informations sensibles d'un PDF.
|
||||||
autoRedact.tags=caviarder,redact,auto
|
autoRedact.tags=caviarder,redact,auto
|
||||||
|
|
||||||
home.redact.title=Manual Redaction
|
home.redact.title=Rédaction manuelle
|
||||||
home.redact.desc=Redacts a PDF based on selected text, drawn shapes and/or selected page(s)
|
home.redact.desc=Rédiger un PDF en fonction de texte sélectionné, formes dessinées et/ou des pages sélectionnées.
|
||||||
redact.tags=Redact,Hide,black out,black,marker,hidden,manual
|
redact.tags=Redact,Hide,black out,black,marker,hidden,manual
|
||||||
|
|
||||||
home.tableExtraxt.title=PDF en CSV
|
home.tableExtraxt.title=PDF en CSV
|
||||||
@@ -589,30 +589,30 @@ autoRedact.convertPDFToImageLabel=Convertir un PDF en PDF-Image (utilisé pour s
|
|||||||
autoRedact.submitButton=Caviarder
|
autoRedact.submitButton=Caviarder
|
||||||
|
|
||||||
#redact
|
#redact
|
||||||
redact.title=Manual Redaction
|
redact.title=Rédaction manuelle
|
||||||
redact.header=Manual Redaction
|
redact.header=Rédaction manuelle
|
||||||
redact.submit=Redact
|
redact.submit=Rédiger
|
||||||
redact.textBasedRedaction=Text based Redaction
|
redact.textBasedRedaction=Rédaction en fonction de texte
|
||||||
redact.pageBasedRedaction=Page-based Redaction
|
redact.pageBasedRedaction=Rédaction en fonction de pages
|
||||||
redact.convertPDFToImageLabel=Convert PDF to PDF-Image (Used to remove text behind the box)
|
redact.convertPDFToImageLabel=Convertir en PDF-Image (pour supprimer le texte derrière le rectangle)
|
||||||
redact.pageRedactionNumbers.title=Pages
|
redact.pageRedactionNumbers.title=Pages
|
||||||
redact.pageRedactionNumbers.placeholder=(e.g. 1,2,8 or 4,7,12-16 or 2n-1)
|
redact.pageRedactionNumbers.placeholder=(ex: 1,2,8 ou 4,7,12-16 ou 2n-1)
|
||||||
redact.redactionColor.title=Redaction Color
|
redact.redactionColor.title=Couleur
|
||||||
redact.export=Export
|
redact.export=Exporter
|
||||||
redact.upload=Upload
|
redact.upload=Téléverser
|
||||||
redact.boxRedaction=Box draw redaction
|
redact.boxRedaction=Dessiner le rectangle à rédiger
|
||||||
redact.zoom=Zoom
|
redact.zoom=Zoom
|
||||||
redact.zoomIn=Zoom in
|
redact.zoomIn=Zoom avant
|
||||||
redact.zoomOut=Zoom out
|
redact.zoomOut=Zoom arrière
|
||||||
redact.nextPage=Next Page
|
redact.nextPage=Page suivante
|
||||||
redact.previousPage=Previous Page
|
redact.previousPage=Page précédente
|
||||||
redact.toggleSidebar=Toggle Sidebar
|
redact.toggleSidebar=Toggle Sidebar
|
||||||
redact.showThumbnails=Show Thumbnails
|
redact.showThumbnails=Afficher les miniatures
|
||||||
redact.showDocumentOutline=Show Document Outline (double-click to expand/collapse all items)
|
redact.showDocumentOutline=Montrer les contours du document (double-click pour agrandir/réduire tous les éléments)
|
||||||
redact.showAttatchments=Show Attachments
|
redact.showAttatchments=Montrer les éléments attachés
|
||||||
redact.showLayers=Show Layers (double-click to reset all layers to the default state)
|
redact.showLayers=Montrer les calques (double-click pour réinitialiser tous les calques à l'état par défaut)
|
||||||
redact.colourPicker=Colour Picker
|
redact.colourPicker=Sélection de couleur
|
||||||
redact.findCurrentOutlineItem=Find current outline item
|
redact.findCurrentOutlineItem=Trouver l'élément de contour courrant
|
||||||
|
|
||||||
#showJS
|
#showJS
|
||||||
showJS.title=Afficher le JavaScript
|
showJS.title=Afficher le JavaScript
|
||||||
@@ -864,13 +864,13 @@ sign.save=Enregistrer le sceau
|
|||||||
sign.personalSigs=Sceaux personnels
|
sign.personalSigs=Sceaux personnels
|
||||||
sign.sharedSigs=Sceaux partagés
|
sign.sharedSigs=Sceaux partagés
|
||||||
sign.noSavedSigs=Aucun sceau enregistré trouvé
|
sign.noSavedSigs=Aucun sceau enregistré trouvé
|
||||||
sign.addToAll=Add to all pages
|
sign.addToAll=Ajouter à toutes les pages
|
||||||
sign.delete=Delete
|
sign.delete=Supprimer
|
||||||
sign.first=First page
|
sign.first=Première page
|
||||||
sign.last=Last page
|
sign.last=Dernière page
|
||||||
sign.next=Next page
|
sign.next=Page suivante
|
||||||
sign.previous=Previous page
|
sign.previous=Page précédente
|
||||||
sign.maintainRatio=Toggle maintain aspect ratio
|
sign.maintainRatio=Conserver les proportions
|
||||||
|
|
||||||
|
|
||||||
#repair
|
#repair
|
||||||
@@ -1011,14 +1011,14 @@ multiTool.undo=Undo
|
|||||||
multiTool.redo=Redo
|
multiTool.redo=Redo
|
||||||
|
|
||||||
#decrypt
|
#decrypt
|
||||||
decrypt.passwordPrompt=This file is password-protected. Please enter the password:
|
decrypt.passwordPrompt=Ce fichier est protégé par un mot de passe. Veuillez saisir le mot de passe :
|
||||||
decrypt.cancelled=Operation cancelled for PDF: {0}
|
decrypt.cancelled=Operation annulée pour le PDF: {0}
|
||||||
decrypt.noPassword=No password provided for encrypted PDF: {0}
|
decrypt.noPassword=Pas de mot de passe fourni pour le PDF chiffré : {0}
|
||||||
decrypt.invalidPassword=Please try again with the correct password.
|
decrypt.invalidPassword=Veuillez réessayer avec le bon mot de passe
|
||||||
decrypt.invalidPasswordHeader=Incorrect password or unsupported encryption for PDF: {0}
|
decrypt.invalidPasswordHeader=Mauvais mot de passe ou chiffrement non supporté pour le PDF : {0}
|
||||||
decrypt.unexpectedError=There was an error processing the file. Please try again.
|
decrypt.unexpectedError=Une erreur est survenue lors de traitement du fichier. Veuillez essayer de nouveau.
|
||||||
decrypt.serverError=Server error while decrypting: {0}
|
decrypt.serverError=Erreur du serveur lors du déchiffrement : {0}
|
||||||
decrypt.success=File decrypted successfully.
|
decrypt.success=Fichier déchiffré avec succès.
|
||||||
|
|
||||||
#multiTool-advert
|
#multiTool-advert
|
||||||
multiTool-advert.message=Cette fonctionnalité est aussi disponible dans la <a href="{0}">page de l'outil multifonction</a>. Allez-y pour une interface page par page améliorée et des fonctionnalités additionnelles !
|
multiTool-advert.message=Cette fonctionnalité est aussi disponible dans la <a href="{0}">page de l'outil multifonction</a>. Allez-y pour une interface page par page améliorée et des fonctionnalités additionnelles !
|
||||||
|
|||||||
@@ -873,6 +873,13 @@
|
|||||||
"moduleLicense": "Apache-2.0",
|
"moduleLicense": "Apache-2.0",
|
||||||
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"moduleName": "org.apache.pdfbox:preflight",
|
||||||
|
"moduleUrl": "https://pdfbox.apache.org",
|
||||||
|
"moduleVersion": "3.0.3",
|
||||||
|
"moduleLicense": "Apache-2.0",
|
||||||
|
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"moduleName": "org.apache.pdfbox:xmpbox",
|
"moduleName": "org.apache.pdfbox:xmpbox",
|
||||||
"moduleUrl": "https://pdfbox.apache.org",
|
"moduleUrl": "https://pdfbox.apache.org",
|
||||||
@@ -944,15 +951,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"moduleName": "org.bouncycastle:bcpkix-jdk18on",
|
"moduleName": "org.bouncycastle:bcpkix-jdk18on",
|
||||||
"moduleUrl": "https://www.bouncycastle.org/java.html",
|
"moduleUrl": "https://www.bouncycastle.org/download/bouncy-castle-java/",
|
||||||
"moduleVersion": "1.79",
|
"moduleVersion": "1.80",
|
||||||
"moduleLicense": "Bouncy Castle Licence",
|
"moduleLicense": "Bouncy Castle Licence",
|
||||||
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
|
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"moduleName": "org.bouncycastle:bcprov-jdk18on",
|
"moduleName": "org.bouncycastle:bcprov-jdk18on",
|
||||||
"moduleUrl": "https://www.bouncycastle.org/java.html",
|
"moduleUrl": "https://www.bouncycastle.org/download/bouncy-castle-java/",
|
||||||
"moduleVersion": "1.79",
|
"moduleVersion": "1.80",
|
||||||
"moduleLicense": "Bouncy Castle Licence",
|
"moduleLicense": "Bouncy Castle Licence",
|
||||||
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
|
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
|
||||||
},
|
},
|
||||||
@@ -965,8 +972,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"moduleName": "org.bouncycastle:bcutil-jdk18on",
|
"moduleName": "org.bouncycastle:bcutil-jdk18on",
|
||||||
"moduleUrl": "https://www.bouncycastle.org/java.html",
|
"moduleUrl": "https://www.bouncycastle.org/download/bouncy-castle-java/",
|
||||||
"moduleVersion": "1.79",
|
"moduleVersion": "1.80",
|
||||||
"moduleLicense": "Bouncy Castle Licence",
|
"moduleLicense": "Bouncy Castle Licence",
|
||||||
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
|
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
|
||||||
},
|
},
|
||||||
@@ -1658,7 +1665,7 @@
|
|||||||
{
|
{
|
||||||
"moduleName": "org.springframework:spring-jdbc",
|
"moduleName": "org.springframework:spring-jdbc",
|
||||||
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
||||||
"moduleVersion": "6.2.1",
|
"moduleVersion": "6.2.2",
|
||||||
"moduleLicense": "Apache License, Version 2.0",
|
"moduleLicense": "Apache License, Version 2.0",
|
||||||
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
||||||
},
|
},
|
||||||
@@ -1686,7 +1693,7 @@
|
|||||||
{
|
{
|
||||||
"moduleName": "org.springframework:spring-webmvc",
|
"moduleName": "org.springframework:spring-webmvc",
|
||||||
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
"moduleUrl": "https://github.com/spring-projects/spring-framework",
|
||||||
"moduleVersion": "6.2.1",
|
"moduleVersion": "6.2.2",
|
||||||
"moduleLicense": "Apache License, Version 2.0",
|
"moduleLicense": "Apache License, Version 2.0",
|
||||||
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<th:block th:insert="~{fragments/common :: game}"></th:block>
|
||||||
<div id="page-container">
|
<div id="page-container">
|
||||||
<div id="content-wrap">
|
<div id="content-wrap">
|
||||||
<th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
|
<th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
|
||||||
|
|||||||
@@ -1,5 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Default value for the Boolean parameter
|
||||||
|
VERIFICATION=${1:-false} # Default is "false" if no parameter is passed
|
||||||
|
|
||||||
|
# Find project root by locating build.gradle
|
||||||
|
find_root() {
|
||||||
|
local dir="$PWD"
|
||||||
|
while [[ "$dir" != "/" ]]; do
|
||||||
|
if [[ -f "$dir/build.gradle" ]]; then
|
||||||
|
echo "$dir"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
dir="$(dirname "$dir")"
|
||||||
|
done
|
||||||
|
echo "Error: build.gradle not found" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
PROJECT_ROOT=$(find_root)
|
||||||
|
|
||||||
# Function to check the health of the service with a timeout of 80 seconds
|
# Function to check the health of the service with a timeout of 80 seconds
|
||||||
check_health() {
|
check_health() {
|
||||||
local service_name=$1
|
local service_name=$1
|
||||||
@@ -64,6 +83,14 @@ run_tests() {
|
|||||||
main() {
|
main() {
|
||||||
SECONDS=0
|
SECONDS=0
|
||||||
|
|
||||||
|
cd "$PROJECT_ROOT"
|
||||||
|
|
||||||
|
# Run the gradlew build command and check if it fails
|
||||||
|
if [[ "$VERIFICATION" == "true" ]]; then
|
||||||
|
./gradlew clean dependencies buildEnvironment spotlessApply --write-verification-metadata sha256 --refresh-dependencies help
|
||||||
|
./gradlew clean dependencies buildEnvironment spotlessApply --write-verification-metadata sha256,pgp --refresh-keys --export-keys --refresh-dependencies help
|
||||||
|
fi
|
||||||
|
|
||||||
export DOCKER_ENABLE_SECURITY=false
|
export DOCKER_ENABLE_SECURITY=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
|
||||||
@@ -80,13 +107,14 @@ main() {
|
|||||||
run_tests "Stirling-PDF-Ultra-Lite" "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml"
|
run_tests "Stirling-PDF-Ultra-Lite" "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml"
|
||||||
|
|
||||||
echo "Testing webpage accessibility..."
|
echo "Testing webpage accessibility..."
|
||||||
if ./cucumber/test_webpages.sh; then
|
cd "testing"
|
||||||
passed_tests+=("Webpage-Accessibility")
|
if ./test_webpages.sh -f webpage_urls.txt -b http://localhost:8080; then
|
||||||
|
passed_tests+=("Webpage-Accessibility-lite")
|
||||||
else
|
else
|
||||||
failed_tests+=("Webpage-Accessibility")
|
failed_tests+=("Webpage-Accessibility-lite")
|
||||||
echo "Webpage accessibility tests failed"
|
echo "Webpage accessibility lite tests failed"
|
||||||
fi
|
fi
|
||||||
|
cd "$PROJECT_ROOT"
|
||||||
docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" down
|
docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" down
|
||||||
|
|
||||||
|
|
||||||
@@ -113,20 +141,38 @@ main() {
|
|||||||
# run_tests "Stirling-PDF-Security" "./exampleYmlFiles/docker-compose-latest-security.yml"
|
# run_tests "Stirling-PDF-Security" "./exampleYmlFiles/docker-compose-latest-security.yml"
|
||||||
# docker-compose -f "./exampleYmlFiles/docker-compose-latest-security.yml" down
|
# docker-compose -f "./exampleYmlFiles/docker-compose-latest-security.yml" down
|
||||||
|
|
||||||
run_tests "Stirling-PDF-Security-Fat" "./exampleYmlFiles/test_cicd.yml"
|
|
||||||
|
run_tests "Stirling-PDF-Security-Fat" "./exampleYmlFiles/docker-compose-latest-fat-security.yml"
|
||||||
|
|
||||||
|
echo "Testing webpage accessibility..."
|
||||||
|
cd "testing"
|
||||||
|
if ./test_webpages.sh -f webpage_urls_full.txt -b http://localhost:8080; then
|
||||||
|
passed_tests+=("Webpage-Accessibility-full")
|
||||||
|
else
|
||||||
|
failed_tests+=("Webpage-Accessibility-full")
|
||||||
|
echo "Webpage accessibility full tests failed"
|
||||||
|
fi
|
||||||
|
cd "$PROJECT_ROOT"
|
||||||
|
|
||||||
|
docker-compose -f "./exampleYmlFiles/docker-compose-latest-fat-security.yml" down
|
||||||
|
|
||||||
|
|
||||||
|
run_tests "Stirling-PDF-Security-Fat-with-login" "./exampleYmlFiles/test_cicd.yml"
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
cd cucumber
|
cd "testing/cucumber"
|
||||||
if python -m behave; then
|
if python -m behave; then
|
||||||
passed_tests+=("Stirling-PDF-Regression")
|
passed_tests+=("Stirling-PDF-Regression")
|
||||||
else
|
else
|
||||||
failed_tests+=("Stirling-PDF-Regression")
|
failed_tests+=("Stirling-PDF-Regression")
|
||||||
echo "Printing docker logs of failed regression"
|
echo "Printing docker logs of failed regression"
|
||||||
docker logs "Stirling-PDF-Security-Fat"
|
docker logs "Stirling-PDF-Security-Fat-with-login"
|
||||||
echo "Printed docker logs of failed regression"
|
echo "Printed docker logs of failed regression"
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd "$PROJECT_ROOT"
|
||||||
fi
|
fi
|
||||||
docker-compose -f "./exampleYmlFiles/docker-compose-latest-fat-security.yml" down
|
|
||||||
|
docker-compose -f "./exampleYmlFiles/test_cicd.yml" down
|
||||||
|
|
||||||
# Report results
|
# Report results
|
||||||
echo "All tests completed in $SECONDS seconds."
|
echo "All tests completed in $SECONDS seconds."
|
||||||
@@ -2,17 +2,16 @@
|
|||||||
|
|
||||||
# Function to check a single webpage
|
# Function to check a single webpage
|
||||||
check_webpage() {
|
check_webpage() {
|
||||||
local url=$1
|
local url=$(echo "$1" | tr -d '\r') # Remove carriage returns
|
||||||
local base_url=${2:-"http://localhost:8080"}
|
local base_url=$(echo "$2" | tr -d '\r')
|
||||||
local full_url="${base_url}${url}"
|
local full_url="${base_url}${url}"
|
||||||
local timeout=10
|
local timeout=10
|
||||||
|
|
||||||
echo -n "Testing $full_url ... "
|
echo -n "Testing $full_url ... "
|
||||||
|
|
||||||
# Use curl to fetch the page with timeout
|
# Use curl to fetch the page with timeout
|
||||||
response=$(curl -s -w "\n%{http_code}" --max-time $timeout "$full_url")
|
response=$(curl -s -w "\n%{http_code}" --max-time $timeout "$full_url")
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "FAILED - Connection error or timeout"
|
echo "FAILED - Connection error or timeout $full_url "
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -27,7 +26,7 @@ check_webpage() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if response contains HTML
|
# Check if response contains HTML
|
||||||
if ! echo "$BODY" | grep -q "<!DOCTYPE html>\|<html"; then
|
if ! printf '%s' "$BODY" | grep -q "<!DOCTYPE html>\|<html"; then
|
||||||
echo "FAILED - Response is not HTML"
|
echo "FAILED - Response is not HTML"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -46,11 +45,12 @@ test_all_urls() {
|
|||||||
|
|
||||||
echo "Starting webpage tests..."
|
echo "Starting webpage tests..."
|
||||||
echo "Base URL: $base_url"
|
echo "Base URL: $base_url"
|
||||||
|
echo "Number of lines: $(wc -l < "$url_file")"
|
||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
|
|
||||||
while IFS= read -r url || [ -n "$url" ]; do
|
while IFS= read -r url || [ -n "$url" ]; do
|
||||||
# Skip empty lines
|
# Skip empty lines and comments
|
||||||
[ -z "$url" ] && continue
|
[[ -z "$url" || "$url" =~ ^#.*$ ]] && continue
|
||||||
|
|
||||||
((total_count++))
|
((total_count++))
|
||||||
if ! check_webpage "$url" "$base_url"; then
|
if ! check_webpage "$url" "$base_url"; then
|
||||||
@@ -60,7 +60,7 @@ test_all_urls() {
|
|||||||
|
|
||||||
local end_time=$(date +%s)
|
local end_time=$(date +%s)
|
||||||
local duration=$((end_time - start_time))
|
local duration=$((end_time - start_time))
|
||||||
|
|
||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
echo "Test Summary:"
|
echo "Test Summary:"
|
||||||
echo "Total tests: $total_count"
|
echo "Total tests: $total_count"
|
||||||
@@ -71,18 +71,44 @@ test_all_urls() {
|
|||||||
return $failed_count
|
return $failed_count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Print usage information
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [-f url_file] [-b base_url]"
|
||||||
|
echo "Options:"
|
||||||
|
echo " -f url_file Path to file containing URLs to test (required)"
|
||||||
|
echo " -b base_url Base URL to prepend to test URLs (default: http://localhost:8080)"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# Main execution
|
# Main execution
|
||||||
main() {
|
main() {
|
||||||
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
local url_file=""
|
||||||
local url_file="${script_dir}/webpage_urls.txt"
|
local base_url="http://localhost:8080"
|
||||||
|
|
||||||
|
# Parse command line options
|
||||||
|
while getopts ":f:b:h" opt; do
|
||||||
|
case $opt in
|
||||||
|
f) url_file="$OPTARG" ;;
|
||||||
|
b) base_url="$OPTARG" ;;
|
||||||
|
h) usage ;;
|
||||||
|
\?) echo "Invalid option -$OPTARG" >&2; usage ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Check if URL file is provided
|
||||||
|
if [ -z "$url_file" ]; then
|
||||||
|
echo "Error: URL file is required"
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if URL file exists
|
||||||
if [ ! -f "$url_file" ]; then
|
if [ ! -f "$url_file" ]; then
|
||||||
echo "Error: URL list file not found: $url_file"
|
echo "Error: URL list file not found: $url_file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run tests using the URL list
|
# Run tests using the URL list
|
||||||
if test_all_urls "$url_file"; then
|
if test_all_urls "$url_file" "$base_url"; then
|
||||||
echo "All webpage tests passed!"
|
echo "All webpage tests passed!"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
66
testing/webpage_urls_full.txt
Normal file
66
testing/webpage_urls_full.txt
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
|
||||||
|
/
|
||||||
|
/add-image
|
||||||
|
/add-page-numbers
|
||||||
|
/add-password
|
||||||
|
/add-watermark
|
||||||
|
/adjust-contrast
|
||||||
|
/auto-redact
|
||||||
|
/auto-rename
|
||||||
|
/auto-split-pdf
|
||||||
|
/cert-sign
|
||||||
|
/change-metadata
|
||||||
|
/change-permissions
|
||||||
|
/compare
|
||||||
|
/compress-pdf
|
||||||
|
/crop
|
||||||
|
/extract-image-scans
|
||||||
|
/extract-images
|
||||||
|
/extract-page
|
||||||
|
/file-to-pdf
|
||||||
|
/flatten
|
||||||
|
/get-info-on-pdf
|
||||||
|
/html-to-pdf
|
||||||
|
/img-to-pdf
|
||||||
|
/licenses
|
||||||
|
/markdown-to-pdf
|
||||||
|
/merge-pdfs
|
||||||
|
/multi-page-layout
|
||||||
|
/multi-tool
|
||||||
|
/ocr-pdf
|
||||||
|
/overlay-pdf
|
||||||
|
/pdf-organizer
|
||||||
|
/pdf-to-csv
|
||||||
|
/pdf-to-html
|
||||||
|
/pdf-to-img
|
||||||
|
/pdf-to-markdown
|
||||||
|
/pdf-to-presentation
|
||||||
|
/pdf-to-single-page
|
||||||
|
/pdf-to-text
|
||||||
|
/pdf-to-word
|
||||||
|
/pdf-to-xml
|
||||||
|
/pipeline
|
||||||
|
/redact
|
||||||
|
/releases
|
||||||
|
/remove-annotations
|
||||||
|
/remove-blanks
|
||||||
|
/remove-cert-sign
|
||||||
|
/remove-image-pdf
|
||||||
|
/remove-pages
|
||||||
|
/remove-password
|
||||||
|
/repair
|
||||||
|
/replace-and-invert-color-pdf
|
||||||
|
/rotate-pdf
|
||||||
|
/sanitize-pdf
|
||||||
|
/scale-pages
|
||||||
|
/show-javascript
|
||||||
|
/sign
|
||||||
|
/split-by-size-or-count
|
||||||
|
/split-pdf-by-chapters
|
||||||
|
/split-pdf-by-sections
|
||||||
|
/split-pdfs
|
||||||
|
/stamp
|
||||||
|
/url-to-pdf
|
||||||
|
/validate-signature
|
||||||
|
/view-pdf
|
||||||
|
/swagger-ui/index.html
|
||||||
Reference in New Issue
Block a user