API docker container doesn't start when config.yml is imported as a secret #140

Closed
opened 2025-11-01 20:48:33 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @5p4k on GitHub (Jun 11, 2023).

Description

When /app/vikunja/config.yml is provided as a docker secret (or, I presume, a docker config would amount to the same), it is part of the read-only filesystem. Therefore the API container fails here at chown vikunja:vikunja . with

info: creating the new user vikunja with 1000:1000
usermod: no changes
chown: ./config.yml: Read-only file system

and is instantly restarted. Setting uid and gid to 1000 on the file does not work because chown is executed nonetheless.

Not all options in the config.yml can be configured via environment variables, e.g. OpenID, therefore it is not possible to work around this issue without customizing the entry point or setting PGID/PUID.


I'm attaching a MVE docker-compose.yml:

version: '3'

services:
  api:
    image: vikunja/api
    secrets:
      - source: vikunja-config
        target: /app/vikunja/config.yml
        uid: "1000"
        gid: "1000"

secrets:
  vikunja-config:
    file: vikunja-config.yml

You can test that the container fails with

# In the folder where the compose file is:
touch vikunja-config.yml
docker compose up

Vikunja Frontend Version

0.20.5

Vikunja API Version

0.20.4

Browser and version

n/a

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @5p4k on GitHub (Jun 11, 2023). ### Description When `/app/vikunja/config.yml` is provided as a docker secret (or, I presume, a docker config would amount to the same), it is part of the read-only filesystem. Therefore the API container fails [here](https://github.com/go-vikunja/api/blob/4a4ba041e0f3e9c71dd4844d5191c9cbe4e4e3b7/docker/entrypoint.sh#L10) at `chown vikunja:vikunja .` with ``` info: creating the new user vikunja with 1000:1000 usermod: no changes chown: ./config.yml: Read-only file system ``` and is instantly restarted. Setting `uid` and `gid` to 1000 on the file does not work because chown is executed nonetheless. Not all options in the `config.yml` can be configured via environment variables, e.g. [OpenID](https://community.vikunja.io/t/configure-openid-via-environment/628/3), therefore it is not possible to work around this issue without customizing the entry point or setting `PGID`/`PUID`. --- I'm attaching a MVE `docker-compose.yml`: ```yaml version: '3' services: api: image: vikunja/api secrets: - source: vikunja-config target: /app/vikunja/config.yml uid: "1000" gid: "1000" secrets: vikunja-config: file: vikunja-config.yml ``` You can test that the container fails with ```shell # In the folder where the compose file is: touch vikunja-config.yml docker compose up ``` ### Vikunja Frontend Version 0.20.5 ### Vikunja API Version 0.20.4 ### Browser and version n/a ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Jun 11, 2023):

Does it work with the unstable image? (Make a backup first)

@kolaente commented on GitHub (Jun 11, 2023): Does it work with the unstable image? (Make a backup first)
Author
Owner

@5p4k commented on GitHub (Jun 11, 2023):

vikunja/api:unstable works! I see now 80266d1, that seems to fix the issue.

Sorry for the noise -- closing as fixed by 80266d1.

@5p4k commented on GitHub (Jun 11, 2023): `vikunja/api:unstable` works! I see now 80266d1, that seems to fix the issue. Sorry for the noise -- closing as fixed by 80266d1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#140