From d2ed6c6705c9f49786e0aadc016484498ef7615c Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:25:52 +0100 Subject: [PATCH] Revert "Updated file paths and security environment variable" --- .../External Database.md | 8 +- .../How to add configurations.md | 2 +- .../Single Sign-On Configuration.md | 14 ++-- .../System and Security.md | 12 +-- .../UI Customisation.md | 12 +-- docs/Installation/Docker Install.md | 4 +- docs/Installation/Unix.md | 74 ++++--------------- docs/Pro.md | 4 +- 8 files changed, 43 insertions(+), 87 deletions(-) diff --git a/docs/Advanced Configuration/External Database.md b/docs/Advanced Configuration/External Database.md index bc5ae639..e2a1a9f6 100644 --- a/docs/Advanced Configuration/External Database.md +++ b/docs/Advanced Configuration/External Database.md @@ -18,7 +18,7 @@ PostgreSQL is currently the only supported variant, others will be added on requ You can configure the new `Datasource` property in your `settings.yml` to connect to your external database: > #### ⚠️ Note -> _To use the external database feature, you will need to have a valid enterprise license and set the environment variable `DISABLE_ADDITIONAL_FEATURES` to `false`._ +> _To use the external database feature, you will need to have a valid enterprise license and set the environment variable `DOCKER_ENABLE_SECURITY` to `true`._ @@ -78,7 +78,7 @@ services: depends_on: - db environment: - DISABLE_ADDITIONAL_FEATURES: "false" "true" + DOCKER_ENABLE_SECURITY: "true" SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: "true" SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf" SYSTEM_DATASOURCE_USERNAME: "admin" @@ -87,7 +87,7 @@ services: ``` - `depends_on`: This specifies any services that your app will need in order to run. Ensure the name matches the container name for your database -- `DISABLE_ADDITIONAL_FEATURES`: Set this to `false` to enable security features +- `DOCKER_ENABLE_SECURITY`: Set this to `true` to enable security features - `SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE`: An environment variable to connect to the database container. Set this to `true` to enable use of the external database - `SYSTEM_DATASOURCE_CUSTOMDATABASEURL`: An environment variable to connect to the database container. Set the connection url for the database here. **Note: If you set this url you do not need to set the type, hostName, port and name (namely `SYSTEM_DATASOURCE_TYPE`, `SYSTEM_DATASOURCE_HOSTNAME`, `SYSTEM_DATASOURCE_PORT`, `SYSTEM_DATASOURCE_NAME`), they will all be automatically derived from the url.** - `SYSTEM_DATASOURCE_USERNAME`: An environment variable to connect to the database container. Set the username for the database. Ensure this matches the corresponding property in your database container @@ -101,7 +101,7 @@ services: depends_on: - db environment: - DISABLE_ADDITIONAL_FEATURES: "false" "true" + DOCKER_ENABLE_SECURITY: "true" SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: "true" SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf" SYSTEM_DATASOURCE_USERNAME: "admin" diff --git a/docs/Advanced Configuration/How to add configurations.md b/docs/Advanced Configuration/How to add configurations.md index a1faefdd..27dad686 100644 --- a/docs/Advanced Configuration/How to add configurations.md +++ b/docs/Advanced Configuration/How to add configurations.md @@ -175,7 +175,7 @@ There is an additional config file ``/configs/custom_settings.yml`` where users - ``SYSTEM_ROOTURIPATH`` ie set to ``/pdf-app`` to Set the application's root URI to ``localhost:8080/pdf-app`` - ``SYSTEM_CONNECTIONTIMEOUTMINUTES`` to set custom connection timeout values -- ``DISABLE_ADDITIONAL_FEATURES`` to tell docker to download security jar (required as false for auth login) +- ``DOCKER_ENABLE_SECURITY`` to tell docker to download security jar (required as true for auth login) - ``LANGS`` to define custom font libraries to install for use for document conversions ### Local diff --git a/docs/Advanced Configuration/Single Sign-On Configuration.md b/docs/Advanced Configuration/Single Sign-On Configuration.md index 11a5361a..9e26df7c 100644 --- a/docs/Advanced Configuration/Single Sign-On Configuration.md +++ b/docs/Advanced Configuration/Single Sign-On Configuration.md @@ -151,9 +151,9 @@ Assertion Consumer Service (ACS) URL The default is `stirling` - `security.saml2.idpSingleLoginUrl`: The URL given by your Provider to initiate the SSO flow - `security.saml2.idpSingleLogoutUrl`: The URL given by your Provider to initiate the SLO flow - `security.saml2.idpIssuer`: The name of your Provider -- `security.saml2.idpCert`: The signing certificate given by your Provider in `.pem` format. Place in `stirling-pdf/src/main/resources` -- `security.saml2.privateKey`: Your private key from your keypair in `.key` format. Place in `stirling-pdf/src/main/resources` -- `security.saml2.spCert`: classpath:certificate.crt from your keypair in `.crt` format. Place in `stirling-pdf/src/main/resources` +- `security.saml2.idpCert`: The signing certificate given by your Provider in `.pem` format. Place in `src/main/resources` +- `security.saml2.privateKey`: Your private key from your keypair in `.key` format. Place in `src/main/resources` +- `security.saml2.spCert`: classpath:certificate.crt from your keypair in `.crt` format. Place in `src/main/resources` ### Generating a Keypair @@ -174,7 +174,7 @@ A self-signed certificate is not verified by a Certificate Authority (CA), which - `out certificate.crt`: Specifies the output file where the self-signed certificate will be saved After generating the keypair, the `.key` and `.crt` files should be located in the directory you executed the above command in. -Move the files to `stirling-pdf/src/main/resources`. +Move the files to `src/main/resources`. Once you have added your configuration, you should see the button for your chosen Provider on the login page prompting you to log in: @@ -222,7 +222,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2: ```bash - export DISABLE_ADDITIONAL_FEATURES=false + export DOCKER_ENABLE_SECURITY=true export SECURITY_ENABLELOGIN=true export SECURITY_OAUTH2_ENABLED=true export SECURITY_OAUTH2_AUTOCREATEUSER=false @@ -249,7 +249,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2: ```bash - -e DISABLE_ADDITIONAL_FEATURES=false \ + -e DOCKER_ENABLE_SECURITY=true \ -e SECURITY_ENABLELOGIN=true \ -e SECURITY_OAUTH2_ENABLED=true \ -e SECURITY_OAUTH2_AUTOCREATEUSER=false \ @@ -276,7 +276,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2: ```yaml environment: - DISABLE_ADDITIONAL_FEATURES=false + DOCKER_ENABLE_SECURITY=true SECURITY_ENABLELOGIN=true SECURITY_OAUTH2_ENABLED=true SECURITY_OAUTH2_AUTOCREATEUSER=false diff --git a/docs/Advanced Configuration/System and Security.md b/docs/Advanced Configuration/System and Security.md index 98f13250..f59486a5 100644 --- a/docs/Advanced Configuration/System and Security.md +++ b/docs/Advanced Configuration/System and Security.md @@ -6,7 +6,7 @@ import TabItem from '@theme/TabItem'; # Login, System and Security -Stirling PDF allows customization of system and security settings. For security features to be enabled, you must use the security jar. For Docker users, this means setting `DISABLE_ADDITIONAL_FEATURES` to `false` via an environment variable. +Stirling PDF allows customization of system and security settings. For security features to be enabled, you must use the security jar. For Docker users, this means setting `DOCKER_ENABLE_SECURITY` to `true` via an environment variable. ## Basic Security Settings @@ -19,7 +19,7 @@ Stirling PDF allows customization of system and security settings. For security ### Prerequisites 1. Ensure the `/configs` directory is mounted as a volume in Docker for persistence across updates -2. For Docker users: Set `DISABLE_ADDITIONAL_FEATURES=false` in environment variables +2. For Docker users: Set `DOCKER_ENABLE_SECURITY=true` in environment variables 3. Enable login either via `settings.yml` or set `SECURITY_ENABLELOGIN=true` ### Initial Login Credentials @@ -76,25 +76,25 @@ When using the API: **Option 1: Using Java Properties** ```bash - java -jar Stirling-PDF.jar -DDISABLE_ADDITIONAL_FEATURES=false -DSECURITY_ENABLELOGIN=true + java -jar Stirling-PDF.jar -DDOCKER_ENABLE_SECURITY=true -DSECURITY_ENABLELOGIN=true ``` **Option 2: Using Environment Variables** ```bash - export DISABLE_ADDITIONAL_FEATURES=false + export DOCKER_ENABLE_SECURITY=true export SECURITY_ENABLELOGIN=true ``` ```bash - -e DISABLE_ADDITIONAL_FEATURES=false \ + -e DOCKER_ENABLE_SECURITY=true \ -e SECURITY_ENABLELOGIN=true \ ``` ```yaml environment: - DISABLE_ADDITIONAL_FEATURES: false true + DOCKER_ENABLE_SECURITY: true SECURITY_ENABLELOGIN: true ``` diff --git a/docs/Advanced Configuration/UI Customisation.md b/docs/Advanced Configuration/UI Customisation.md index bbd49d79..ce6396c3 100644 --- a/docs/Advanced Configuration/UI Customisation.md +++ b/docs/Advanced Configuration/UI Customisation.md @@ -50,29 +50,29 @@ To override a file: 3. Create the same file path under your `customFiles` directory following the same directory structure 4. Paste and modify the contents as needed -Note: When overriding templates, first copy the existing template from the [source repository](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/stirling-pdf/src/main/resources/templates) to maintain the base structure. +Note: When overriding templates, first copy the existing template from the [source repository](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/src/main/resources/templates) to maintain the base structure. 1. To replace the favicon: ``` customFiles/static/favicon.svg ``` - Original file: [stirling-pdf/src/main/resources/static/favicon.svg](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/stirling-pdf/src/main/resources/static/favicon.svg) + Original file: [src/main/resources/static/favicon.svg](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/src/main/resources/static/favicon.svg) 2. To override a Bootstrap icon font: ``` customFiles/static/css/fonts/bootstrap-icons.woff ``` - Original file: [stirling-pdf/src/main/resources/static/css/fonts/bootstrap-icons.woff](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/stirling-pdf/src/main/resources/static/css/fonts/bootstrap-icons.woff) + Original file: [src/main/resources/static/css/fonts/bootstrap-icons.woff](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/src/main/resources/static/css/fonts/bootstrap-icons.woff) 3. To modify a template: ``` customFiles/templates/fragments/common.html ``` - Original file: [stirling-pdf/src/main/resources/templates/fragments/common.html](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/stirling-pdf/src/main/resources/templates/fragments/common.html) + Original file: [src/main/resources/templates/fragments/common.html](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/src/main/resources/templates/fragments/common.html) The original files can be found in the GitHub repository under: -- Static files: [stirling-pdf/src/main/resources/static/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/stirling-pdf/src/main/resources/static) -- Templates (HTML files): [stirling-pdf/src/main/resources/templates/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/stirling-pdf/src/main/resources/templates) +- Static files: [src/main/resources/static/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/src/main/resources/static) +- Templates (HTML files): [src/main/resources/templates/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/src/main/resources/templates) diff --git a/docs/Installation/Docker Install.md b/docs/Installation/Docker Install.md index 53eec782..5ece5a5d 100644 --- a/docs/Installation/Docker Install.md +++ b/docs/Installation/Docker Install.md @@ -27,7 +27,7 @@ docker run -d \ -v "./StirlingPDF/customFiles:/customFiles/" \ -v "./StirlingPDF/logs:/logs/" \ -v "./StirlingPDF/pipeline:/pipeline/" \ - -e DISABLE_ADDITIONAL_FEATURES=true \ + -e DOCKER_ENABLE_SECURITY=false \ -e LANGS=en_GB \ docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest ``` @@ -49,7 +49,7 @@ services: - ./StirlingPDF/logs:/logs/ - ./StirlingPDF/pipeline:/pipeline/ environment: - - DISABLE_ADDITIONAL_FEATURES=false + - DOCKER_ENABLE_SECURITY=false - LANGS=en_GB ``` diff --git a/docs/Installation/Unix.md b/docs/Installation/Unix.md index 49207c5a..bd36f441 100644 --- a/docs/Installation/Unix.md +++ b/docs/Installation/Unix.md @@ -3,7 +3,6 @@ sidebar_position: 2 id: Unix Installation title: Unix Installation Guide --- - import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -67,19 +66,7 @@ Install the following software, if not already installed: ### Step 2: Clone and Build jbig2enc (Only required for certain OCR functionality) - - ```bash - mkdir ~/.git - cd ~/.git &&\ - git clone https://github.com/agl/jbig2enc.git &&\ - cd jbig2enc &&\ - ./autogen.sh &&\ - ./configure &&\ - make &&\ - sudo make install - ``` - - + ```bash mkdir ~/.git cd ~/.git &&\ @@ -103,7 +90,6 @@ Install the following software, if not already installed: Next we need to install LibreOffice for conversions, tesseract for OCR, and opencv for pattern recognition functionality. Install the following software: - - libreoffice (libreoffice-core libreoffice-common libreoffice-writer libreoffice-calc libreoffice-impress) - python3-uno - unoserver @@ -133,25 +119,15 @@ Install the following software: ### Step 4: Grab latest Stirling-PDF Jar - -The JAR can be downloaded in two versions, [normal](https://files.stirlingpdf.com/Stirling-PDF.jar) and [security](https://files.stirlingpdf.com/Stirling-PDF-with-login.jar) +The JAR can be downloaded in two versions, [normal](https://files.stirlingpdf.com/Stirling-PDF.jar) and [security](https://files.stirlingpdf.com/Stirling-PDF-with-login.jar) ### Step 5: Move jar to desired location - You can move this file to a desired location, for example, `/opt/Stirling-PDF/`. You must also move the Script folder within the Stirling-PDF repo that you have downloaded to this directory. This folder is required for the python scripts using OpenCV. - - ```bash - sudo mkdir /opt/Stirling-PDF &&\ - sudo mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ &&\ - sudo mv scripts /opt/Stirling-PDF/ &&\ - echo "Scripts installed." - ``` - - + ```bash sudo mkdir /opt/Stirling-PDF &&\ sudo mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ &&\ @@ -159,7 +135,7 @@ This folder is required for the python scripts using OpenCV. echo "Scripts installed." ``` - + ```bash mv ./build/libs/Stirling-PDF-*.jar ./Stirling-PDF-*.jar ``` @@ -176,7 +152,7 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi sudo apt update &&\ # All languages # sudo apt install -y 'tesseract-ocr-*' - + # Find languages: apt search tesseract-ocr- @@ -188,7 +164,7 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi ```bash # All languages # sudo dnf install -y tesseract-langpack-* - + # Find languages: dnf search -C tesseract-langpack- @@ -208,41 +184,28 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi 3. Please view [tesseract install guide](https://tesseract.readthedocs.io/en/latest/installation.html) for more info. **IMPORTANT:** DO NOT REMOVE EXISTING `eng.traineddata`, IT'S REQUIRED. - ### Step 7: Run Stirling-PDF - - ```bash java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar ``` - - - ```bash - java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar + +Since libreoffice, soffice, and conversion tools have their dbus_tmp_dir set as `dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"`, you might get the following error: ``` - - - ```bash - java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar + [Thread-7] INFO s.s.SPDF.utils.ProcessExecutor - mkdir: cannot create directory '/run/user/1501': Permission denied ``` - Since libreoffice, soffice, and conversion tools have their dbus_tmp_dir set as `dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"`, you get the following error: - `[Thread-7] INFO s.s.SPDF.utils.ProcessExecutor - mkdir: cannot create directory '/run/user/1501': Permission denied` - To resolve this, use: - `bash - mkdir temp - export DBUS_SESSION_BUS_ADDRESS="unix:path=./temp" - ` - - + To resolve this, use: + ```bash + mkdir temp + export DBUS_SESSION_BUS_ADDRESS="unix:path=./temp" + ``` ### Step 8: Adding a Desktop Icon This will add a modified Appstarter to your Appmenu. - ```bash location=$(pwd)/gradlew image=$(pwd)/docs/stirling-transparent.svg @@ -285,21 +248,17 @@ SERVER_PORT="3000" ### Optional: Run Stirling-PDF as a service (requires root). First create a .env file, where you can store environment variables: - ``` touch /opt/Stirling-PDF/.env ``` - In this file you can add all variables, one variable per line, as stated in the main readme (for example SYSTEM_DEFAULTLOCALE="de-DE"). Create a new file where we store our service settings and open it with nano editor: - ``` nano /etc/systemd/system/stirlingpdf.service ``` Paste this content, make sure to update the filename of the jar-file. Press Ctrl+S and Ctrl+X to save and exit the nano editor: - ``` [Unit] Description=Stirling-PDF service @@ -329,19 +288,16 @@ sudo systemctl daemon-reload ``` Enable the service to tell the service to start it automatically: - ``` sudo systemctl enable stirlingpdf.service ``` See the status of the service: - ``` sudo systemctl status stirlingpdf.service ``` Manually start/stop/restart the service: - ``` sudo systemctl start stirlingpdf.service sudo systemctl stop stirlingpdf.service @@ -371,4 +327,4 @@ system: operations: weasyprint: "" #Defaults to /opt/venv/bin/weasyprint unoconvert: "" #Defaults to /opt/venv/bin/unoconvert -``` \ No newline at end of file +``` diff --git a/docs/Pro.md b/docs/Pro.md index 4b357982..2fd1d538 100644 --- a/docs/Pro.md +++ b/docs/Pro.md @@ -14,7 +14,7 @@ tags: Stirling PDF offers a Pro edition of its software. This is the same great software, but with added features and comforts. Some users who seek additional features, bulk user discounts or SLA support may want our Enterprise package. -## What's included in Pro +## What's included in pro - Support tickets via support@stirlingpdf.com to reach the Stirling-PDF team for support - [Advanced SSO](/Advanced%20Configuration/Single%20Sign-On%20Configuration), OAuth2 and SAML with automated login handling - [External Database](/Advanced%20Configuration/External%20Database) support for optimised deployments and load-balancing support @@ -39,7 +39,7 @@ We charge 12$ per seat per month. This followed the 'Named User' model, meaning ## Purchase To purchase stirling PDF Pro, please navigate to https://stirlingpdf.com/pricing and select either Pro or Enterprise, depending on your use-case. -For Pro, you will be redirected to Stripe to set up and handle a subscription, after which you will be automatically emailed your license key at the email provided to Stripe. +For Pro, you will be redirected to Stripe to setup and handle a subscription, after which you will be automatically emailed your license key at the email provided to Stripe. ## Activation