Stirling-Tools / Stirling-PDF

#1 Locally hosted web application that allows you to perform various operations on PDF files
https://stirlingpdf.com
MIT License
43.58k stars 3.54k forks source link

How to correctly pass docker environment variables #333

Closed dannykorpan closed 1 year ago

dannykorpan commented 1 year ago

Hi,

how do I correctly pass environment variables for e.g. the default language in a docker compose file? Here is my docker compose, but the language is still English and not German. What is wrong here?

version: '3.3'
services:
    s-pdf:
      restart: always
      container_name: pdftools
      labels:
        - "com.centurylinklabs.watchtower.enable=true"
      image: frooodle/s-pdf
      volumes:
        - /opt/docker/pdftools/tessdata:/usr/share/tesseract-ocr/4.00/tessdata
      networks:
        - default
      environment:
        - defaultLocale="de-DE"
        - googlevisibility="false"

networks:
  default:
    name: www
    external: true

Thank you for any help in advance Danny

Frooodle commented 1 year ago

This recently got changed in the v0.13.0 update onwards please follow https://github.com/Frooodle/Stirling-PDF#customisation for instructions ie instead of defaultLocale it should be SYSTEM_DEFAULTLOCALE

Frooodle commented 1 year ago

Let me know if that works fine

kerberjc commented 1 year ago

It doesn't seem to work for SYSTEM_ROOTPATH... I have tried "pdf", "/pdf" "/pdf/" and "https://fulldomain/pdf"

Frooodle commented 1 year ago

Ahh I see issue Sorry the migration of properties has been more awkward than I thought I will fix this in next patch

Frooodle commented 1 year ago

Can you try SYSTEM_ROOTURIPATH ?

2004gixxer600 commented 1 year ago

Also having issues. I can't seem to get the right settings with the newest version. Lost the ability to custom brand etc. Tried a variety of things, will wait till updates to the documentation etc.

kerberjc commented 1 year ago

Can you try SYSTEM_ROOTURIPATH ?

Was able to get that to work with "/pdf"

NRL-LEastham commented 1 year ago

I've just done a new install and even the config file seems to be ignored at the moment. Neither my docker environment or the settings file options are being used. This is on the latest docker image.

Frooodle commented 1 year ago

Also having issues. I can't seem to get the right settings with the newest version. Lost the ability to custom brand etc. Tried a variety of things, will wait till updates to the documentation etc.

I have already updated documentation on this image If you want to change the app name etc via env variables then you can use

UI_APPNAME UI_HOMEDESCRIPTION etc

Frooodle commented 1 year ago

I've just done a new install and even the config file seems to be ignored at the moment. Neither my docker environment or the settings file options are being used. This is on the latest docker image.

Cant reproduce this, case you raise as a new issue and ill see if i can reproduce, are you using security mode?

2004gixxer600 commented 1 year ago

Got it. All set, I misinterpreted the new instructions. thanks!

Frooodle commented 1 year ago

Any way i could word it better?

2004gixxer600 commented 1 year ago

Maybe have a docker-compose example file with all the environment variable options spelled out with # and users can just remove the comment and use the ones they need?

NRL-LEastham commented 1 year ago

I've just done a new install and even the config file seems to be ignored at the moment. Neither my docker environment or the settings file options are being used. This is on the latest docker image.

Cant reproduce this, case you raise as a new issue and ill see if i can reproduce, are you using security mode?

I've rebuilt it today and removed the env variables from the docker compose. It's now picking up the settings from the config file. Thanks.

B0F1B0 commented 1 year ago

Maybe have a docker-compose example file with all the environment variable options spelled out with # and users can just remove the comment and use the ones they need?

 environment:
      - DOCKER_ENABLE_SECURITY=true
      - SECURITY_ENABLELOGIN=true     #Default username: admin and password: stirling 
      - SYSTEM_DEFAULTLOCALE=de-DE
      - SYSTEM_GOOGLEVISIBILITY=false
      - UI_APPNAMENAVBAR=appnamenavbar-test
      - UI_APPNAME=DOCKER PDF
      - UI_HOMEDESCRIPTION=------> AWESOME PDF TOOL IN DOCKER <------
      - METRICS_ENABLED=false # API CAllS are not allowed e.g. http://<IP>:<PORT>/api/v1/uptime
      #- ENDPOINTS_TOREMOVE=img-to-pdf, remove-pages

image