mirror of
https://github.com/9001/copyparty.git
synced 2026-01-02 17:45:37 +10:00
config-files can extend groups
This commit is contained in:
@@ -1467,7 +1467,10 @@ class AuthSrv(object):
|
||||
t = "group [%s] = " % (gn,)
|
||||
t += ", ".join("user [%s]" % (x,) for x in uns)
|
||||
self._l(ln, 5, t)
|
||||
grps[gn] = uns
|
||||
if gn in grps:
|
||||
grps[gn].extend(uns)
|
||||
else:
|
||||
grps[gn] = uns
|
||||
except:
|
||||
t = 'lines inside the [groups] section must be "groupname: user1, user2, user..."'
|
||||
raise Exception(t + SBADCFG)
|
||||
|
||||
8
docs/copyparty.d/more-users/david.conf
Normal file
8
docs/copyparty.d/more-users/david.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
[accounts]
|
||||
david: letmein
|
||||
|
||||
[groups]
|
||||
friends: david
|
||||
|
||||
# the "friends" group was already created in ../some.conf,
|
||||
# so we are just adding david into it
|
||||
8
docs/copyparty.d/more-users/james.conf
Normal file
8
docs/copyparty.d/more-users/james.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
[accounts]
|
||||
james: metooplease
|
||||
|
||||
[groups]
|
||||
friends: james
|
||||
|
||||
# the "friends" group was already created in ../some.conf,
|
||||
# so we are just adding james into it
|
||||
@@ -6,7 +6,7 @@
|
||||
# first declare the accounts just once:
|
||||
[accounts]
|
||||
usr1: passw0rd
|
||||
usr2: letmein
|
||||
usr2: touhou
|
||||
|
||||
[global]
|
||||
i: 127.0.0.1 # listen on 127.0.0.1 only,
|
||||
@@ -31,3 +31,21 @@
|
||||
#
|
||||
# because another.conf sets the read/write permissions before it
|
||||
# includes sibling.conf which adds the move permission
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# we can also create a group here;
|
||||
[groups]
|
||||
friends: usr1, usr2
|
||||
|
||||
# and a volume which the group "friends" can read/write;
|
||||
[/friends]
|
||||
/srv/pub/friends
|
||||
accs:
|
||||
rw: @friends
|
||||
|
||||
# then we include all the config-files in the folder "more-users",
|
||||
# which can define more users, and maybe even add them to the "friends" group
|
||||
# (spoiler: the users "usr1", "usr2", "david", and "james" will have access)
|
||||
|
||||
% more-users/
|
||||
|
||||
Reference in New Issue
Block a user