more rename

This commit is contained in:
Ludy87 2025-07-12 19:11:05 +02:00
parent bbbd7a0682
commit 8ed82557df
No known key found for this signature in database
GPG Key ID: 92696155E0220F94
18 changed files with 119 additions and 119 deletions

14
.gitattributes vendored
View File

@ -1,10 +1,10 @@
* text=auto eol=lf
# Ignore all JavaScript files in a directory
stirling-pdf/src/main/resources/static/pdfjs/* linguist-vendored
stirling-pdf/src/main/resources/static/pdfjs/** linguist-vendored
stirling-pdf/src/main/resources/static/pdfjs-legacy/* linguist-vendored
stirling-pdf/src/main/resources/static/pdfjs-legacy/** linguist-vendored
stirling-pdf/src/main/resources/static/css/bootstrap-icons.css linguist-vendored
stirling-pdf/src/main/resources/static/css/bootstrap.min.css linguist-vendored
stirling-pdf/src/main/resources/static/css/fonts/* linguist-vendored
core/src/main/resources/static/pdfjs/* linguist-vendored
core/src/main/resources/static/pdfjs/** linguist-vendored
core/src/main/resources/static/pdfjs-legacy/* linguist-vendored
core/src/main/resources/static/pdfjs-legacy/** linguist-vendored
core/src/main/resources/static/css/bootstrap-icons.css linguist-vendored
core/src/main/resources/static/css/bootstrap.min.css linguist-vendored
core/src/main/resources/static/css/fonts/* linguist-vendored

View File

@ -36,34 +36,34 @@ labels:
- label: 'Translation'
files:
- 'stirling-pdf/src/main/resources/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}.properties'
- 'core/src/main/resources/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}.properties'
- 'scripts/ignore_translation.toml'
- 'stirling-pdf/src/main/resources/templates/fragments/languages.html'
- 'core/src/main/resources/templates/fragments/languages.html'
- '.github/scripts/check_language_properties.py'
- label: 'Front End'
files:
- 'stirling-pdf/src/main/resources/templates/.*'
- 'core/src/main/resources/templates/.*'
- 'proprietary/src/main/resources/templates/.*'
- 'stirling-pdf/src/main/resources/static/.*'
- 'core/src/main/resources/static/.*'
- 'proprietary/src/main/resources/static/.*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/web/.*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/UI/.*'
- 'core/src/main/java/stirling/software/SPDF/controller/web/.*'
- 'core/src/main/java/stirling/software/SPDF/UI/.*'
- 'proprietary/src/main/java/stirling/software/proprietary/security/controller/web/.*'
- label: 'Java'
files:
- 'common/src/main/java/.*.java'
- 'proprietary/src/main/java/.*.java'
- 'stirling-pdf/src/main/java/.*.java'
- 'core/src/main/java/.*.java'
- label: 'Back End'
files:
- 'stirling-pdf/src/main/java/stirling/software/SPDF/config/.*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/.*'
- 'stirling-pdf/src/main/resources/settings.yml.template'
- 'stirling-pdf/src/main/resources/application.properties'
- 'stirling-pdf/src/main/resources/banner.txt'
- 'core/src/main/java/stirling/software/SPDF/config/.*'
- 'core/src/main/java/stirling/software/SPDF/controller/.*'
- 'core/src/main/resources/settings.yml.template'
- 'core/src/main/resources/application.properties'
- 'core/src/main/resources/banner.txt'
- 'scripts/png_to_webp.py'
- 'split_photos.py'
- 'application.properties'
@ -77,10 +77,10 @@ labels:
- label: 'API'
files:
- 'stirling-pdf/src/main/java/stirling/software/SPDF/config/OpenApiConfig.java'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/web/MetricsController.java'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/api/.*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/model/api/.*'
- 'core/src/main/java/stirling/software/SPDF/config/OpenApiConfig.java'
- 'core/src/main/java/stirling/software/SPDF/controller/web/MetricsController.java'
- 'core/src/main/java/stirling/software/SPDF/controller/api/.*'
- 'core/src/main/java/stirling/software/SPDF/model/api/.*'
- 'proprietary/src/main/java/stirling/software/proprietary/security/controller/api/.*'
- 'scripts/png_to_webp.py'
- 'split_photos.py'
@ -121,7 +121,7 @@ labels:
files:
- 'common/src/test/.*'
- 'proprietary/src/test/.*'
- 'stirling-pdf/src/test/.*'
- 'core/src/test/.*'
- 'testing/.*'
- '.github/workflows/scorecards.yml'
- 'exampleYmlFiles/test_cicd.yml'
@ -139,4 +139,4 @@ labels:
- 'build.gradle'
- 'common/build.gradle'
- 'proprietary/build.gradle'
- 'stirling-pdf/build.gradle'
- 'core/build.gradle'

View File

@ -197,7 +197,7 @@ def check_for_differences(reference_file, file_list, branch, actor):
if len(file_list) == 1:
file_arr = file_list[0].split()
base_dir = os.path.abspath(
os.path.join(os.getcwd(), "stirling-pdf", "src", "main", "resources")
os.path.join(os.getcwd(), "core", "src", "main", "resources")
)
for file_path in file_arr:
@ -219,13 +219,13 @@ def check_for_differences(reference_file, file_list, branch, actor):
# only local windows command
not file_normpath.startswith(
os.path.join(
"", "stirling-pdf", "src", "main", "resources", "messages_"
"", "core", "src", "main", "resources", "messages_"
)
)
and not file_normpath.startswith(
os.path.join(
os.getcwd(),
"stirling-pdf",
"core",
"src",
"main",
"resources",
@ -389,7 +389,7 @@ if __name__ == "__main__":
file_list = glob.glob(
os.path.join(
os.getcwd(),
"stirling-pdf",
"core",
"src",
"main",
"resources",

View File

@ -4,7 +4,7 @@ on:
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- "stirling-pdf/src/main/resources/messages_*.properties"
- "core/src/main/resources/messages_*.properties"
permissions:
contents: read # Allow read access to repository content
@ -67,7 +67,7 @@ jobs:
exit 1
fi
# Get changed files and filter for properties files, handle case where no matches are found
gh pr view ${{ steps.get-pr-data.outputs.pr_number }} --json files -q ".files[].path" | grep -E '^stirling-pdf/src/main/resources/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}\.properties$' > changed_files.txt || echo "No matching properties files found in PR"
gh pr view ${{ steps.get-pr-data.outputs.pr_number }} --json files -q ".files[].path" | grep -E '^core/src/main/resources/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}\.properties$' > changed_files.txt || echo "No matching properties files found in PR"
# Check if any files were found
if [ ! -s changed_files.txt ]; then
echo "No properties files changed in this PR"
@ -117,7 +117,7 @@ jobs:
const changedFiles = files
.filter(file =>
file.status !== "removed" &&
/^stirling-pdf\/src\/main\/resources\/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}\.properties$/.test(file.filename)
/^core\/src\/main\/resources\/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}\.properties$/.test(file.filename)
)
.map(file => file.filename);
@ -157,12 +157,12 @@ jobs:
// Determine reference file
let referenceFilePath;
if (changedFiles.includes("stirling-pdf/src/main/resources/messages_en_GB.properties")) {
if (changedFiles.includes("core/src/main/resources/messages_en_GB.properties")) {
console.log("Using PR branch reference file.");
const { data: fileContent } = await github.rest.repos.getContent({
owner: prRepoOwner,
repo: prRepoName,
path: "stirling-pdf/src/main/resources/messages_en_GB.properties",
path: "core/src/main/resources/messages_en_GB.properties",
ref: branch,
});
@ -174,7 +174,7 @@ jobs:
const { data: fileContent } = await github.rest.repos.getContent({
owner: repoOwner,
repo: repoName,
path: "stirling-pdf/src/main/resources/messages_en_GB.properties",
path: "core/src/main/resources/messages_en_GB.properties",
ref: "main",
});

View File

@ -57,11 +57,11 @@ jobs:
- name: Move and rename license file
run: |
mv build/reports/dependency-license/index.json stirling-pdf/src/main/resources/static/3rdPartyLicenses.json
mv build/reports/dependency-license/index.json core/src/main/resources/static/3rdPartyLicenses.json
- name: Commit changes
run: |
git add stirling-pdf/src/main/resources/static/3rdPartyLicenses.json
git add core/src/main/resources/static/3rdPartyLicenses.json
git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
- name: Create Pull Request

View File

@ -86,7 +86,7 @@ jobs:
run: |
mkdir ./binaries
mv ./build/launch4j/Stirling-PDF.exe ./binaries/win-Stirling-PDF-portable-Server${{ matrix.file_suffix }}.exe
mv ./stirling-pdf/build/libs/stirling-pdf-${{ needs.read_versions.outputs.version }}.jar ./binaries/Stirling-PDF${{ matrix.file_suffix }}.jar
mv ./core/build/libs/stirling-pdf-${{ needs.read_versions.outputs.version }}.jar ./binaries/Stirling-PDF${{ matrix.file_suffix }}.jar
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

View File

@ -4,8 +4,8 @@ FROM alpine:3.22.0@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be02
# Copy necessary files
COPY scripts /scripts
COPY pipeline /pipeline
COPY stirling-pdf/src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
COPY stirling-pdf/build/libs/*.jar app.jar
COPY core/src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
COPY core/build/libs/*.jar app.jar
ARG VERSION_TAG
@ -34,10 +34,10 @@ ENV DISABLE_ADDITIONAL_FEATURES=true \
UNO_PATH=/usr/lib/libreoffice/program \
URE_BOOTSTRAP=file:///usr/lib/libreoffice/program/fundamentalrc \
PATH=$PATH:/opt/venv/bin \
STIRLING_TEMPFILES_DIRECTORY=/tmp/stirling-pdf \
TMPDIR=/tmp/stirling-pdf \
TEMP=/tmp/stirling-pdf \
TMP=/tmp/stirling-pdf
STIRLING_TEMPFILES_DIRECTORY=/tmp/core \
TMPDIR=/tmp/core \
TEMP=/tmp/core \
TMP=/tmp/core
# JDK for app
@ -85,7 +85,7 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
ln -s /usr/lib/libreoffice/program/unohelper.py /opt/venv/lib/python3.12/site-packages/ && \
ln -s /usr/lib/libreoffice/program /opt/venv/lib/python3.12/site-packages/LibreOffice && \
mv /usr/share/tessdata /usr/share/tessdata-original && \
mkdir -p $HOME /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders /tmp/stirling-pdf && \
mkdir -p $HOME /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders /tmp/core && \
# Configure URW Base 35 fonts
ln -s /usr/share/fontconfig/conf.avail/69-urw-*.conf /etc/fonts/conf.d/ && \
fc-cache -f -v && \
@ -93,11 +93,11 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
chmod +x /scripts/init.sh && \
# User permissions
addgroup -S stirlingpdfgroup && adduser -S stirlingpdfuser -G stirlingpdfgroup && \
chown -R stirlingpdfuser:stirlingpdfgroup $HOME /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/stirling-pdf && \
chown -R stirlingpdfuser:stirlingpdfgroup $HOME /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/core && \
chown stirlingpdfuser:stirlingpdfgroup /app.jar
EXPOSE 8080/tcp
# Set user and run command
ENTRYPOINT ["tini", "--", "/scripts/init.sh"]
CMD ["sh", "-c", "java -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/tmp/stirling-pdf -jar /app.jar & /opt/venv/bin/unoserver --port 2003 --interface 127.0.0.1"]
CMD ["sh", "-c", "java -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/tmp/core -jar /app.jar & /opt/venv/bin/unoserver --port 2003 --interface 127.0.0.1"]

View File

@ -28,10 +28,10 @@ RUN apt-get update && apt-get install -y \
# Setze die Environment Variable für setuptools
ENV SETUPTOOLS_USE_DISTUTILS=local \
STIRLING_TEMPFILES_DIRECTORY=/tmp/stirling-pdf \
TMPDIR=/tmp/stirling-pdf \
TEMP=/tmp/stirling-pdf \
TMP=/tmp/stirling-pdf
STIRLING_TEMPFILES_DIRECTORY=/tmp/core \
TMPDIR=/tmp/core \
TEMP=/tmp/core \
TMP=/tmp/core
# Installation der benötigten Python-Pakete
RUN python3 -m venv --system-site-packages /opt/venv \
@ -44,10 +44,10 @@ ENV PATH="/opt/venv/bin:$PATH"
COPY . /workspace
RUN mkdir -p /tmp/stirling-pdf \
RUN mkdir -p /tmp/core \
&& fc-cache -f -v \
&& adduser --disabled-password --gecos '' devuser \
&& chown -R devuser:devuser /home/devuser /workspace /tmp/stirling-pdf
&& chown -R devuser:devuser /home/devuser /workspace /tmp/core
RUN echo "devuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/devuser \
&& chmod 0440 /etc/sudoers.d/devuser

View File

@ -5,7 +5,7 @@ COPY build.gradle .
COPY settings.gradle .
COPY gradlew .
COPY gradle gradle/
COPY stirling-pdf/build.gradle stirling-pdf/.
COPY core/build.gradle core/.
COPY common/build.gradle common/.
COPY proprietary/build.gradle proprietary/.
RUN ./gradlew build -x spotlessApply -x spotlessCheck -x test -x sonarqube || return 0
@ -27,8 +27,8 @@ FROM alpine:3.22.0@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be02
# Copy necessary files
COPY scripts /scripts
COPY pipeline /pipeline
COPY stirling-pdf/src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
COPY --from=build /app/stirling-pdf/build/libs/*.jar app.jar
COPY core/src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
COPY --from=build /app/core/build/libs/*.jar app.jar
ARG VERSION_TAG
@ -47,10 +47,10 @@ ENV DISABLE_ADDITIONAL_FEATURES=true \
UNO_PATH=/usr/lib/libreoffice/program \
URE_BOOTSTRAP=file:///usr/lib/libreoffice/program/fundamentalrc \
PATH=$PATH:/opt/venv/bin \
STIRLING_TEMPFILES_DIRECTORY=/tmp/stirling-pdf \
TMPDIR=/tmp/stirling-pdf \
TEMP=/tmp/stirling-pdf \
TMP=/tmp/stirling-pdf
STIRLING_TEMPFILES_DIRECTORY=/tmp/core \
TMPDIR=/tmp/core \
TEMP=/tmp/core \
TMP=/tmp/core
# JDK for app
@ -97,7 +97,7 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
ln -s /usr/lib/libreoffice/program/unohelper.py /opt/venv/lib/python3.12/site-packages/ && \
ln -s /usr/lib/libreoffice/program /opt/venv/lib/python3.12/site-packages/LibreOffice && \
mv /usr/share/tessdata /usr/share/tessdata-original && \
mkdir -p $HOME /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders /tmp/stirling-pdf && \
mkdir -p $HOME /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders /tmp/core && \
# Configure URW Base 35 fonts
ln -s /usr/share/fontconfig/conf.avail/69-urw-*.conf /etc/fonts/conf.d/ && \
fc-cache -f -v && \
@ -105,10 +105,10 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
chmod +x /scripts/init.sh && \
# User permissions
addgroup -S stirlingpdfgroup && adduser -S stirlingpdfuser -G stirlingpdfgroup && \
chown -R stirlingpdfuser:stirlingpdfgroup $HOME /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/stirling-pdf && \
chown -R stirlingpdfuser:stirlingpdfgroup $HOME /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/core && \
chown stirlingpdfuser:stirlingpdfgroup /app.jar
EXPOSE 8080/tcp
# Set user and run command
ENTRYPOINT ["tini", "--", "/scripts/init.sh"]
CMD ["sh", "-c", "java -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/tmp/stirling-pdf -jar /app.jar & /opt/venv/bin/unoserver --port 2003 --interface 127.0.0.1"]
CMD ["sh", "-c", "java -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/tmp/core -jar /app.jar & /opt/venv/bin/unoserver --port 2003 --interface 127.0.0.1"]

View File

@ -12,17 +12,17 @@ ENV DISABLE_ADDITIONAL_FEATURES=true \
PUID=1000 \
PGID=1000 \
UMASK=022 \
STIRLING_TEMPFILES_DIRECTORY=/tmp/stirling-pdf \
TMPDIR=/tmp/stirling-pdf \
TEMP=/tmp/stirling-pdf \
TMP=/tmp/stirling-pdf
STIRLING_TEMPFILES_DIRECTORY=/tmp/core \
TMPDIR=/tmp/core \
TEMP=/tmp/core \
TMP=/tmp/core
# Copy necessary files
COPY scripts/download-security-jar.sh /scripts/download-security-jar.sh
COPY scripts/init-without-ocr.sh /scripts/init-without-ocr.sh
COPY scripts/installFonts.sh /scripts/installFonts.sh
COPY pipeline /pipeline
COPY stirling-pdf/build/libs/*.jar app.jar
COPY core/build/libs/*.jar app.jar
# Set up necessary directories and permissions
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/apk/repositories && \
@ -39,10 +39,10 @@ RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /et
su-exec \
openjdk21-jre && \
# User permissions
mkdir -p /configs /logs /customFiles /usr/share/fonts/opentype/noto /tmp/stirling-pdf && \
mkdir -p /configs /logs /customFiles /usr/share/fonts/opentype/noto /tmp/core && \
chmod +x /scripts/*.sh && \
addgroup -S stirlingpdfgroup && adduser -S stirlingpdfuser -G stirlingpdfgroup && \
chown -R stirlingpdfuser:stirlingpdfgroup $HOME /scripts /configs /customFiles /pipeline /tmp/stirling-pdf && \
chown -R stirlingpdfuser:stirlingpdfgroup $HOME /scripts /configs /customFiles /pipeline /tmp/core && \
chown stirlingpdfuser:stirlingpdfgroup /app.jar
# Set environment variables
@ -52,4 +52,4 @@ EXPOSE 8080/tcp
# Run the application
ENTRYPOINT ["tini", "--", "/scripts/init-without-ocr.sh"]
CMD ["java", "-Dfile.encoding=UTF-8", "-Djava.io.tmpdir=/tmp/stirling-pdf", "-jar", "/app.jar"]
CMD ["java", "-Dfile.encoding=UTF-8", "-Djava.io.tmpdir=/tmp/core", "-jar", "/app.jar"]

View File

@ -228,14 +228,14 @@ static def getMacVersion(String version) {
jpackage {
dependsOn(":stirling-pdf:bootJar")
input = layout.projectDirectory.dir("stirling-pdf/build/libs")
input = layout.projectDirectory.dir("core/build/libs")
destination = layout.projectDirectory.dir("build/jpackage")
mainJar = "Stirling-PDF-${project.version}.jar"
appName = "Stirling PDF"
appVersion = project.version
vendor = "Stirling PDF Inc"
appDescription = "Stirling PDF - Your Local PDF Editor"
icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.ico")
icon = layout.projectDirectory.file("core/src/main/resources/static/favicon.ico")
verbose = true
// mainClass = "org.springframework.boot.loader.launch.JarLauncher"
@ -277,7 +277,7 @@ jpackage {
// MacOS-specific configuration
mac {
appVersion = getMacVersion(project.version.toString())
icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.icns")
icon = layout.projectDirectory.file("core/src/main/resources/static/favicon.icns")
type = ImageType.DMG
macPackageIdentifier = "Stirling PDF"
macPackageName = "Stirling PDF"
@ -299,7 +299,7 @@ jpackage {
// Linux-specific configuration
linux {
appVersion = project.version
icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.png")
icon = layout.projectDirectory.file("core/src/main/resources/static/favicon.png")
type = ImageType.DEB // Can also use "rpm" for Red Hat-based systems
// Debian package configuration
@ -371,12 +371,12 @@ tasks.register('jpackageMacX64') {
commandLine 'jpackage',
'--type', 'dmg',
'--name', 'Stirling PDF (x86_64)',
'--input', 'stirling-pdf/build/libs',
'--input', 'core/build/libs',
'--main-jar', "Stirling-PDF-${project.version}.jar",
'--main-class', 'org.springframework.boot.loader.launch.JarLauncher',
'--runtime-image', file(jrePath + "/zulu-17.jre/Contents/Home"),
'--dest', 'build/jpackage/x86_64',
'--icon', 'stirling-pdf/src/main/resources/static/favicon.icns',
'--icon', 'core/src/main/resources/static/favicon.icns',
'--app-version', getMacVersion(project.version.toString()),
'--mac-package-name', 'Stirling PDF (x86_64)',
'--mac-package-identifier', 'Stirling PDF (x86_64)',
@ -462,7 +462,7 @@ tasks.register('cleanTempJre') {
}
launch4j {
icon = "${projectDir}/stirling-pdf/src/main/resources/static/favicon.ico"
icon = "${projectDir}/core/src/main/resources/static/favicon.ico"
outfile="Stirling-PDF.exe"

4
core/.gitignore vendored
View File

@ -124,7 +124,7 @@ SwaggerDoc.json
*.rar
*.db
/build/*
/stirling-pdf/build/*
/core/build/*
# Byte-compiled / optimized / DLL files
__pycache__/
@ -193,4 +193,4 @@ id_ed25519.pub
**/jcef-bundle/
# node_modules
node_modules/
node_modules/

View File

@ -332,7 +332,7 @@ Thymeleaf is a server-side Java HTML template engine. It is used in Stirling-PDF
### Thymeleaf overview
In Stirling-PDF, Thymeleaf is used to create HTML templates that are rendered on the server side. These templates are located in the `stirling-pdf/src/main/resources/templates` directory. Thymeleaf templates use a combination of HTML and special Thymeleaf attributes to dynamically generate content.
In Stirling-PDF, Thymeleaf is used to create HTML templates that are rendered on the server side. These templates are located in the `core/src/main/resources/templates` directory. Thymeleaf templates use a combination of HTML and special Thymeleaf attributes to dynamically generate content.
Some examples of this are:
@ -384,7 +384,7 @@ This would generate n entries of tr for each person in exampleData
### Adding a New Feature to the Backend (API)
1. **Create a New Controller:**
- Create a new Java class in the `stirling-pdf/src/main/java/stirling/software/SPDF/controller/api` directory.
- Create a new Java class in the `core/src/main/java/stirling/software/SPDF/controller/api` directory.
- Annotate the class with `@RestController` and `@RequestMapping` to define the API endpoint.
- Ensure to add API documentation annotations like `@Tag(name = "General", description = "General APIs")` and `@Operation(summary = "Crops a PDF document", description = "This operation takes an input PDF file and crops it according to the given coordinates. Input:PDF Output:PDF Type:SISO")`.
@ -411,7 +411,7 @@ This would generate n entries of tr for each person in exampleData
```
2. **Define the Service Layer:** (Not required but often useful)
- Create a new service class in the `stirling-pdf/src/main/java/stirling/software/SPDF/service` directory.
- Create a new service class in the `core/src/main/java/stirling/software/SPDF/service` directory.
- Implement the business logic for the new feature.
```java
@ -463,7 +463,7 @@ This would generate n entries of tr for each person in exampleData
### Adding a New Feature to the Frontend (UI)
1. **Create a New Thymeleaf Template:**
- Create a new HTML file in the `stirling-pdf/src/main/resources/templates` directory.
- Create a new HTML file in the `core/src/main/resources/templates` directory.
- Use Thymeleaf attributes to dynamically generate content.
- Use `extract-page.html` as a base example for the HTML template, which is useful to ensure importing of the general layout, navbar, and footer.
@ -507,7 +507,7 @@ This would generate n entries of tr for each person in exampleData
```
2. **Create a New Controller for the UI:**
- Create a new Java class in the `stirling-pdf/src/main/java/stirling/software/SPDF/controller/ui` directory.
- Create a new Java class in the `core/src/main/java/stirling/software/SPDF/controller/ui` directory.
- Annotate the class with `@Controller` and `@RequestMapping` to define the UI endpoint.
```java
@ -537,7 +537,7 @@ This would generate n entries of tr for each person in exampleData
3. **Update the Navigation Bar:**
- Add a link to the new feature page in the navigation bar.
- Update the `stirling-pdf/src/main/resources/templates/fragments/navbar.html` file.
- Update the `core/src/main/resources/templates/fragments/navbar.html` file.
```html
<li class="nav-item">
@ -551,7 +551,7 @@ When adding a new feature or modifying existing ones in Stirling-PDF, you'll nee
### 1. Locate Existing Language Files
Find the existing `messages.properties` files in the `stirling-pdf/src/main/resources` directory. You'll see files like:
Find the existing `messages.properties` files in the `core/src/main/resources` directory. You'll see files like:
- `messages.properties` (default, usually English)
- `messages_en_GB.properties`

View File

@ -10,7 +10,7 @@ Fork Stirling-PDF and create a new branch out of `main`.
Then add a reference to the language in the navbar by adding a new language entry to the dropdown:
- Edit the file: [languages.html](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/stirling-pdf/src/main/resources/templates/fragments/languages.html)
- Edit the file: [languages.html](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/core/src/main/resources/templates/fragments/languages.html)
For example, to add Polish, you would add:
@ -25,7 +25,7 @@ The `data-bs-language-code` is the code used to reference the file in the next s
Start by copying the existing English property file:
- [messages_en_GB.properties](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/stirling-pdf/src/main/resources/messages_en_GB.properties)
- [messages_en_GB.properties](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/core/src/main/resources/messages_en_GB.properties)
Copy and rename it to `messages_{your data-bs-language-code here}.properties`. In the Polish example, you would set the name to `messages_pl_PL.properties`.
@ -62,15 +62,15 @@ Make sure to place the entry under the correct language section. This helps main
#### Windows command
```powershell
python .github/scripts/check_language_properties.py --reference-file stirling-pdf\src\main\resources\messages_en_GB.properties --branch "" --files stirling-pdf\src\main\resources\messages_pl_PL.properties
python .github/scripts/check_language_properties.py --reference-file core\src\main\resources\messages_en_GB.properties --branch "" --files core\src\main\resources\messages_pl_PL.properties
python .github/scripts/check_language_properties.py --reference-file stirling-pdf\src\main\resources\messages_en_GB.properties --branch "" --check-file stirling-pdf\src\main\resources\messages_pl_PL.properties
python .github/scripts/check_language_properties.py --reference-file core\src\main\resources\messages_en_GB.properties --branch "" --check-file core\src\main\resources\messages_pl_PL.properties
```
#### Linux command
```bash
python3 .github/scripts/check_language_properties.py --reference-file stirling-pdf/src/main/resources/messages_en_GB.properties --branch "" --files stirling-pdf/src/main/resources/messages_pl_PL.properties
python3 .github/scripts/check_language_properties.py --reference-file core/src/main/resources/messages_en_GB.properties --branch "" --files core/src/main/resources/messages_pl_PL.properties
python3 .github/scripts/check_language_properties.py --reference-file stirling-pdf/src/main/resources/messages_en_GB.properties --branch "" --check-file stirling-pdf/src/main/resources/messages_pl_PL.properties
python3 .github/scripts/check_language_properties.py --reference-file core/src/main/resources/messages_en_GB.properties --branch "" --check-file core/src/main/resources/messages_pl_PL.properties
```

View File

@ -207,7 +207,7 @@ def compare_files(
if __name__ == "__main__":
directory = os.path.join(os.getcwd(), "stirling-pdf", "src", "main", "resources")
directory = os.path.join(os.getcwd(), "core", "src", "main", "resources")
messages_file_paths = glob.glob(os.path.join(directory, "messages_*.properties"))
reference_file = os.path.join(directory, "messages_en_GB.properties")

View File

@ -20,7 +20,7 @@ if [[ "$INSTALL_BOOK_AND_ADVANCED_HTML_OPS" == "true" && "$FAT_DOCKER" != "true"
fi
if [[ "$FAT_DOCKER" != "true" ]]; then
/scripts/download-security-jar.sh
/scripts/download-security-jar.sh
fi
if [[ -n "$LANGS" ]]; then
@ -29,10 +29,10 @@ fi
echo "Setting permissions and ownership for necessary directories..."
# Ensure temp directory exists and has correct permissions
mkdir -p /tmp/stirling-pdf || true
mkdir -p /tmp/core || true
# Attempt to change ownership of directories and files
if chown -R stirlingpdfuser:stirlingpdfgroup $HOME /logs /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/stirling-pdf /app.jar; then
chmod -R 755 /logs /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/stirling-pdf /app.jar || true
if chown -R stirlingpdfuser:stirlingpdfgroup $HOME /logs /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/core /app.jar; then
chmod -R 755 /logs /scripts /usr/share/fonts/opentype/noto /configs /customFiles /pipeline /tmp/core /app.jar || true
# If chown succeeds, execute the command as stirlingpdfuser
exec su-exec stirlingpdfuser "$@"
else

View File

@ -29,8 +29,8 @@ if [[ -n "$TESSERACT_LANGS" ]]; then
fi
# Ensure temp directory exists with correct permissions before running main init
mkdir -p /tmp/stirling-pdf || true
chown -R stirlingpdfuser:stirlingpdfgroup /tmp/stirling-pdf || true
chmod -R 755 /tmp/stirling-pdf || true
mkdir -p /tmp/core || true
chown -R stirlingpdfuser:stirlingpdfgroup /tmp/core || true
chmod -R 755 /tmp/core || true
/scripts/init-without-ocr.sh "$@"
/scripts/init-without-ocr.sh "$@"

View File

@ -56,11 +56,11 @@ capture_file_list() {
-not -path '/logs/*' \
-not -path '*/home/stirlingpdfuser/.config/libreoffice/*' \
-not -path '*/home/stirlingpdfuser/.pdfbox.cache' \
-not -path '*/tmp/stirling-pdf/PDFBox*' \
-not -path '*/tmp/stirling-pdf/hsperfdata_stirlingpdfuser/*' \
-not -path '*/tmp/core/PDFBox*' \
-not -path '*/tmp/core/hsperfdata_stirlingpdfuser/*' \
-not -path '*/tmp/hsperfdata_stirlingpdfuser/*' \
-not -path '*/tmp/stirling-pdf/lu*' \
-not -path '*/tmp/stirling-pdf/tmp*' \
-not -path '*/tmp/core/lu*' \
-not -path '*/tmp/core/tmp*' \
2>/dev/null | xargs -I{} sh -c 'stat -c \"%n %s %Y\" \"{}\" 2>/dev/null || true' | sort" > "$output_file"
# Check if the output file has content
@ -79,7 +79,7 @@ capture_file_list() {
-not -path '*/home/stirlingpdfuser/.pdfbox.cache' \
-not -path '*/tmp/PDFBox*' \
-not -path '*/tmp/hsperfdata_stirlingpdfuser/*' \
-not -path '*/tmp/stirling-pdf/hsperfdata_stirlingpdfuser/*' \
-not -path '*/tmp/core/hsperfdata_stirlingpdfuser/*' \
-not -path '*/tmp/lu*' \
-not -path '*/tmp/tmp*' \
2>/dev/null | sort" > "$output_file"
@ -182,17 +182,17 @@ get_expected_version() {
verify_app_version() {
local service_name=$1
local base_url=$2
echo "Checking version for $service_name (expecting $EXPECTED_VERSION)..."
# Try to access the homepage and extract the version
local response
response=$(curl -s "$base_url")
# Extract version from pixel tracking tag
local actual_version
actual_version=$(echo "$response" | grep -o 'appVersion=[0-9.]*' | head -1 | sed 's/appVersion=//')
# If we couldn't find the version in the pixel tag, try other approaches
if [ -z "$actual_version" ]; then
# Check for "App Version:" format
@ -203,7 +203,7 @@ verify_app_version() {
return 1
fi
fi
# Check if the extracted version matches expected version
if [ "$actual_version" = "$EXPECTED_VERSION" ]; then
echo "✅ Version verification passed: $actual_version"
@ -264,13 +264,13 @@ main() {
export DOCKER_CLI_EXPERIMENTAL=enabled
export COMPOSE_DOCKER_CLI_BUILD=0
export DISABLE_ADDITIONAL_FEATURES=true
# Run the gradlew build command and check if it fails
if ! ./gradlew clean build; then
echo "Gradle build failed with security disabled, exiting script."
exit 1
fi
# Get expected version after the build to ensure version.properties is created
echo "Getting expected version from Gradle..."
EXPECTED_VERSION=$(get_expected_version)
@ -292,7 +292,7 @@ main() {
echo "Webpage accessibility lite tests failed"
fi
cd "$PROJECT_ROOT"
echo "Testing version verification..."
if verify_app_version "Stirling-PDF-Ultra-Lite" "http://localhost:8080"; then
passed_tests+=("Stirling-PDF-Ultra-Lite-Version-Check")
@ -301,7 +301,7 @@ main() {
failed_tests+=("Stirling-PDF-Ultra-Lite-Version-Check")
echo "Version verification failed for Stirling-PDF-Ultra-Lite"
fi
docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" down
# run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml"
@ -313,7 +313,7 @@ main() {
echo "Gradle build failed with security enabled, exiting script."
exit 1
fi
# Get expected version after the security-enabled build
echo "Getting expected version from Gradle (security enabled)..."
EXPECTED_VERSION=$(get_expected_version)
@ -343,7 +343,7 @@ main() {
echo "Webpage accessibility full tests failed"
fi
cd "$PROJECT_ROOT"
echo "Testing version verification..."
if verify_app_version "Stirling-PDF-Security-Fat" "http://localhost:8080"; then
passed_tests+=("Stirling-PDF-Security-Fat-Version-Check")
@ -420,7 +420,7 @@ main() {
failed_tests+=("Disabled-Endpoints")
echo "Disabled Endpoints tests failed"
fi
echo "Testing version verification..."
if verify_app_version "Stirling-PDF-Fat-Disable-Endpoints" "http://localhost:8080"; then
passed_tests+=("Stirling-PDF-Fat-Disable-Endpoints-Version-Check")