Skip to content

Commit dc91e0c

Browse files
authored
Revert "Updated file paths and security environment variable" (#81)
1 parent c2c1b8c commit dc91e0c

File tree

8 files changed

+43
-87
lines changed

8 files changed

+43
-87
lines changed

docs/Advanced Configuration/External Database.md

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

2020
> #### ⚠️ Note
21-
> _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`._
21+
> _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`._
2222
2323
<Tabs groupId="external-db-config">
2424
<TabItem value="settings" label="Settings File">
@@ -78,7 +78,7 @@ services:
7878
depends_on:
7979
- db
8080
environment:
81-
DISABLE_ADDITIONAL_FEATURES: "false" "true"
81+
DOCKER_ENABLE_SECURITY: "true"
8282
SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: "true"
8383
SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf"
8484
SYSTEM_DATASOURCE_USERNAME: "admin"
@@ -87,7 +87,7 @@ services:
8787
```
8888

8989
- `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
90-
- `DISABLE_ADDITIONAL_FEATURES`: Set this to `false` to enable security features
90+
- `DOCKER_ENABLE_SECURITY`: Set this to `true` to enable security features
9191
- `SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE`: An environment variable to connect to the database container. Set this to `true` to enable use of the external database
9292
- `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.**
9393
- `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:
101101
depends_on:
102102
- db
103103
environment:
104-
DISABLE_ADDITIONAL_FEATURES: "false" "true"
104+
DOCKER_ENABLE_SECURITY: "true"
105105
SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: "true"
106106
SYSTEM_DATASOURCE_CUSTOMDATABASEURL: "jdbc:postgresql://db:5432/stirling_pdf"
107107
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
@@ -175,7 +175,7 @@ There is an additional config file ``/configs/custom_settings.yml`` where users
175175
176176
- ``SYSTEM_ROOTURIPATH`` ie set to ``/pdf-app`` to Set the application's root URI to ``localhost:8080/pdf-app``
177177
- ``SYSTEM_CONNECTIONTIMEOUTMINUTES`` to set custom connection timeout values
178-
- ``DISABLE_ADDITIONAL_FEATURES`` to tell docker to download security jar (required as false for auth login)
178+
- ``DOCKER_ENABLE_SECURITY`` to tell docker to download security jar (required as true for auth login)
179179
- ``LANGS`` to define custom font libraries to install for use for document conversions
180180
181181
### Local

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

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

158158
### Generating a Keypair
159159

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

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

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

@@ -222,7 +222,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2:
222222
</TabItem>
223223
<TabItem value="local" label="Local Environment">
224224
```bash
225-
export DISABLE_ADDITIONAL_FEATURES=false
225+
export DOCKER_ENABLE_SECURITY=true
226226
export SECURITY_ENABLELOGIN=true
227227
export SECURITY_OAUTH2_ENABLED=true
228228
export SECURITY_OAUTH2_AUTOCREATEUSER=false
@@ -249,7 +249,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2:
249249
</TabItem>
250250
<TabItem value="docker-run" label="Docker Run">
251251
```bash
252-
-e DISABLE_ADDITIONAL_FEATURES=false \
252+
-e DOCKER_ENABLE_SECURITY=true \
253253
-e SECURITY_ENABLELOGIN=true \
254254
-e SECURITY_OAUTH2_ENABLED=true \
255255
-e SECURITY_OAUTH2_AUTOCREATEUSER=false \
@@ -276,7 +276,7 @@ Below are examples of the full configuration for both OAuth 2 and SAML 2:
276276
<TabItem value="docker-compose" label="Docker Compose">
277277
```yaml
278278
environment:
279-
DISABLE_ADDITIONAL_FEATURES=false
279+
DOCKER_ENABLE_SECURITY=true
280280
SECURITY_ENABLELOGIN=true
281281
SECURITY_OAUTH2_ENABLED=true
282282
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 `DISABLE_ADDITIONAL_FEATURES` to `false` 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 `DOCKER_ENABLE_SECURITY` to `true` 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 `DISABLE_ADDITIONAL_FEATURES=false` in environment variables
22+
2. For Docker users: Set `DOCKER_ENABLE_SECURITY=true` 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 -DDISABLE_ADDITIONAL_FEATURES=false -DSECURITY_ENABLELOGIN=true
79+
java -jar Stirling-PDF.jar -DDOCKER_ENABLE_SECURITY=true -DSECURITY_ENABLELOGIN=true
8080
```
8181

8282
**Option 2: Using Environment Variables**
8383
```bash
84-
export DISABLE_ADDITIONAL_FEATURES=false
84+
export DOCKER_ENABLE_SECURITY=true
8585
export SECURITY_ENABLELOGIN=true
8686
```
8787
</TabItem>
8888
<TabItem value="docker-run" label="Docker Run">
8989
```bash
90-
-e DISABLE_ADDITIONAL_FEATURES=false \
90+
-e DOCKER_ENABLE_SECURITY=true \
9191
-e SECURITY_ENABLELOGIN=true \
9292
```
9393
</TabItem>
9494
<TabItem value="docker-compose" label="Docker Compose">
9595
```yaml
9696
environment:
97-
DISABLE_ADDITIONAL_FEATURES: false true
97+
DOCKER_ENABLE_SECURITY: 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
@@ -50,29 +50,29 @@ To override a file:
5050
3. Create the same file path under your `customFiles` directory following the same directory structure
5151
4. Paste and modify the contents as needed
5252

53-
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.
53+
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.
5454

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

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

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

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

7777

7878

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 DISABLE_ADDITIONAL_FEATURES=true \
30+
-e DOCKER_ENABLE_SECURITY=false \
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-
- DISABLE_ADDITIONAL_FEATURES=false
52+
- DOCKER_ENABLE_SECURITY=false
5353
- LANGS=en_GB
5454
```
5555

docs/Installation/Unix.md

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

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

6968
<Tabs groupId="unix-systems">
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">
69+
<TabItem value="debian-fedora" label="Debian/Fedora">
8370
```bash
8471
mkdir ~/.git
8572
cd ~/.git &&\
@@ -103,7 +90,6 @@ Install the following software, if not already installed:
10390
Next we need to install LibreOffice for conversions, tesseract for OCR, and opencv for pattern recognition functionality.
10491

10592
Install the following software:
106-
10793
- libreoffice (libreoffice-core libreoffice-common libreoffice-writer libreoffice-calc libreoffice-impress)
10894
- python3-uno
10995
- unoserver
@@ -133,33 +119,23 @@ Install the following software:
133119
</Tabs>
134120

135121
### Step 4: Grab latest Stirling-PDF 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)
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)
138123

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

145129
<Tabs groupId="user-type">
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)">
130+
<TabItem value="root" label="Root User">
155131
```bash
156132
sudo mkdir /opt/Stirling-PDF &&\
157133
sudo mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ &&\
158134
sudo mv scripts /opt/Stirling-PDF/ &&\
159135
echo "Scripts installed."
160136
```
161137
</TabItem>
162-
<TabItem value="nix" label="Nix (Non-root)">
138+
<TabItem value="non-root" label="Non-root User">
163139
```bash
164140
mv ./build/libs/Stirling-PDF-*.jar ./Stirling-PDF-*.jar
165141
```
@@ -176,7 +152,7 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi
176152
sudo apt update &&\
177153
# All languages
178154
# sudo apt install -y 'tesseract-ocr-*'
179-
155+
180156
# Find languages:
181157
apt search tesseract-ocr-
182158

@@ -188,7 +164,7 @@ If you plan to use the OCR (Optical Character Recognition) functionality, you mi
188164
```bash
189165
# All languages
190166
# sudo dnf install -y tesseract-langpack-*
191-
167+
192168
# Find languages:
193169
dnf search -C tesseract-langpack-
194170

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

210186
**IMPORTANT:** DO NOT REMOVE EXISTING `eng.traineddata`, IT'S REQUIRED.
211-
212187
</TabItem>
213188
</Tabs>
214189

215190
### Step 7: Run Stirling-PDF
216191

217-
<Tabs groupId="unix-systems">
218-
<TabItem value="debian" label="Debian-based Systems">
219192
```bash
220193
java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar
221194
```
222-
</TabItem>
223-
<TabItem value="fedora" label="Fedora-based Systems">
224-
```bash
225-
java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar
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:
226197
```
227-
</TabItem>
228-
<TabItem value="nix" label="Nix Package Manager">
229-
```bash
230-
java -jar /opt/Stirling-PDF/Stirling-PDF-*.jar
198+
[Thread-7] INFO s.s.SPDF.utils.ProcessExecutor - mkdir: cannot create directory '/run/user/1501': Permission denied
231199
```
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>
200+
To resolve this, use:
201+
```bash
202+
mkdir temp
203+
export DBUS_SESSION_BUS_ADDRESS="unix:path=./temp"
204+
```
241205

242206
### Step 8: Adding a Desktop Icon
243207

244208
This will add a modified Appstarter to your Appmenu.
245-
246209
```bash
247210
location=$(pwd)/gradlew
248211
image=$(pwd)/docs/stirling-transparent.svg
@@ -285,21 +248,17 @@ SERVER_PORT="3000"
285248
### Optional: Run Stirling-PDF as a service (requires root).
286249

287250
First create a .env file, where you can store environment variables:
288-
289251
```
290252
touch /opt/Stirling-PDF/.env
291253
```
292-
293254
In this file you can add all variables, one variable per line, as stated in the main readme (for example SYSTEM_DEFAULTLOCALE="de-DE").
294255

295256
Create a new file where we store our service settings and open it with nano editor:
296-
297257
```
298258
nano /etc/systemd/system/stirlingpdf.service
299259
```
300260

301261
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-
303262
```
304263
[Unit]
305264
Description=Stirling-PDF service
@@ -329,19 +288,16 @@ sudo systemctl daemon-reload
329288
```
330289

331290
Enable the service to tell the service to start it automatically:
332-
333291
```
334292
sudo systemctl enable stirlingpdf.service
335293
```
336294

337295
See the status of the service:
338-
339296
```
340297
sudo systemctl status stirlingpdf.service
341298
```
342299

343300
Manually start/stop/restart the service:
344-
345301
```
346302
sudo systemctl start stirlingpdf.service
347303
sudo systemctl stop stirlingpdf.service
@@ -371,4 +327,4 @@ system:
371327
operations:
372328
weasyprint: "" #Defaults to /opt/venv/bin/weasyprint
373329
unoconvert: "" #Defaults to /opt/venv/bin/unoconvert
374-
```
330+
```

0 commit comments

Comments
 (0)