mbentley / docker-timemachine

Docker image to run Samba (compatible Time Machine for macOS)
Apache License 2.0
527 stars 65 forks source link

[Bug]: Changes in #138 break PASSWORD_FILE functionality #139

Closed nonsavant closed 11 months ago

nonsavant commented 1 year ago

Describe the Bug

I am defining PASSWORD_FILE in my docker compose and I am not defining PASSWORD.

However, the app fails to start and the log contains the following error message

ERROR: PASSWORD and PASSWORD_FILE can not both be set. Please choose 1

Expected Behavior

The app starts, the error message doesn't occur.

Steps to Reproduce

Nothing more to add.

How You're Launching the Container

version: "3.6"
secrets:
  timemachine_password:
    file: $DOCKERDIR/secrets/timemachine_password
services:
  timemachine:
    image: mbentley/timemachine:latest
    container_name: timemachine
    network_mode: "host"
    secrets:
      - timemachine_password
    environment:
      - CUSTOM_SMB_CONF=false
      - CUSTOM_USER=false
      - DEBUG_LEVEL=1
      - EXTERNAL_CONF=
      - HIDE_SHARES=no
      - MIMIC_MODEL=TimeCapsule8,119
      - TM_USERNAME=username
      - TM_GROUPNAME=docker
      - TM_UID=${PUID}
      - TM_GID=${PGID}
      - PASSWORD_FILE=/run/secrets/timemachine_password
      - SET_PERMISSIONS=false
      - SHARE_NAME=TimeMachine
      - SMB_INHERIT_PERMISSIONS=no
      - SMB_NFS_ACES=yes
      - SMB_METADATA=stream
      - SMB_PORT=445
      - SMB_VFS_OBJECTS=acl_xattr fruit streams_xattr
      - VOLUME_SIZE_LIMIT=0
      - WORKGROUP=WORKGROUP
    restart: always
    # ports:
    #   - "137:137/udp"
    #   - "138:138/udp"
    #   - "139:139"
    volumes:
      - /mounted-backup-drive:/opt/user
      - timemachine-var-lib-samba:/var/lib/samba
      - timemachine-var-cache-samba:/var/cache/samba
      - timemachine-run-samba:/run/samba
    ulimits:
      nofile:
        soft: 65536
        hard: 65536

volumes:
  timemachine-var-lib-samba:
  timemachine-var-cache-samba:
  timemachine-run-samba:

Container Logs

ERROR: PASSWORD and PASSWORD_FILE can not both be set. Please choose 1

Additional Context

I've been running this container for a long time with the same config (docker compose) with no problems, so I suspect that a recent update as led to this bug.

mbentley commented 1 year ago

https://github.com/mbentley/docker-timemachine/pull/138 did cause this. Looking into it.

mbentley commented 1 year ago

In the meantime, mbentley/timemachine:smb-20230604 was the last image before #138 was merged in so that will temporarily get you back up and running.

mbentley commented 1 year ago

Also just reverted the change as the feature request in #137 is going to need some reworking so latest should be working again.

shred86 commented 1 year ago

I had this same issue but the latest version resolved it, thanks!