mbentley / docker-timemachine

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

Multiple Users: "/users" was not found #117

Closed gbomacfly closed 9 months ago

gbomacfly commented 2 years ago

Hello,

I am trying to get multiple users working. I have a external complete empty 4TB HDD, which is mounted to /mnt/TimeMachine in exFat My config is in /opt/docker-compose/timemachine In singleusermode it works as expected, but if I try multiple users, I get the following error:

/opt/docker-compose/timemachine $ docker-compose down && docker-compose up -d && docker logs -f timemachine
Stopping timemachine ... done
Removing timemachine ... done
Creating timemachine ... done
INFO: CUSTOM_SMB_CONF=false; generating [global] section of /etc/samba/smb.conf...
INFO: Creating /var/log/samba/cores
INFO: Avahi - generating base configuration in /etc/avahi/services/smbd.service...
INFO: Avahi - using "gboslave" as hostname.
ERROR: The value of EXTERNAL_CONF should be a directory mounted inside the container; "/users" was not found

But I don't get it, I mount the folder, which you can see in my docker-compose.yml:

version: '3'

services:

  timemachine:
    image: mbentley/timemachine:latest
    container_name: timemachine
    network_mode: "host"
    restart: unless-stopped
    environment:
      - ADVERTISED_HOSTNAME="gboslave"
      - CUSTOM_USER="false"
      - CUSTOM_SMB_CONF="false"
      - SET_PERMISSIONS="true"
      - WORKGROUP=“GBO”
      - DEBUG_LEVEL="1"
      - MIMIC_MODEL="TimeCapsule8,119"
      - EXTERNAL_CONF="/users"
      - HIDE_SHARES="no"
      - TM_UID="1000"
      - TM_GID="1000"
    volumes:
      - /mnt/TimeMachine/:/opt
      - ./userconf:/users
      - ./netatalk:/var/netatalk
      - ./logs:/var/log/supervisor
    ulimits:
      nofile:
        soft: 65536
        hard: 65536

my config-folder:

$ tree /opt/docker-compose/timemachine
├── docker-compose.yml
├── logs
├── netatalk
└── userconf
    ├── macmini.conf
    └── mbp.conf

/opt/docker-compose/timemachine/userconf/macmini.conf:

TM_USERNAME=macmini
TM_GROUPNAME=gbo
PASSWORD=xxx
SHARE_NAME=macmini
VOLUME_SIZE_LIMIT="2 T"
TM_UID=1000
TM_GID=1000

/opt/docker-compose/timemachine/userconf/mbp.conf:

TM_USERNAME=mbp
TM_GROUPNAME=gbo
PASSWORD=xxx
SHARE_NAME=mbp
VOLUME_SIZE_LIMIT="2 T"
TM_UID=1000
TM_GID=1000

What am I doing wrong?

mbentley commented 2 years ago

So the error is coming from here in the entrypoint: https://github.com/mbentley/docker-timemachine/blob/master/entrypoint.sh#L288-L292

It's just doing a basic check to see if the value of ${EXTERNAL_CONF} is an actual directory so it is failing the check to see if it is a directory which it's failing on. Let me see if I can reproduce this.

mbentley commented 2 years ago

There are two issues:

  1. The docker-compose file has a quoting problem. Remove the quotes around all of the environment variables. It should look like this:
environment:
      - ADVERTISED_HOSTNAME=gboslave
      - CUSTOM_USER=false
      - CUSTOM_SMB_CONF=false
      - SET_PERMISSIONS=true
      - WORKGROUP=GBO
      - DEBUG_LEVEL=1
      - MIMIC_MODEL=TimeCapsule8,119
      - EXTERNAL_CONF=/users
      - HIDE_SHARES=no
      - TM_UID=1000
      - TM_GID=1000
  1. You have a duplicate user ID in your conf files in the userconf directory. One of the two should have a TM_UID value that is different (e.g. - TM_UID=1001). The TM_GID is good though since it is the same group name & ID.
gbomacfly commented 2 years ago

Hi again,

thx for your answer. I removed the doublequotes in th environment, but it still fails. But then i removed these 2 lines in the docker-compose.yml:

      - TM_UID=1000
      - TM_GID=1000

Now it starts up, but I still can't connect, I think because of the other sambaserver on the same host :(

mbentley commented 2 years ago

Yeah, that would definitely do it. You're going to have port conflicts. Read this section of the README and see if it helps.