add config-file preprocessor (%include)

This commit is contained in:
ed
2022-11-04 23:48:14 +00:00
parent e9c6268568
commit b2ab8f971e
7 changed files with 121 additions and 28 deletions

View File

@@ -0,0 +1,5 @@
# this file gets included twice from ../some.conf,
# setting user permissions for a volume
rw usr1
r usr2
% sibling.conf

View File

@@ -0,0 +1,3 @@
# and this config file gets included from ./another.conf,
# adding a final permission for each of the two volumes in ../some.conf
m usr1 usr2

View File

@@ -0,0 +1,26 @@
# lets make two volumes with the same accounts/permissions for both;
# first declare the accounts just once:
u usr1:passw0rd
u usr2:letmein
# and listen on 127.0.0.1 only, port 2434
-i 127.0.0.1
-p 2434
# share /usr/share/games from the server filesystem
/usr/share/games
/vidya
# include config file with volume permissions
% foo/another.conf
# and share your ~/Music folder too
~/Music
/bangers
% foo/another.conf
# which should result in each of the volumes getting the following permissions:
# usr1 read/write/move
# usr2 read/move
#
# because another.conf sets the read/write permissions before it
# includes sibling.conf which adds the move permission

13
docs/example2.conf Normal file
View File

@@ -0,0 +1,13 @@
# you can include additional config like this
# (the space after the % is important)
#
# since copyparty.d is a folder, it'll include all *.conf
# files inside (not recursively) in alphabetical order
# (not necessarily same as numerical/natural order)
#
# paths are relative from the location of each included file
# unless the path is absolute, for example % /etc/copyparty.d
#
# max include depth is 64
% copyparty.d