cptactionhank / docker-netatalk

Docker container running Netatalk
https://hub.docker.com/r/cptactionhank/netatalk/
MIT License
134 stars 75 forks source link

Can not login #7

Closed askhat closed 7 years ago

askhat commented 8 years ago

I've made docker-compose.yml in which I specified AFP_USER and AFP_PASSWORD. docker inspect reports that variables are successfully defined. However still can't log in. compose netatalk

mkkie commented 8 years ago

Check owner & permission on the directory you are sharing

askhat commented 8 years ago

@mkkie all set to askhat:askhat with the same uid and gid inside the container. screen shot 2016-03-02 at 17 30 27 screen shot 2016-03-02 at 17 31 30

mkkie commented 8 years ago

Check /etc/netatalk/afp.conf or /etc/afp.conf. What is the path you are sharing?

[My AFP Volume] path = /media

You should set the onwer on this folder, and make sure the password is right. In container : $ echo askhat:qqwet | chpasswd

The version of cptactionhank/netatalk:latest is 3.1.7. $ echo $NETATALK_VERSION 3.1.7 I guess the environment variables AFP_USER & AFP_PASSWORD is not working at this version. You can build your own images from github source code. $ docker build -t netatalk:3.1.8 . $ docker run ...... netatalk:3.1.8

askhat commented 8 years ago

My afp.conf is default, so basically I'm sharing /media/share from the container, with /mnt/media from the host, mounted to it. Owner assigned recursively and double checked, password is same for the host system and AFP.

On Thu, Mar 3, 2016 at 4:52 AM mkkie notifications@github.com wrote:

Check /etc/netatalk/afp.conf or /etc/afp.conf. What is the path you are sharing?

[My AFP Volume] path = /media

You should set the onwer on this folder, and make sure the password is right. In container : $ echo askhat:qqwet | chpasswd

— Reply to this email directly or view it on GitHub https://github.com/cptactionhank/docker-netatalk/issues/7#issuecomment-191535705 .

Sincerely, Askhat Bikmetov

ghost commented 8 years ago

Hey guys,

I had the same problem. However, I got it to work! Here's how I did it: docker exec -it netatalk /bin/bash cat /etc/passwd doesn't show me in there. I ran /docker-entrypoint.sh Output:

adduser: The GID 1000 does not exist.
chpasswd: (user wiegrafi) pam_chauthtok() failed, error:
Authentication token manipulation error
chpasswd: (line 1, user wiegraf) password not changed
sed: cannot rename /etc/sedbgDotR: Device or resource busy
---begin-afp.conf--
[Global]
; output log entries to stdout instead of syslog
; it is the docker way where the engine in turn
; can direct the log output to a storage backend
log file = /dev/stdout

; enable guest access as well as user accounts
uam list = uams_guest.so uams_dhx2.so uams_dhx.so

[Share]
path = /media/share
; when the environment variable `AFP_USER` is not
; provided valid users list will be empty and
; thus be available for both guests and
; authenticated users
valid users = wiegraf
---end---afp.conf--
mkdir: cannot create directory '/var/run/dbus': File exists
Failed to start message bus: The pid file "/var/run/dbus/pid" exists, if the message bus is not running, remove this file
Daemon already running on PID 19
netatalk is already running (pid = 1), or the lock file is stale.

This part is important: adduser: The GID 1000 does not exist. I ran addgroup --gid 1000 wiegraf (I happened to know this value beforehand). Then I reran /docker-entrypoint.sh and it worked!

Basically the takeaway is that docker-entrypoint.sh needs to add the group prior to adding the user. Or maybe there is a command to add them both at once - I'm not sure.