Skip to content
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

BUG: DOCKER_ENABLE_SECURITY=true will cause the service to fail to start #1040

Closed
Czj1997-02 opened this issue Apr 8, 2024 · 5 comments
Closed

Comments

@Czj1997-02
Copy link

I use the following configuration for installation,Found that the ./configs is not mapped outside the container and the service cannot access it

version: '3.3'
services:
  stirling-pdf:
    image: frooodle/s-pdf:latest
    container_name: pdf
    restart: always
    ports:
      - '9998:8080'
    volumes:
      - /opt/pdf/trainingData:/usr/share/tessdata #Required for extra OCR languages
      - /opt/pdf/extraConfigs:/configs
      - /opt/pdf/customFiles:/customFiles/
      - /opt/pdf/logs:/logs/
    environment:
      - DOCKER_ENABLE_SECURITY=true
      - INSTALL_BOOK_AND_ADVANCED_HTML_OPS=true
      - SYSTEM_DEFAULTLOCALE=zh_CN
      - SECURITY_ENABLE_LOGIN=true
      - SECURITY_INITIALLOGIN_USERNAME=username
      - SECURITY_INITIALLOGIN_PASSWORD=password
@xavier-GitHub76
Copy link

Hello,
the documentation (https://hub.docker.com/r/frooodle/s-pdf or https://github.com/Stirling-Tools/Stirling-PDF) has a mistake for the SECURITY_ENABLE_LOGIN parameter.
The good name is SECURITY_ENABLELOGIN
Best regards

@Czj1997-02
Copy link
Author

@xavier-GitHub76 Thank for your advice,but in Readme.md is that:

User must have the folder ./configs volumed within docker so that it is retained during updates.
Docker uses must download the security jar version by setting DOCKER_ENABLE_SECURITY to true in environment variables.
Then either enable login via the settings.yml file or via setting SECURITY_ENABLE_LOGIN to true
Now the initial user will be generated with username admin and password stirling. On login you will be forced to change the password to a new one. You can also use the environment variables SECURITY_INITIALLOGIN_USERNAME and SECURITY_INITIALLOGIN_PASSWORD to set your own straight away (Recommended to remove them after user creation).

and I try your advice was error too. I think the problem is in DOCKER_ENABLE_SECURITY=true ,There is an issue with the corresponding pulled image resources.

@xavier-GitHub76
Copy link

I install Stirling this morning (with SECURITY_ENABLE_LOGIN).
Having mistake during authentification, I search a similar installation :
https://www.youtube.com/watch?v=ZQKRAeM9kDM&t=533s

We could see the SECURITY_ENABLELOGIN parameter :
image

I change SECURITY_ENABLE_LOGIN in SECURITY_ENABLELOGIN
and I succedd to login.

My docker-compose :

with version: '3.8'

services:

L'application

stirling-pdf:
image: frooodle/s-pdf:latest
container_name: stirling-pdf
deploy:
restart_policy:
condition: on-failure
delay: 5s # Délai d'attente avant une nouvelle tentative
max_attempts: 3 # Nombre maximal de redémarrages
window: 30s # Durée après laquelle un démarrage est considéré OK si aucune erreur n'est survenue
ports:
- "16928:8080"
volumes:
- /volume1/docker/stirling-pdf/ocr:/usr/share/tesseract-ocr/5/tessdata
- /volume1/docker/stirling-pdf/config:/configs
environment:
- DOCKER_ENABLE_SECURITY=true
- SECURITY_ENABLELOGIN=true
- SECURITY_INITIALLOGIN_USERNAME=username
- SECURITY_INITIALLOGIN_PASSWORD=password
- SYSTEM_DEFAULTLOCALE=fr-FR

The result :
image
image

@Frooodle
Copy link
Member

I have tested
SECURITY_ENABLELOGIN and SECURITY_ENABLE_LOGIN Both function the same on my machine and both enable the login functionality

in regards to the initial OP post if the docker can not access configs than it wont be able to start as it is a requirement.
This is not a bug

@Czj1997-02
Copy link
Author

@Frooodle Thank !!!That's success, but need to wait for a certain amount of time

version: '3.3'
services:
  stirling-pdf:
    image: frooodle/s-pdf:latest
    container_name: pdf
    restart: always
    ports:
      - '9998:8080'
    volumes:
      - /opt/pdf/trainingData:/usr/share/tessdata
      - /opt/pdf/customFiles:/customFiles/
      - /opt/pdf/logs:/logs/
      - /opt/pdf/ocr:/usr/share/tesseract-ocr/5/tessdata
      - /opt/pdf/config:/configs
    environment:
      - DOCKER_ENABLE_SECURITY=true
      - SECURITY_ENABLELOGIN=true
      - SECURITY_INITIALLOGIN_USERNAME=username
      - SECURITY_INITIALLOGIN_PASSWORD=password
      - SYSTEM_DEFAULTLOCALE=zh_CN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants