Compare commits

...

9 Commits

Author SHA1 Message Date
Anthony Stirling
60ced19f64 Update build.yml 2024-12-16 20:59:47 +00:00
Anthony Stirling
63eb94c0a6 Merge pull request #2463 from reecebrowne/bug/fix_merge
Add missing pdflib
2024-12-16 14:11:36 +00:00
Reece Browne
0a6b6453b2 Update build number 2024-12-16 14:03:38 +00:00
Reece Browne
2931e348a9 Add missing pdflib 2024-12-16 13:55:44 +00:00
Anthony Stirling
c71ca21532 Update multiOSReleases.yml 2024-12-14 11:08:35 +00:00
Anthony Stirling
0e4c3d5dbc Update releaseArtifacts.yml 2024-12-14 11:01:49 +00:00
Anthony Stirling
92cabf125e Merge pull request #2453 from Stirling-Tools/csrf2
Csrf fixes
2024-12-14 10:59:50 +00:00
Anthony Stirling
818bed3154 Update build.gradle 2024-12-14 10:43:35 +00:00
Anthony Stirling
1f1c414138 csrf fixes 2024-12-14 10:42:07 +00:00
12 changed files with 44 additions and 39 deletions

View File

@@ -76,7 +76,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.7" python-version: "3.12"
- name: Pip requirements - name: Pip requirements
run: | run: |

View File

@@ -74,7 +74,7 @@ jobs:
shell: bash shell: bash
run: | run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv "build/jpackage/Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}.exe" "Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}-${{ matrix.platform }}.${{ matrix.ext }}" mv "build/jpackage/Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}.exe" "Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}"
elif [ "${{ matrix.os }}" = "macos-latest" ]; then elif [ "${{ matrix.os }}" = "macos-latest" ]; then
mv "build/jpackage/Stirling-PDF-${{ steps.versionNumberMac.outputs.versionNumberMac }}.dmg" "Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}-${{ matrix.platform }}.${{ matrix.ext }}" mv "build/jpackage/Stirling-PDF-${{ steps.versionNumberMac.outputs.versionNumberMac }}.dmg" "Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}-${{ matrix.platform }}.${{ matrix.ext }}"
else else
@@ -85,7 +85,12 @@ jobs:
- name: Upload Installer Artifact - name: Upload Installer Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: Stirling-PDF-${{ matrix.platform }}-installer.{{ matrix.ext }} name: Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}
path: Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}-${{ matrix.platform }}.${{ matrix.ext }} path: Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}
retention-days: 1 retention-days: 1
if-no-files-found: error if-no-files-found: error
- name: Upload binaries to release
uses: softprops/action-gh-release@v2
with:
files: ./Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}

View File

@@ -59,13 +59,13 @@ jobs:
files: ./build/launch4j/Stirling-PDF-Server${{ matrix.file_suffix }}.exe files: ./build/launch4j/Stirling-PDF-Server${{ matrix.file_suffix }}.exe
- name: Rename jar binaries - name: Rename jar binaries
run: cp ./build/libs/Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}.jar ./build/libs/Stirling-PDF-Server${{ matrix.file_suffix }}.jar run: cp ./build/libs/Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}.jar ./build/libs/Stirling-PDF${{ matrix.file_suffix }}.jar
- name: Upload Assets jar binaries - name: Upload Assets jar binaries
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
path: ./build/libs/Stirling-PDF-Server${{ matrix.file_suffix }}.jar path: ./build/libs/Stirling-PDF${{ matrix.file_suffix }}.jar
name: Stirling-PDF-Server${{ matrix.file_suffix }}.jar name: Stirling-PDF${{ matrix.file_suffix }}.jar
overwrite: true overwrite: true
retention-days: 1 retention-days: 1
if-no-files-found: error if-no-files-found: error
@@ -73,7 +73,7 @@ jobs:
- name: Upload jar binaries to release - name: Upload jar binaries to release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
files: ./build/libs/Stirling-PDF-Server${{ matrix.file_suffix }}.jar files: ./build/libs/Stirling-PDF${{ matrix.file_suffix }}.jar
push-ui: push-ui:

View File

@@ -23,11 +23,11 @@ ext {
lombokVersion = "1.18.36" lombokVersion = "1.18.36"
bouncycastleVersion = "1.79" bouncycastleVersion = "1.79"
springSecuritySamlVersion = "6.4.1" springSecuritySamlVersion = "6.4.1"
openSamlVersion = "4.3.2" openSamlVersion = "4.3.2"
} }
group = "stirling.software" group = "stirling.software"
version = "0.36.1" version = "0.36.3"
java { java {
@@ -44,7 +44,7 @@ repositories {
} }
maven { url "https://build.shibboleth.net/maven/releases" } maven { url "https://build.shibboleth.net/maven/releases" }
maven { url "https://maven.pkg.github.com/jcefmaven/jcefmaven" } maven { url "https://maven.pkg.github.com/jcefmaven/jcefmaven" }
} }
licenseReport { licenseReport {
@@ -68,12 +68,12 @@ sourceSets {
exclude "stirling/software/SPDF/model/User.java" exclude "stirling/software/SPDF/model/User.java"
exclude "stirling/software/SPDF/repository/**" exclude "stirling/software/SPDF/repository/**"
} }
if (System.getenv("STIRLING_PDF_DESKTOP_UI") == "false") { if (System.getenv("STIRLING_PDF_DESKTOP_UI") == "false") {
exclude "stirling/software/SPDF/UI/impl/**" exclude "stirling/software/SPDF/UI/impl/**"
} }
} }
} }
} }
@@ -104,7 +104,7 @@ jpackage {
icon = "src/main/resources/static/favicon.ico" icon = "src/main/resources/static/favicon.ico"
// JVM Options // JVM Options
javaOptions = [ javaOptions = [
@@ -115,12 +115,12 @@ jpackage {
"--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED",
"--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED", "--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED",
"--add-opens", "java.desktop/sun.awt=ALL-UNNAMED" "--add-opens", "java.desktop/sun.awt=ALL-UNNAMED"
] ]
verbose = true verbose = true
destination = "${projectDir}/build/jpackage" destination = "${projectDir}/build/jpackage"
// Windows-specific configuration // Windows-specific configuration
@@ -150,16 +150,16 @@ jpackage {
macAppCategory = "public.app-category.productivity" macAppCategory = "public.app-category.productivity"
macSign = false // Enable signing macSign = false // Enable signing
macAppStore = false // Not targeting App Store initially macAppStore = false // Not targeting App Store initially
//installDir = "Applications" //installDir = "Applications"
// Add license and other documentation to DMG // Add license and other documentation to DMG
/*macDmgContent = [ /*macDmgContent = [
"README.md", "README.md",
"LICENSE", "LICENSE",
"CHANGELOG.md" "CHANGELOG.md"
]*/ ]*/
// Enable Mac-specific entitlements // Enable Mac-specific entitlements
//macEntitlements = "entitlements.plist" // You'll need to create this file //macEntitlements = "entitlements.plist" // You'll need to create this file
} }
@@ -169,7 +169,7 @@ jpackage {
appVersion = project.version appVersion = project.version
icon = "src/main/resources/static/favicon.png" icon = "src/main/resources/static/favicon.png"
type = "deb" // Can also use "rpm" for Red Hat-based systems type = "deb" // Can also use "rpm" for Red Hat-based systems
// Debian package configuration // Debian package configuration
//linuxPackageName = "stirlingpdf" //linuxPackageName = "stirlingpdf"
linuxDebMaintainer = "support@stirlingpdf.com" linuxDebMaintainer = "support@stirlingpdf.com"
@@ -177,9 +177,9 @@ jpackage {
linuxAppCategory = "Office" linuxAppCategory = "Office"
linuxAppRelease = "1" linuxAppRelease = "1"
linuxPackageDeps = true linuxPackageDeps = true
installDir = "/opt/Stirling-PDF" installDir = "/opt/Stirling-PDF"
// RPM-specific settings // RPM-specific settings
//linuxRpmLicenseType = "MIT" //linuxRpmLicenseType = "MIT"
} }
@@ -212,7 +212,7 @@ launch4j {
icon = "${projectDir}/src/main/resources/static/favicon.ico" icon = "${projectDir}/src/main/resources/static/favicon.ico"
outfile="Stirling-PDF.exe" outfile="Stirling-PDF.exe"
if(System.getenv("STIRLING_PDF_DESKTOP_UI") == 'true') { if(System.getenv("STIRLING_PDF_DESKTOP_UI") == 'true') {
headerType = "gui" headerType = "gui"
} else { } else {
@@ -222,15 +222,15 @@ launch4j {
errTitle="Encountered error, Do you have Java 21?" errTitle="Encountered error, Do you have Java 21?"
downloadUrl="https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe" downloadUrl="https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe"
if(System.getenv("STIRLING_PDF_DESKTOP_UI") == 'true') { if(System.getenv("STIRLING_PDF_DESKTOP_UI") == 'true') {
variables=["BROWSER_OPEN=true", "STIRLING_PDF_DESKTOP_UI=true"] variables=["BROWSER_OPEN=true", "STIRLING_PDF_DESKTOP_UI=true"]
} else { } else {
variables=["BROWSER_OPEN=true"] variables=["BROWSER_OPEN=true"]
} }
jreMinVersion="17" jreMinVersion="17"
mutexName="Stirling-PDF" mutexName="Stirling-PDF"
@@ -276,7 +276,7 @@ dependencies {
implementation "org.openjfx:javafx-controls:21" implementation "org.openjfx:javafx-controls:21"
implementation "org.openjfx:javafx-swing:21" implementation "org.openjfx:javafx-swing:21"
} }
//security updates //security updates
implementation "org.springframework:spring-webmvc:6.2.0" implementation "org.springframework:spring-webmvc:6.2.0"
@@ -301,7 +301,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 '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
runtimeOnly "com.h2database:h2:2.3.232" runtimeOnly "com.h2database:h2:2.3.232"

View File

@@ -242,7 +242,7 @@
let errorMessage = null; let errorMessage = null;
try { try {
const response = await fetch(url, {method: 'POST', body: formData}); const response = await window.fetchWithCsrf(url, {method: 'POST', body: formData});
const contentType = response.headers.get('content-type'); const contentType = response.headers.get('content-type');
if (!response.ok) { if (!response.ok) {

View File

@@ -8,7 +8,6 @@ window.fetchWithCsrf = async function(url, options = {}) {
if (cookieValue) { if (cookieValue) {
return cookieValue; return cookieValue;
} }
const csrfElement = document.querySelector('input[name="_csrf"]'); const csrfElement = document.querySelector('input[name="_csrf"]');
return csrfElement ? csrfElement.value : null; return csrfElement ? csrfElement.value : null;
} }

View File

@@ -196,7 +196,7 @@
/*<![CDATA[*/ /*<![CDATA[*/
const urlGetApiKey = /*[[@{/api/v1/user/get-api-key}]]*/ "/api/v1/user/get-api-key"; const urlGetApiKey = /*[[@{/api/v1/user/get-api-key}]]*/ "/api/v1/user/get-api-key";
/*]]>*/ /*]]>*/
let response = await fetch(urlGetApiKey, { method: 'POST' }); let response = await window.fetchWithCsrf(urlGetApiKey, { method: 'POST' });
if (response.status === 200) { if (response.status === 200) {
let apiKey = await response.text(); let apiKey = await response.text();
manageUIState(apiKey); manageUIState(apiKey);
@@ -213,7 +213,7 @@
/*<![CDATA[*/ /*<![CDATA[*/
const urlUpdateApiKey = /*[[@{/api/v1/user/update-api-key}]]*/ "/api/v1/user/update-api-key"; const urlUpdateApiKey = /*[[@{/api/v1/user/update-api-key}]]*/ "/api/v1/user/update-api-key";
/*]]>*/ /*]]>*/
let response = await fetch(urlUpdateApiKey, { method: 'POST' }); let response = await window.fetchWithCsrf(urlUpdateApiKey, { method: 'POST' });
if (response.status === 200) { if (response.status === 200) {
let apiKey = await response.text(); let apiKey = await response.text();
manageUIState(apiKey); manageUIState(apiKey);

View File

@@ -24,7 +24,7 @@
<script> <script>
window.stirlingPDF = window.stirlingPDF || {}; window.stirlingPDF = window.stirlingPDF || {};
</script> </script>
<script th:src="@{'/js/fetch-utils.js'}"></script>
<!-- jQuery --> <!-- jQuery -->
<script th:src="@{'/js/thirdParty/jquery.min.js'}"></script> <script th:src="@{'/js/thirdParty/jquery.min.js'}"></script>
<script th:src="@{'/js/thirdParty/jquery.validate.min.js'}"></script> <script th:src="@{'/js/thirdParty/jquery.validate.min.js'}"></script>

View File

@@ -14,6 +14,7 @@
</script> </script>
<script th:src="@{'/js/homecard.js'}"></script> <script th:src="@{'/js/homecard.js'}"></script>
<script th:src="@{'/js/githubVersion.js'}"></script> <script th:src="@{'/js/githubVersion.js'}"></script>
<form th:action="@{'/dummyFormToPopulateCSRF'}" method="post" enctype="multipart/form-data"></form>
<nav class="navbar navbar-expand-xl"> <nav class="navbar navbar-expand-xl">
<div class="container "> <div class="container ">
<a class="navbar-brand" th:href="@{'/'}" style="display: flex;"> <a class="navbar-brand" th:href="@{'/'}" style="display: flex;">
@@ -376,7 +377,6 @@
<span class="go-pro-badge" th:text="#{enterpriseEdition.button}"></span> <span class="go-pro-badge" th:text="#{enterpriseEdition.button}"></span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<!-- Settings Button --> <!-- Settings Button -->
<a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#settingsModal" th:title="#{navbar.settings}"> <a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#settingsModal" th:title="#{navbar.settings}">

View File

@@ -5,6 +5,7 @@
<head> <head>
<th:block th:insert="~{fragments/common :: head(title=#{merge.title}, header=#{merge.header})}"></th:block> <th:block th:insert="~{fragments/common :: head(title=#{merge.title}, header=#{merge.header})}"></th:block>
<link rel="stylesheet" th:href="@{'/css/merge.css'}"> <link rel="stylesheet" th:href="@{'/css/merge.css'}">
<script th:src="@{'/js/thirdParty/pdf-lib.min.js'}"></script>
</head> </head>
<body> <body>

View File

@@ -38,7 +38,7 @@
const processFile = async (file) => { const processFile = async (file) => {
const origFileUrl = URL.createObjectURL(file); const origFileUrl = URL.createObjectURL(file);
const formPdfBytes = await fetch(origFileUrl).then(res => res.arrayBuffer()); const formPdfBytes = await window.fetchWithCsrf(origFileUrl).then(res => res.arrayBuffer());
const pdfDoc = await PDFDocument.load(formPdfBytes, { ignoreEncryption: true }); const pdfDoc = await PDFDocument.load(formPdfBytes, { ignoreEncryption: true });
const pages = pdfDoc.getPages(); const pages = pdfDoc.getPages();

View File

@@ -102,7 +102,7 @@ document.querySelector('#pdfForm').addEventListener('submit', async (e) => {
formData.append('certFile', certInput.files[0]); formData.append('certFile', certInput.files[0]);
} }
try { try {
const response = await fetch(e.target.action, { const response = await window.fetchWithCsrf(e.target.action, {
method: 'POST', method: 'POST',
body: formData body: formData
}); });