sissbruecker / linkding

Self-hosted bookmark manager that is designed be to be minimal, fast, and easy to set up using Docker.
MIT License
5.36k stars 263 forks source link

Secretkey is not in the actual data directory: `PermissionError: [Errno 13] Permission denied: '/etc/linkding/secretkey.txt'` #632

Closed bphenriques closed 4 months ago

bphenriques commented 5 months ago

Hello,

I am running the container as follows:

version: "3.8"

# Bookmark manager
# https://github.com/sissbruecker/linkding/releases
services:
  linkding:
    image: sissbruecker/linkding:latest
    container_name: linkding
    hostname: linkding
    user: "${PUID}:${PGID}"
    volumes:
      - "${DATA_DIR}/linkding:/etc/linkding/data"
    restart: unless-stopped
    networks:
      - linkding

networks:
  linkding:
    external: true

My latest should cover the latest changes as I have just ran locally with --pull flag.

I would like the secret key to be stored under /etc/linkding/data but it is actually being stored in /etc/linkding. Noticed that this PR was merged and got me confused.

The full trace:

linkding  | Traceback (most recent call last):
linkding  |   File "/etc/linkding/manage.py", line 21, in <module>
linkding  |     main()
linkding  |   File "/etc/linkding/manage.py", line 17, in main
linkding  |     execute_from_command_line(sys.argv)
linkding  |   File "/opt/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
linkding  |     utility.execute()
linkding  |   File "/opt/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
linkding  |     self.fetch_command(subcommand).run_from_argv(self.argv)
linkding  |   File "/opt/venv/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
linkding  |     self.execute(*args, **cmd_options)
linkding  |   File "/opt/venv/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
linkding  |     output = self.handle(*args, **options)
linkding  |   File "/opt/venv/lib/python3.10/site-packages/django_generate_secret_key/management/commands/generate_secret_key.py", line 50, in handle
linkding  |     secret = open(key_filepath, 'w')
linkding  | PermissionError: [Errno 13] Permission denied: '/etc/linkding/secretkey.txt'
linkding  | 2024-02-16 15:14:14,479 INFO Skip creating initial superuser, user already exist

I have other errors related with the fact I am using user: ... but seem to not have effect (can open a new ticket):

linkding  | 2024-02-16 15:14:14,479 INFO Skip creating initial superuser, user already exists
linkding  | chown: changing ownership of '/etc/linkding/data/db.sqlite3': Operation not permitted
linkding  | chown: changing ownership of '/etc/linkding/data/favicons': Operation not permitted
linkding  | chown: changing ownership of '/etc/linkding/data': Operation not permitted

Edit: 1.24.0 (latest) (copied from the UI). It does not seem to block the server from starting and use 3rd party integrations.

sissbruecker commented 4 months ago

The linked PR is merged, but not released. I'll wait for some of the open PRs to get resolved, then I'll do a new release.