Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eb7774979 | ||
|
|
10158fa408 | ||
|
|
dab6613f1b | ||
|
|
1d016df92e | ||
|
|
0631e3071c | ||
|
|
ba1b4b502c | ||
|
|
7865bf720f | ||
|
|
06abc82fbc | ||
|
|
3afacf2405 | ||
|
|
ba259a2d8d | ||
|
|
45895cd6bf | ||
|
|
66d0ad5071 | ||
|
|
c5ae576541 | ||
|
|
2bcdd8cce6 | ||
|
|
c96765f962 | ||
|
|
3830c7d1f3 | ||
|
|
05add001fb | ||
|
|
abc3ff3529 |
51
.github/scripts/check_duplicates.py
vendored
51
.github/scripts/check_duplicates.py
vendored
@@ -1,51 +0,0 @@
|
|||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def find_duplicate_keys(file_path):
|
|
||||||
"""
|
|
||||||
Finds duplicate keys in a properties file and returns their occurrences.
|
|
||||||
|
|
||||||
This function reads a properties file, identifies any keys that occur more than
|
|
||||||
once, and returns a dictionary with these keys and the line numbers of their occurrences.
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
file_path (str): The path to the properties file to be checked.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
dict: A dictionary where each key is a duplicated key in the file, and the value is a list
|
|
||||||
of line numbers where the key occurs.
|
|
||||||
"""
|
|
||||||
with open(file_path, "r", encoding="utf-8") as file:
|
|
||||||
lines = file.readlines()
|
|
||||||
|
|
||||||
keys = {}
|
|
||||||
duplicates = {}
|
|
||||||
|
|
||||||
for line_number, line in enumerate(lines, start=1):
|
|
||||||
line = line.strip()
|
|
||||||
if line and not line.startswith("#") and "=" in line:
|
|
||||||
key = line.split("=", 1)[0].strip()
|
|
||||||
if key in keys:
|
|
||||||
# If the key already exists, add the current line number
|
|
||||||
duplicates.setdefault(key, []).append(line_number)
|
|
||||||
# Also add the first instance of the key if not already done
|
|
||||||
if keys[key] not in duplicates[key]:
|
|
||||||
duplicates[key].insert(0, keys[key])
|
|
||||||
else:
|
|
||||||
# Store the line number of the first instance of the key
|
|
||||||
keys[key] = line_number
|
|
||||||
|
|
||||||
return duplicates
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
failed = False
|
|
||||||
for ar in sys.argv[1:]:
|
|
||||||
duplicates = find_duplicate_keys(ar)
|
|
||||||
if duplicates:
|
|
||||||
for key, lines in duplicates.items():
|
|
||||||
lines_str = ", ".join(map(str, lines))
|
|
||||||
print(f"{key} duplicated in {ar} on lines {lines_str}")
|
|
||||||
failed = True
|
|
||||||
if failed:
|
|
||||||
sys.exit(1)
|
|
||||||
85
.github/scripts/check_tabulator.py
vendored
85
.github/scripts/check_tabulator.py
vendored
@@ -1,85 +0,0 @@
|
|||||||
"""check_tabulator.py"""
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def check_tabs(file_path):
|
|
||||||
"""
|
|
||||||
Checks for tabs in the specified file.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
file_path (str): The path to the file to be checked.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
bool: True if tabs are found, False otherwise.
|
|
||||||
"""
|
|
||||||
with open(file_path, "r", encoding="utf-8") as file:
|
|
||||||
content = file.read()
|
|
||||||
|
|
||||||
if "\t" in content:
|
|
||||||
print(f"Tab found in {file_path}")
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def replace_tabs_with_spaces(file_path, replace_with=" "):
|
|
||||||
"""
|
|
||||||
Replaces tabs with a specified number of spaces in the file.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
file_path (str): The path to the file where tabs will be replaced.
|
|
||||||
replace_with (str): The character(s) to replace tabs with. Defaults to two spaces.
|
|
||||||
"""
|
|
||||||
with open(file_path, "r", encoding="utf-8") as file:
|
|
||||||
content = file.read()
|
|
||||||
|
|
||||||
updated_content = content.replace("\t", replace_with)
|
|
||||||
|
|
||||||
with open(file_path, "w", encoding="utf-8") as file:
|
|
||||||
file.write(updated_content)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
"""
|
|
||||||
Main function to replace tabs with spaces in the provided files.
|
|
||||||
The replacement character and files to check are taken from command line arguments.
|
|
||||||
"""
|
|
||||||
# Create ArgumentParser instance
|
|
||||||
parser = argparse.ArgumentParser(
|
|
||||||
description="Replace tabs in files with specified characters."
|
|
||||||
)
|
|
||||||
|
|
||||||
# Define optional argument `--replace_with`
|
|
||||||
parser.add_argument(
|
|
||||||
"--replace_with",
|
|
||||||
default=" ",
|
|
||||||
help="Character(s) to replace tabs with. Default is two spaces.",
|
|
||||||
)
|
|
||||||
|
|
||||||
# Define argument for file paths
|
|
||||||
parser.add_argument("files", metavar="FILE", nargs="+", help="Files to process.")
|
|
||||||
|
|
||||||
# Parse arguments
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
# Extract replacement characters and files from the parsed arguments
|
|
||||||
replace_with = args.replace_with
|
|
||||||
files_checked = args.files
|
|
||||||
|
|
||||||
error = False
|
|
||||||
|
|
||||||
for file_path in files_checked:
|
|
||||||
if check_tabs(file_path):
|
|
||||||
replace_tabs_with_spaces(file_path, replace_with)
|
|
||||||
error = True
|
|
||||||
|
|
||||||
if error:
|
|
||||||
print("Error: Originally found tabs in HTML files, now replaced.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
6
.github/workflows/PR-Demo-Comment.yml
vendored
6
.github/workflows/PR-Demo-Comment.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKER_HUB_API }}
|
password: ${{ secrets.DOCKER_HUB_API }}
|
||||||
|
|
||||||
- name: Build and push PR-specific image
|
- name: Build and push PR-specific image
|
||||||
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
|
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
2
.github/workflows/PR-Demo-cleanup.yml
vendored
2
.github/workflows/PR-Demo-cleanup.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/auto-labeler.yml
vendored
2
.github/workflows/auto-labeler.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -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:
|
||||||
@@ -77,7 +83,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -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]' }}"
|
||||||
|
|||||||
6
.github/workflows/check_properties.yml
vendored
6
.github/workflows/check_properties.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/dependency-review.yml
vendored
2
.github/workflows/dependency-review.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/licenses-update.yml
vendored
2
.github/workflows/licenses-update.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/manage-label.yml
vendored
2
.github/workflows/manage-label.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
12
.github/workflows/multiOSReleases.yml
vendored
12
.github/workflows/multiOSReleases.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
versionMac: ${{ steps.versionNumberMac.outputs.versionNumberMac }}
|
versionMac: ${{ steps.versionNumberMac.outputs.versionNumberMac }}
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
file_suffix: ""
|
file_suffix: ""
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
file_suffix: ""
|
file_suffix: ""
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
42
.github/workflows/pre_commit.yml
vendored
42
.github/workflows/pre_commit.yml
vendored
@@ -2,23 +2,41 @@ name: Pre-commit
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * 1"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pre-commit:
|
pre-commit:
|
||||||
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
- name: Generate GitHub App Token
|
||||||
|
id: generate-token
|
||||||
|
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.GH_APP_ID }}
|
||||||
|
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Get GitHub App User ID
|
||||||
|
id: get-user-id
|
||||||
|
run: echo "user-id=$(gh api "/users/${{ steps.generate-token.outputs.app-slug }}[bot]" --jq .id)" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
|
|
||||||
|
- id: committer
|
||||||
|
run: |
|
||||||
|
echo "string=${{ steps.generate-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.generate-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
with:
|
with:
|
||||||
@@ -35,25 +53,25 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Set up git config
|
- name: Set up git config
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name ${{ steps.generate-token.outputs.app-slug }}[bot]
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "${{ steps.get-user-id.outputs.user-id }}+${{ steps.generate-token.outputs.app-slug }}[bot]@users.noreply.github.com"
|
||||||
- name: git add
|
- name: git add
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git add .
|
||||||
git diff --staged --quiet || git commit -m ":file_folder: pre-commit
|
git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
|
||||||
> Made via .github/workflows/pre_commit.yml" || echo "pre-commit: no changes"
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
|
if: env.CHANGES_DETECTED == 'true'
|
||||||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
|
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
commit-message: "ci: 🤖 format everything with pre-commit"
|
commit-message: ":file_folder: pre-commit"
|
||||||
committer: GitHub Action <action@github.com>
|
committer: ${{ steps.committer.outputs.string }}
|
||||||
author: GitHub Action <action@github.com>
|
author: ${{ steps.committer.outputs.string }}
|
||||||
signoff: true
|
signoff: true
|
||||||
branch: pre-commit
|
branch: pre-commit
|
||||||
title: "🤖 format everything with pre-commit by <github-actions[bot]>"
|
title: "🤖 format everything with pre-commit by <${{ steps.generate-token.outputs.app-slug }}>"
|
||||||
body: |
|
body: |
|
||||||
Auto-generated by [create-pull-request][1]
|
Auto-generated by [create-pull-request][1] with **${{ steps.generate-token.outputs.app-slug }}**
|
||||||
|
|
||||||
[1]: https://github.com/peter-evans/create-pull-request
|
[1]: https://github.com/peter-evans/create-pull-request
|
||||||
draft: false
|
draft: false
|
||||||
|
|||||||
8
.github/workflows/push-docker.yml
vendored
8
.github/workflows/push-docker.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push main Dockerfile
|
- name: Build and push main Dockerfile
|
||||||
id: build-push-regular
|
id: build-push-regular
|
||||||
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
|
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: .
|
context: .
|
||||||
@@ -134,7 +134,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push Dockerfile-ultra-lite
|
- name: Build and push Dockerfile-ultra-lite
|
||||||
id: build-push-lite
|
id: build-push-lite
|
||||||
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
|
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -165,7 +165,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push main Dockerfile fat
|
- name: Build and push main Dockerfile fat
|
||||||
id: build-push-fat
|
id: build-push-fat
|
||||||
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
|
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
|||||||
6
.github/workflows/releaseArtifacts.yml
vendored
6
.github/workflows/releaseArtifacts.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
version: ${{ steps.versionNumber.outputs.versionNumber }}
|
version: ${{ steps.versionNumber.outputs.versionNumber }}
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
file_suffix: ""
|
file_suffix: ""
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ jobs:
|
|||||||
file_suffix: ""
|
file_suffix: ""
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/scorecards.yml
vendored
2
.github/workflows/scorecards.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/swagger.yml
vendored
2
.github/workflows/swagger.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
67
.github/workflows/sync_files.yml
vendored
67
.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:
|
||||||
@@ -21,7 +26,7 @@ jobs:
|
|||||||
committer: ${{ steps.committer.outputs.committer }}
|
committer: ${{ steps.committer.outputs.committer }}
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -54,7 +59,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|||||||
10
.github/workflows/testdriver.yml
vendored
10
.github/workflows/testdriver.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKER_HUB_API }}
|
password: ${{ secrets.DOCKER_HUB_API }}
|
||||||
|
|
||||||
- name: Build and push test image
|
- name: Build and push test image
|
||||||
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
|
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -105,7 +105,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -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"
|
||||||
@@ -134,7 +134,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
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
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ repos:
|
|||||||
args:
|
args:
|
||||||
- --fix
|
- --fix
|
||||||
- --line-length=127
|
- --line-length=127
|
||||||
files: ^((.github/scripts|scripts)/.+)?[^/]+\.py$
|
files: ^((\.github/scripts|scripts)/.+)?[^/]+\.py$
|
||||||
exclude: (split_photos.py)
|
exclude: (split_photos.py)
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
files: ^((.github/scripts|scripts)/.+)?[^/]+\.py$
|
files: ^((\.github/scripts|scripts)/.+)?[^/]+\.py$
|
||||||
exclude: (split_photos.py)
|
exclude: (split_photos.py)
|
||||||
- repo: https://github.com/codespell-project/codespell
|
- repo: https://github.com/codespell-project/codespell
|
||||||
rev: v2.3.0
|
rev: v2.3.0
|
||||||
@@ -19,39 +19,18 @@ repos:
|
|||||||
- --ignore-words-list=
|
- --ignore-words-list=
|
||||||
- --skip="./.*,*.csv,*.json,*.ambr"
|
- --skip="./.*,*.csv,*.json,*.ambr"
|
||||||
- --quiet-level=2
|
- --quiet-level=2
|
||||||
files: \.(properties|html|css|js|py|md)$
|
files: \.(html|css|js|py|md)$
|
||||||
exclude: (.vscode|.devcontainer|src/main/resources|Dockerfile|.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js)
|
exclude: (.vscode|.devcontainer|src/main/resources|Dockerfile|.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js)
|
||||||
- repo: https://github.com/gitleaks/gitleaks
|
- repo: https://github.com/gitleaks/gitleaks
|
||||||
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:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
files: ^.*(\.js|\.java|\.py|\.yml)$
|
files: ^.*(\.js|\.java|\.py|\.yml)$
|
||||||
exclude: ^(.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js$)
|
exclude: ^(.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js|\.github/workflows/.*$)
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
files: ^.*(\.js|\.java|\.py|\.yml)$
|
files: ^.*(\.js|\.java|\.py|\.yml)$
|
||||||
exclude: ^(.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js$)
|
exclude: ^(.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js|\.github/workflows/.*$)
|
||||||
|
|
||||||
- repo: local
|
|
||||||
hooks:
|
|
||||||
- id: check-duplicate-properties-keys
|
|
||||||
name: Check Duplicate Properties Keys
|
|
||||||
entry: python .github/scripts/check_duplicates.py
|
|
||||||
language: python
|
|
||||||
files: ^(src)/.+\.properties$
|
|
||||||
- id: check-html-tabs
|
|
||||||
name: Check HTML for tabs
|
|
||||||
description: Ensures HTML/CSS/JS files do not contain tab characters
|
|
||||||
# args: ["--replace_with= "]
|
|
||||||
entry: python .github/scripts/check_tabulator.py
|
|
||||||
language: python
|
|
||||||
exclude: ^(.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js$)
|
|
||||||
files: ^.*(\.html|\.css|\.js)$
|
|
||||||
|
|||||||
@@ -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) |  |
|
||||||
|
|||||||
10
build.gradle
10
build.gradle
@@ -19,13 +19,13 @@ ext {
|
|||||||
logbackVersion = "1.5.7"
|
logbackVersion = "1.5.7"
|
||||||
imageioVersion = "3.12.0"
|
imageioVersion = "3.12.0"
|
||||||
lombokVersion = "1.18.36"
|
lombokVersion = "1.18.36"
|
||||||
bouncycastleVersion = "1.79"
|
bouncycastleVersion = "1.80"
|
||||||
springSecuritySamlVersion = "6.4.2"
|
springSecuritySamlVersion = "6.4.2"
|
||||||
openSamlVersion = "4.3.2"
|
openSamlVersion = "4.3.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "stirling.software"
|
group = "stirling.software"
|
||||||
version = "0.38.0"
|
version = "0.39.0"
|
||||||
|
|
||||||
|
|
||||||
java {
|
java {
|
||||||
@@ -291,7 +291,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//security updates
|
//security updates
|
||||||
implementation "org.springframework:spring-webmvc:6.2.1"
|
implementation "org.springframework:spring-webmvc:6.2.2"
|
||||||
|
|
||||||
implementation("io.github.pixee:java-security-toolkit:1.2.1")
|
implementation("io.github.pixee:java-security-toolkit:1.2.1")
|
||||||
|
|
||||||
@@ -314,7 +314,7 @@ dependencies {
|
|||||||
implementation "org.springframework.boot:spring-boot-starter-oauth2-client:$springBootVersion"
|
implementation "org.springframework.boot:spring-boot-starter-oauth2-client:$springBootVersion"
|
||||||
|
|
||||||
implementation "org.springframework.session:spring-session-core:$springBootVersion"
|
implementation "org.springframework.session:spring-session-core:$springBootVersion"
|
||||||
implementation "org.springframework:spring-jdbc:6.2.1"
|
implementation "org.springframework:spring-jdbc:6.2.2"
|
||||||
|
|
||||||
implementation 'com.unboundid.product.scim2:scim2-sdk-client:2.3.5'
|
implementation 'com.unboundid.product.scim2:scim2-sdk-client:2.3.5'
|
||||||
// Don't upgrade h2database
|
// Don't upgrade h2database
|
||||||
@@ -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
@@ -75,7 +75,7 @@ def write_readme(progress_list: list[tuple[str, int]]) -> None:
|
|||||||
f"",
|
f"",
|
||||||
)
|
)
|
||||||
|
|
||||||
with open("README.md", "w", encoding="utf-8") as file:
|
with open("README.md", "w", encoding="utf-8", newline="\n") as file:
|
||||||
file.writelines(content)
|
file.writelines(content)
|
||||||
|
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ def compare_files(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
ignore_translation = convert_to_multiline(sort_ignore_translation)
|
ignore_translation = convert_to_multiline(sort_ignore_translation)
|
||||||
with open(ignore_translation_file, "w", encoding="utf-8") as file:
|
with open(ignore_translation_file, "w", encoding="utf-8", newline="\n") as file:
|
||||||
file.write(tomlkit.dumps(ignore_translation))
|
file.write(tomlkit.dumps(ignore_translation))
|
||||||
|
|
||||||
unique_data = list(set(result_list))
|
unique_data = list(set(result_list))
|
||||||
|
|||||||
@@ -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