Git Product home page Git Product logo

Comments (8)

shad-lp avatar shad-lp commented on July 18, 2024 1

I was not aware of this option, I just tried, this perfectly fits the purpose, now I can make it a fully functional service for our use case.
Your software will be handy for Synology DSM 7 users. Thanks again !

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

so you're talking about the main user group id?

or additional group memberships for each user?

from samba.

shad-lp avatar shad-lp commented on July 18, 2024

About the main gid right.
I can conduct some tests to see if it effectively leads to bugs about permissions.
But I'm afraid it could.

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

I currently plan if we make it possible to set a list of groups and new groups+ids with the first group being the main group... I guess this should work for all possible use cases 🤔

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

done and pushed, you can now create groups using environment variables and also specify a list of groups added to each account - this should solve your problem

from samba.

shad-lp avatar shad-lp commented on July 18, 2024

Thanks for your effort, here is my new compose file :

version: '2.1'
services:

   samba-server:
      image: servercontainers/samba
      container_name: samba-server
      hostname: samba-nt1
      networks:
         mac0:
            ipv4_address: 192.168.100.145
      environment:

         ## lawrence user ##
         - ACCOUNT_lawrence=lawrence-smb
         - UID_lawrence=1027
         - GROUPS_lawrence=users
         
         ## media user ##
         - ACCOUNT_media=media-smb
         - UID_media=1035
         - GROUPS_media=users
         
         ## Groups definition ##
         - GROUP_users=100
         
         ## Directives and shares config ##
         - SAMBA_GLOBAL_CONFIG_server_SPACE_min_SPACE_protocol=NT1
         - SAMBA_GLOBAL_CONFIG_ntlm_SPACE_auth=ntlmv1-permitted
         - SAMBA_CONF_MAP_TO_GUEST=Never
         - SAMBA_VOLUME_CONFIG_music=[Musique]; path=/shares/music; guest ok = no; read only = no; browseable = yes; valid users = lawrence, media
         
      volumes:
         - /volume1/music/bibliotheque:/shares/music
         - /volume1/docker/samba/conf-server:/etc/samba
      restart: unless-stopped

networks:

   mac0:
      external: true

For exemple, I am checking whose group media is belonging to :

docker exec -it samba-server id media
uid=1035(media) gid=1035(media) groups=1035(media),100(users)

If I upload any file to the volume, it ends up belonging to media/media, I'd like it to be media/users instead.

I'm pretty sure what I get is the expected behaviour, if so I'll probaby get over it (asking people to chown regularly, but not a smart solution), but asking you just to be sure I'm not missing something obvious.

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

ahhh now I get your problem - but I would resolve it this way:

add force group = media; to your volume config

         - SAMBA_VOLUME_CONFIG_music=[Musique]; path=/shares/music; guest ok = no; read only = no; browseable = yes; valid users = lawrence, media; force group = media;

this way, everytime someone uploaded something into this volume the group is set to media - in the end all users with this group should be able to work with this file.

there are more options you can enforce:

force user = someuser;
force group = somegroup;
force create mode = 0666;
force directory mode = 2777

etc.

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

yeah I'd guess it's clearer solution, you can specify the default groups for serveral volumes, and by putting your users into those groups you make sure the can access the files/folders.

with the primary group you always run into problems with users having a different main group (when they usually work on other volumes) create a file and now all your other users can't access them etc.

from samba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.