Skip to content

Commit 40aa410

Browse files
committed
updated file paths. updated security environment variable
1 parent 6eb83f5 commit 40aa410

8 files changed

Lines changed: 86 additions & 42 deletions

File tree

docs/Advanced Configuration/External Database.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PostgreSQL is currently the only supported variant, others will be added on requ
1616
You can configure the new `Datasource` property in your `settings.yml` to connect to your external database:
1717

1818
> #### ⚠️ Note
19-
> _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`._
19+
> _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`._
2020
2121
<Tabs groupId="external-db-config">
2222
<TabItem value="settings" label="Settings File">
@@ -76,7 +76,7 @@ services:
7676
depends_on:
7777
- db
7878
environment:
79-
DOCKER_ENABLE_SECURITY: "true"
79+
DISABLE_ADDITIONAL_FEATURES: "false" "true"
8080
SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: "true"
8181
SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf"
8282
SYSTEM_DATASOURCE_USERNAME: "admin"
@@ -85,7 +85,7 @@ services:
8585
```
8686

8787
- `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
88-
- `DOCKER_ENABLE_SECURITY`: Set this to `true` to enable security features
88+
- `DISABLE_ADDITIONAL_FEATURES`: Set this to `false` to enable security features
8989
- `SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE`: An environment variable to connect to the database container. Set this to `true` to enable use of the external database
9090
- `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.**
9191
- `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
@@ -99,7 +99,7 @@ services:
9999
depends_on:
100100
- db
101101
environment:
102-
DOCKER_ENABLE_SECURITY: "true"
102+
DISABLE_ADDITIONAL_FEATURES: "false" "true"
103103
SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: "true"
104104
SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf"
105105
SYSTEM_DATASOURCE_USERNAME: "admin"

docs/Advanced Configuration/How to add configurations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ There is an additional config file ``/configs/custom_settings.yml`` were users f
9696
9797
- ``SYSTEM_ROOTURIPATH`` ie set to ``/pdf-app`` to Set the application's root URI to ``localhost:8080/pdf-app``
9898
- ``SYSTEM_CONNECTIONTIMEOUTMINUTES`` to set custom connection timeout values
99-
- ``DOCKER_ENABLE_SECURITY`` to tell docker to download security jar (required as true for auth login)
99+
- ``DISABLE_ADDITIONAL_FEATURES`` to tell docker to download security jar (required as false for auth login)
100100
- ``LANGS`` to define custom font libraries to install for use for document conversions
101101
102102
### Local

docs/Advanced Configuration/Single Sign-On Configuration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ Assertion Consumer Service (ACS) URL The default is `stirling`
149149
- `security.saml2.idpSingleLoginUrl`: The URL given by your Provider to initiate the SSO flow
150150
- `security.saml2.idpSingleLogoutUrl`: The URL given by your Provider to initiate the SLO flow
151151
- `security.saml2.idpIssuer`: The name of your Provider
152-
- `security.saml2.idpCert`: The signing certificate given by your Provider in `.pem` format. Place in `src/main/resources`
153-
- `security.saml2.privateKey`: Your private key from your keypair in `.key` format. Place in `src/main/resources`
154-
- `security.saml2.spCert`: classpath:certificate.crt from your keypair in `.crt` format. Place in `src/main/resources`
152+
- `security.saml2.idpCert`: The signing certificate given by your Provider in `.pem` format. Place in `stirling-pdf/src/main/resources`
153+
- `security.saml2.privateKey`: Your private key from your keypair in `.key` format. Place in `stirling-pdf/src/main/resources`
154+
- `security.saml2.spCert`: classpath:certificate.crt from your keypair in `.crt` format. Place in `stirling-pdf/src/main/resources`
155155

156156
### Generating a Keypair
157157

@@ -172,7 +172,7 @@ A self-signed certificate is not verified by a Certificate Authority (CA), which
172172
- `out certificate.crt`: Specifies the output file where the self-signed certificate will be saved
173173

174174
After generating the keypair, the `.key` and `.crt` files should be located in the directory you executed the above command in.
175-
Move the files to `src/main/resources`.
175+
Move the files to `stirling-pdf/src/main/resources`.
176176

177177
Once you have added your configuration, you should see the button for your chosen Provider on the login page prompting you to log in:
178178

@@ -217,7 +217,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2:
217217
</TabItem>
218218
<TabItem value="local" label="Local Environment">
219219
```bash
220-
export DOCKER_ENABLE_SECURITY=true
220+
export DISABLE_ADDITIONAL_FEATURES=false
221221
export SECURITY_ENABLELOGIN=true
222222
export SECURITY_OAUTH2_ENABLED=true
223223
export SECURITY_OAUTH2_AUTOCREATEUSER=false
@@ -244,7 +244,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2:
244244
</TabItem>
245245
<TabItem value="docker-run" label="Docker Run">
246246
```bash
247-
-e DOCKER_ENABLE_SECURITY=true \
247+
-e DISABLE_ADDITIONAL_FEATURES=false \
248248
-e SECURITY_ENABLELOGIN=true \
249249
-e SECURITY_OAUTH2_ENABLED=true \
250250
-e SECURITY_OAUTH2_AUTOCREATEUSER=false \
@@ -271,7 +271,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2:
271271
<TabItem value="docker-compose" label="Docker Compose">
272272
```yaml
273273
environment:
274-
DOCKER_ENABLE_SECURITY=true
274+
DISABLE_ADDITIONAL_FEATURES=false
275275
SECURITY_ENABLELOGIN=true
276276
SECURITY_OAUTH2_ENABLED=true
277277
SECURITY_OAUTH2_AUTOCREATEUSER=false

docs/Advanced Configuration/System and Security.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import TabItem from '@theme/TabItem';
66

77
# Login, System and Security
88

9-
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.
9+
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.
1010

1111
## Basic Security Settings
1212

@@ -19,7 +19,7 @@ Stirling PDF allows customization of system and security settings. For security
1919

2020
### Prerequisites
2121
1. Ensure the `/configs` directory is mounted as a volume in Docker for persistence across updates
22-
2. For Docker users: Set `DOCKER_ENABLE_SECURITY=true` in environment variables
22+
2. For Docker users: Set `DISABLE_ADDITIONAL_FEATURES=false` in environment variables
2323
3. Enable login either via `settings.yml` or set `SECURITY_ENABLELOGIN=true`
2424

2525
### Initial Login Credentials
@@ -76,25 +76,25 @@ When using the API:
7676

7777
**Option 1: Using Java Properties**
7878
```bash
79-
java -jar Stirling-PDF.jar -DDOCKER_ENABLE_SECURITY=true -DSECURITY_ENABLELOGIN=true
79+
java -jar Stirling-PDF.jar -DDISABLE_ADDITIONAL_FEATURES=false -DSECURITY_ENABLELOGIN=true
8080
```
8181

8282
**Option 2: Using Environment Variables**
8383
```bash
84-
export DOCKER_ENABLE_SECURITY=true
84+
export DISABLE_ADDITIONAL_FEATURES=false
8585
export SECURITY_ENABLELOGIN=true
8686
```
8787
</TabItem>
8888
<TabItem value="docker-run" label="Docker Run">
8989
```bash
90-
-e DOCKER_ENABLE_SECURITY=true \
90+
-e DISABLE_ADDITIONAL_FEATURES=false \
9191
-e SECURITY_ENABLELOGIN=true \
9292
```
9393
</TabItem>
9494
<TabItem value="docker-compose" label="Docker Compose">
9595
```yaml
9696
environment:
97-
DOCKER_ENABLE_SECURITY: true
97+
DISABLE_ADDITIONAL_FEATURES: false true
9898
SECURITY_ENABLELOGIN: true
9999
```
100100
</TabItem>

docs/Advanced Configuration/UI Customisation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,29 @@ To override a file:
4949
3. Create the same file path under your `customFiles` directory following the same directory structure
5050
4. Paste and modify the contents as needed
5151

52-
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.
52+
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.
5353

5454
1. To replace the favicon:
5555
```
5656
customFiles/static/favicon.svg
5757
```
58-
Original file: [src/main/resources/static/favicon.svg](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/src/main/resources/static/favicon.svg)
58+
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)
5959

6060
2. To override a Bootstrap icon font:
6161
```
6262
customFiles/static/css/fonts/bootstrap-icons.woff
6363
```
64-
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)
64+
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)
6565

6666
3. To modify a template:
6767
```
6868
customFiles/templates/fragments/common.html
6969
```
70-
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)
70+
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)
7171

7272
The original files can be found in the GitHub repository under:
73-
- Static files: [src/main/resources/static/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/src/main/resources/static)
74-
- Templates (HTML files): [src/main/resources/templates/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/src/main/resources/templates)
73+
- Static files: [stirling-pdf/src/main/resources/static/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/stirling-pdf/src/main/resources/static)
74+
- Templates (HTML files): [stirling-pdf/src/main/resources/templates/](https://github.com/Stirling-Tools/Stirling-PDF/tree/main/stirling-pdf/src/main/resources/templates)
7575

7676

7777

docs/Enterprise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tags:
1313

1414
Stirling PDF offers an Enterprise edition of its software. This is the same great software but with added features and comforts.
1515

16-
## Whats included
16+
## What's included
1717

1818
- Prioritised Support tickets via support@stirlingpdf.com to reach the Stirling-PDF team for support and 1:1 meetings where applicable (Provided they come from same email domain registered with us)
1919
- Prioritised Enhancements to Stirling-PDF where applicable

docs/Installation/Docker Install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ docker run -d \
2727
-v "./StirlingPDF/customFiles:/customFiles/" \
2828
-v "./StirlingPDF/logs:/logs/" \
2929
-v "./StirlingPDF/pipeline:/pipeline/" \
30-
-e DOCKER_ENABLE_SECURITY=false \
30+
-e DISABLE_ADDITIONAL_FEATURES=true \
3131
-e LANGS=en_GB \
3232
docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest
3333
```
@@ -49,7 +49,7 @@ services:
4949
- ./StirlingPDF/logs:/logs/
5050
- ./StirlingPDF/pipeline:/pipeline/
5151
environment:
52-
- DOCKER_ENABLE_SECURITY=false
52+
- DISABLE_ADDITIONAL_FEATURES=false
5353
- LANGS=en_GB
5454
```
5555

docs/Installation/Unix.md

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 2
33
id: Unix Installation
44
title: Unix installation Guide
55
---
6+
67
import Tabs from '@theme/Tabs';
78
import TabItem from '@theme/TabItem';
89

@@ -66,7 +67,19 @@ Install the following software, if not already installed:
6667
### Step 2: Clone and Build jbig2enc (Only required for certain OCR functionality)
6768

6869
<Tabs groupId="unix-systems">
69-
<TabItem value="debian-fedora" label="Debian/Fedora">
70+
<TabItem value="debian" label="Debian">
71+
```bash
72+
mkdir ~/.git
73+
cd ~/.git &&\
74+
git clone https://github.com/agl/jbig2enc.git &&\
75+
cd jbig2enc &&\
76+
./autogen.sh &&\
77+
./configure &&\
78+
make &&\
79+
sudo make install
80+
```
81+
</TabItem>
82+
<TabItem value="fedora" label="Fedora">
7083
```bash
7184
mkdir ~/.git
7285
cd ~/.git &&\
@@ -90,6 +103,7 @@ Install the following software, if not already installed:
90103
Next we need to install LibreOffice for conversions, tesseract for OCR, and opencv for pattern recognition functionality.
91104

92105
Install the following software:
106+
93107
- libreoffice (libreoffice-core libreoffice-common libreoffice-writer libreoffice-calc libreoffice-impress)
94108
- python3-uno
95109
- unoserver
@@ -119,23 +133,33 @@ Install the following software:
119133
</Tabs>
120134

121135
### Step 4: Grab latest Stirling-PDF Jar
122-
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)
136+
137+
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)
123138

124139
### Step 5: Move jar to desired location
140+
125141
You can move this file to a desired location, for example, `/opt/Stirling-PDF/`.
126142
You must also move the Script folder within the Stirling-PDF repo that you have downloaded to this directory.
127143
This folder is required for the python scripts using OpenCV.
128144

129145
<Tabs groupId="user-type">
130-
<TabItem value="root" label="Root User">
146+
<TabItem value="debian" label="Debian (Root)">
147+
```bash
148+
sudo mkdir /opt/Stirling-PDF &&\
149+
sudo mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ &&\
150+
sudo mv scripts /opt/Stirling-PDF/ &&\
151+
echo "Scripts installed."
152+
```
153+
</TabItem>
154+
<TabItem value="fedora" label="Fedora (Root)">
131155
```bash
132156
sudo mkdir /opt/Stirling-PDF &&\
133157
sudo mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ &&\
134158
sudo mv scripts /opt/Stirling-PDF/ &&\
135159
echo "Scripts installed."
136160
```
137161
</TabItem>
138-
<TabItem value="non-root" label="Non-root User">
162+
<TabItem value="nix" label="Nix (Non-root)">
139163
```bash
140164
mv ./build/libs/Stirling-PDF-*.jar ./Stirling-PDF-*.jar
141165
```
@@ -152,7 +176,7 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi
152176
sudo apt update &&\
153177
# All languages
154178
# sudo apt install -y 'tesseract-ocr-*'
155-
179+
156180
# Find languages:
157181
apt search tesseract-ocr-
158182

@@ -164,7 +188,7 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi
164188
```bash
165189
# All languages
166190
# sudo dnf install -y tesseract-langpack-*
167-
191+
168192
# Find languages:
169193
dnf search -C tesseract-langpack-
170194

@@ -184,28 +208,41 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi
184208
3. Please view [tesseract install guide](https://tesseract.readthedocs.io/en/latest/installation.html) for more info.
185209

186210
**IMPORTANT:** DO NOT REMOVE EXISTING `eng.traineddata`, IT'S REQUIRED.
211+
187212
</TabItem>
188213
</Tabs>
189214

190215
### Step 7: Run Stirling-PDF
191216

217+
<Tabs groupId="unix-systems">
218+
<TabItem value="debian" label="Debian-based Systems">
192219
```bash
193220
java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar
194221
```
195-
196-
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:
197-
```
198-
[Thread-7] INFO s.s.SPDF.utils.ProcessExecutor - mkdir: cannot create directory '/run/user/1501': Permission denied
222+
</TabItem>
223+
<TabItem value="fedora" label="Fedora-based Systems">
224+
```bash
225+
java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar
199226
```
200-
To resolve this, use:
227+
</TabItem>
228+
<TabItem value="nix" label="Nix Package Manager">
201229
```bash
202-
mkdir temp
203-
export DBUS_SESSION_BUS_ADDRESS="unix:path=./temp"
204-
```
230+
java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar
231+
```
232+
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:
233+
`[Thread-7] INFO s.s.SPDF.utils.ProcessExecutor - mkdir: cannot create directory '/run/user/1501': Permission denied`
234+
To resolve this, use:
235+
`bash
236+
mkdir temp
237+
export DBUS_SESSION_BUS_ADDRESS="unix:path=./temp"
238+
`
239+
</TabItem>
240+
</Tabs>
205241

206242
### Step 8: Adding a Desktop Icon
207243

208244
This will add a modified Appstarter to your Appmenu.
245+
209246
```bash
210247
location=$(pwd)/gradlew
211248
image=$(pwd)/docs/stirling-transparent.svg
@@ -248,17 +285,21 @@ SERVER_PORT="3000"
248285
### Optional: Run Stirling-PDF as a service (requires root).
249286

250287
First create a .env file, where you can store environment variables:
288+
251289
```
252290
touch /opt/Stirling-PDF/.env
253291
```
292+
254293
In this file you can add all variables, one variable per line, as stated in the main readme (for example SYSTEM_DEFAULTLOCALE="de-DE").
255294

256295
Create a new file where we store our service settings and open it with nano editor:
296+
257297
```
258298
nano /etc/systemd/system/stirlingpdf.service
259299
```
260300

261301
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:
302+
262303
```
263304
[Unit]
264305
Description=Stirling-PDF service
@@ -288,16 +329,19 @@ sudo systemctl daemon-reload
288329
```
289330

290331
Enable the service to tell the service to start it automatically:
332+
291333
```
292334
sudo systemctl enable stirlingpdf.service
293335
```
294336

295337
See the status of the service:
338+
296339
```
297340
sudo systemctl status stirlingpdf.service
298341
```
299342

300343
Manually start/stop/restart the service:
344+
301345
```
302346
sudo systemctl start stirlingpdf.service
303347
sudo systemctl stop stirlingpdf.service
@@ -327,4 +371,4 @@ system:
327371
operations:
328372
weasyprint: "" #Defaults to /opt/venv/bin/weasyprint
329373
unoconvert: "" #Defaults to /opt/venv/bin/unoconvert
330-
```
374+
```

0 commit comments

Comments
 (0)