Skip to content

[Bug]: Java instruction for custom files not working. #3525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
SN-VFox opened this issue May 14, 2025 · 2 comments
Open
1 task done

[Bug]: Java instruction for custom files not working. #3525

SN-VFox opened this issue May 14, 2025 · 2 comments
Labels
Back End Issues related to back-end development

Comments

@SN-VFox
Copy link

SN-VFox commented May 14, 2025

Installation Method

Local Installation

The Problem

https://docs.stirlingpdf.com/Advanced%20Configuration/UI%20Customisation#configuration-examples
No custom logo/favico etc... change when doing this on a jar run, according to the documentation.

Version of Stirling-PDF

0.46.1

Last Working Version of Stirling-PDF

No response

Page Where the Problem Occurred

No response

Docker Configuration

Relevant Log Output

May 14 09:13:53 Stirling-PDF systemd[1]: Started stirlingpdf.service - Stirling-PDF service.
May 14 09:13:55 Stirling-PDF java[75615]: 09:13:55.457 [main] INFO  s.s.SPDF.config.ConfigInitializer - Settings file updated based on template changes.
May 14 09:13:55 Stirling-PDF java[75615]: 09:13:55.460 [main] INFO  s.software.SPDF.SPDFApplication - Settings file: ./configs/settings.yml
May 14 09:13:55 Stirling-PDF java[75615]: 09:13:55.463 [main] INFO  s.software.SPDF.SPDFApplication - Custom settings file: ./configs/custom_settings.yml
May 14 09:13:56 Stirling-PDF java[75615]:  ____ _____ ___ ____  _     ___ _   _  ____       ____  ____  _____
May 14 09:13:56 Stirling-PDF java[75615]: / ___|_   _|_ _|  _ \| |   |_ _| \ | |/ ___|     |  _ \|  _ \|  ___|
May 14 09:13:56 Stirling-PDF java[75615]: \___ \ | |  | || |_) | |    | ||  \| | |  _ _____| |_) | | | | |_
May 14 09:13:56 Stirling-PDF java[75615]:  ___) || |  | ||  _ <| |___ | || |\  | |_| |_____|  __/| |_| |  _|
May 14 09:13:56 Stirling-PDF java[75615]: |____/ |_| |___|_| \_\_____|___|_| \_|\____|     |_|   |____/|_|
May 14 09:13:56 Stirling-PDF java[75615]: Powered by Spring Boot 3.4.5
May 14 09:13:56 Stirling-PDF java[75615]: 09:13:56.339 [main] INFO  s.software.SPDF.SPDFApplication - Starting SPDFApplication v0.46.1 using Java 17.0.14 with PID 75615 (/opt/Stirling-PDF/Stirling-PDF.jar started by root in /opt/Stirling-PDF)
May 14 09:13:56 Stirling-PDF java[75615]: 09:13:56.341 [main] INFO  s.software.SPDF.SPDFApplication - The following 1 profile is active: "default"
May 14 09:13:59 Stirling-PDF java[75615]: 09:13:59.818 [main] INFO  s.software.SPDF.SPDFApplication - Running configs ApplicationProperties(legal=ApplicationProperties.Legal(termsAndConditions=https://www.stirlingpdf.com/terms-and-conditions, privacyPolicy=https://www.stirlingpdf.com/privacy-policy, accessibilityStatement=, cookiePolicy=, impressum=), security=ApplicationProperties.Security(enableLogin=false, csrfDisabled=false, initialLogin=ApplicationProperties.Security.InitialLogin(username=), oauth2=ApplicationProperties.Security.OAUTH2(enabled=false, issuer=, clientId=, autoCreateUser=true, blockRegistration=false, useAsUsername=email, scopes=[openid, profile, email], provider=google, client=ApplicationProperties.Security.OAUTH2.Client(google=Google [clientId=, clientSecret=NULL, scopes=[email, profile], useAsUsername=EMAIL], github=GitHub [clientId=, clientSecret=NULL, scopes=[read:user], useAsUsername=LOGIN], keycloak=Keycloak [issuer=, clientId=, clientSecret=NULL, scopes=[openid, profile, email], useAsUsername=PREFERRED_USERNAME])), saml2=ApplicationProperties.Security.SAML2(provider=, enabled=false, autoCreateUser=true, blockRegistration=false, registrationId=stirling, idpSingleLogoutUrl=https://dev-XXXXXXXX.okta.com/app/dev-XXXXXXXX_stirlingpdf_1/externalKey/slo/saml, idpSingleLoginUrl=https://dev-XXXXXXXX.okta.com/app/dev-XXXXXXXX_stirlingpdf_1/externalKey/sso/saml, idpIssuer=, idpCert=class path resource [okta.cert]), loginAttemptCount=5, loginResetTimeMinutes=120, loginMethod=all, customGlobalAPIKey=null), system=ApplicationProperties.System(defaultLocale=fr-FR, googlevisibility=false, showUpdate=false, showUpdateOnlyAdmin=false, customHTMLFiles=true, tessdataDir=/usr/share/tessdata, enableAlphaFunctionality=false, enableAnalytics=false, datasource=ApplicationProperties.Datasource(enableCustomDatabase=false, customDatabaseUrl=, type=postgresql, hostName=localhost, port=5432, name=postgres, username=postgres), disableSanitize=false, enableUrlToPDF=false, customPaths=ApplicationProperties.CustomPaths(pipeline=ApplicationProperties.CustomPaths.Pipeline(watchedFoldersDir=, finishedFoldersDir=, webUIConfigsDir=null), operations=ApplicationProperties.CustomPaths.Operations(weasyprint=, unoconvert=)), fileUploadLimit=), ui=ApplicationProperties.Ui(appName=MyInstanceName, homeDescription=Votre point de rendez vous pour toute edition de pdf, appNameNavbar=MyInstanceName, languages=[fr_FR]), endpoints=ApplicationProperties.Endpoints(toRemove=[], groupsToRemove=[]), metrics=ApplicationProperties.Metrics(enabled=true), automaticallyGenerated=ApplicationProperties.AutomaticallyGenerated(UUID=af6703a8-886e-46da-80bf-605356d62f13, appVersion=0.46.1), mail=ApplicationProperties.Mail(enabled=true, host=smtp.example.com, port=587, username=, from=), premium=ApplicationProperties.Premium(enabled=false, maxUsers=0, proFeatures=ApplicationProperties.Premium.ProFeatures(ssoAutoLogin=false, customMetadata=ApplicationProperties.Premium.ProFeatures.CustomMetadata(autoUpdateMetadata=false, author=username, creator=Stirling-PDF, producer=Stirling-PDF), googleDrive=ApplicationProperties.Premium.ProFeatures.GoogleDrive(enabled=false, clientId=, apiKey=, appId=)), enterpriseFeatures=ApplicationProperties.Premium.EnterpriseFeatures(persistentMetrics=ApplicationProperties.Premium.EnterpriseFeatures.PersistentMetrics(enabled=false, retentionDays=0))), enterpriseEdition=ApplicationProperties.EnterpriseEdition(enabled=false, maxUsers=0, ssoAutoLogin=false, customMetadata=ApplicationProperties.EnterpriseEdition.CustomMetadata(autoUpdateMetadata=false, author=null, creator=Stirling-PDF, producer=Stirling-PDF)), autoPipeline=ApplicationProperties.AutoPipeline(outputFolder=null), processExecutor=ApplicationProperties.ProcessExecutor(sessionLimit=ApplicationProperties.ProcessExecutor.SessionLimit(libreOfficeSessionLimit=1, pdfToHtmlSessionLimit=1, pythonOpenCvSessionLimit=8, weasyPrintSessionLimit=16, installAppSessionLimit=1, calibreSessionLimit=1, qpdfSessionLimit=4, tesseractSessionLimit=1), timeoutMinutes=ApplicationProperties.ProcessExecutor.TimeoutMinutes(libreOfficeTimeoutMinutes=30, pdfToHtmlTimeoutMinutes=20, pythonOpenCvTimeoutMinutes=30, weasyPrintTimeoutMinutes=30, installAppTimeoutMinutes=60, calibreTimeoutMinutes=30, tesseractTimeoutMinutes=30, qpdfTimeoutMinutes=30)))
May 14 09:13:59 Stirling-PDF java[75615]: 09:13:59.854 [main] WARN  s.s.SPDF.config.ExternalAppDepConfig - Missing dependency: unoconvert - Disabling group: Unoconvert (Affected features: File To PDF)
May 14 09:14:00 Stirling-PDF java[75615]: 09:14:00.011 [main] INFO  s.s.S.config.EndpointConfiguration - Total disabled endpoints: 2. Disabled endpoints: file-to-pdf, url-to-pdf
May 14 09:14:00 Stirling-PDF java[75615]: 09:14:00.421 [main] INFO  s.software.SPDF.utils.FileMonitor - Monitoring directory: ./pipeline/watchedFolders
May 14 09:14:02 Stirling-PDF java[75615]: 09:14:02.078 [main] INFO  s.software.SPDF.SPDFApplication - Started SPDFApplication in 6.607 seconds (process running for 8.474)
May 14 09:14:02 Stirling-PDF java[75615]: 09:14:02.081 [scheduling-1] WARN  s.software.SPDF.utils.FileMonitor - not monitoring any directory, even the root directory itself: ./pipeline/watchedFolders
May 14 09:14:02 Stirling-PDF java[75615]: 09:14:02.084 [scheduling-1] INFO  s.software.SPDF.utils.FileMonitor - Registered directory: ./pipeline/watchedFolders
May 14 09:14:02 Stirling-PDF java[75615]: 09:14:02.095 [main] INFO  s.software.SPDF.SPDFApplication - Stirling-PDF Started.
May 14 09:14:02 Stirling-PDF java[75615]: 09:14:02.097 [main] INFO  s.software.SPDF.SPDFApplication - Navigate to http://localhost:8080/

Additional Information

[Unit]
Description=Stirling-PDF service
After=syslog.target network.target libreoffice-listener.service
Requires=libreoffice-listener.service

[Service]
SuccessExitStatus=143
Type=simple
User=root
Group=root
EnvironmentFile=/opt/Stirling-PDF/.env
WorkingDirectory=/opt/Stirling-PDF
ExecStart=/usr/bin/java
-DCUSTOM_HTML_FILES=true
-jar /opt/Stirling-PDF/Stirling-PDF.jar
ExecStop=/bin/kill -15 %n
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

root@Stirling-PDF:/opt/Stirling-PDF# ls -la /opt/Stirling-PDF/customFiles/static/
total 244
drwxr-xr-x 2 root root 4096 May 14 09:12 .
drwxr-xr-x 5 root root 4096 May 14 07:50 ..
-rw-r--r-- 1 root root 50571 May 14 07:42 favicon.ico
-rw-r--r-- 1 root root 50571 May 14 08:01 logo-dark.png
-rw-r--r-- 1 root root 50571 May 14 08:01 logo.png
-rw-r--r-- 1 root root 79119 May 14 08:09 stirling-icon.svg

No custom logo/favico etc... change when doing this on a jar run, according to the documentation.

Browsers Affected

No response

No Duplicate of the Issue

  • I have verified that there are no existing issues raised related to my problem.
@dosubot dosubot bot added the Back End Issues related to back-end development label May 14, 2025
Copy link

dosubot bot commented May 14, 2025

Hello @SN-VFox! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and navigate your journey as a contributor. I'm ready to assist while you wait for a human maintainer. Let's tackle this together! 🚀

To resolve the issue of custom HTML/CSS overrides not reflecting changes in Stirling-PDF version 0.46.1, ensure the following steps are correctly implemented:

  1. Java Properties: Confirm that the Java property -DCUSTOM_HTML_FILES=true is correctly set in your service configuration, as shown in your ExecStart command. This should enable the application to use custom HTML/CSS files.

  2. Directory Structure: Verify that your custom files are placed in the correct directory. For static files like images, icons, CSS, fonts, or JavaScript, they should be located in /opt/Stirling-PDF/customFiles/static/. Your directory listing shows files are correctly placed here.

  3. Caching and Server Restart: Ensure there are no caching issues. Sometimes, changes might not reflect due to cached versions of the files. Restart the Stirling-PDF service to ensure changes are applied.

  4. Configuration Files: Check the /configs/custom_settings.yml file to ensure there are no conflicting settings that might override your custom configurations. This file allows you to input your own settings on top of Stirling-PDF's existing ones [1][2].

If these steps are correctly followed and the issue persists, consider checking the logs for any errors related to file access or permissions that might prevent the application from using the custom files.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@SN-VFox
Copy link
Author

SN-VFox commented May 14, 2025

@dosu

ExecStart=/usr/bin/java
-DCUSTOM_HTML_FILES=true
-jar /opt/Stirling-PDF/Stirling-PDF.jar

root@Stirling-PDF:/opt/Stirling-PDF# ls -la /opt/Stirling-PDF/customFiles/static/
total 244
drwxr-xr-x 2 root root 4096 May 14 09:12 .
drwxr-xr-x 5 root root 4096 May 14 07:50 ..
-rw-r--r-- 1 root root 50571 May 14 07:42 favicon.ico
-rw-r--r-- 1 root root 50571 May 14 08:01 logo-dark.png
-rw-r--r-- 1 root root 50571 May 14 08:01 logo.png
-rw-r--r-- 1 root root 79119 May 14 08:09 stirling-icon.svg

I tried in incognito mode, modifying the service itself needs a reload and a restart anyway, so trust me, I did :)

root@Stirling-PDF:/opt/Stirling-PDF# cat /opt/Stirling-PDF/configs/custom_settings.yml
customFileLocation: /opt/Stirling-PDF/customFiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back End Issues related to back-end development
Projects
None yet
Development

No branches or pull requests

1 participant