mirror of
https://github.com/9001/copyparty.git
synced 2025-09-28 12:42:26 -06:00
support file-as-volume (#696);
a volume can be a single file instead of a folder, but a misleading warning indicated otherwise
This commit is contained in:
parent
2848941e01
commit
aa1c921302
|
@ -572,6 +572,8 @@ for example `-v /mnt::r -v /var/empty:web/certs:r` mounts the server folder `/mn
|
|||
|
||||
the example config file right above this section may explain this better; the first volume `/` is mapped to `/srv` which means http://127.0.0.1:3923/music would try to read `/srv/music` on the server filesystem, but since there's another volume at `/music` mapped to `/mnt/music` then it'll go to `/mnt/music` instead
|
||||
|
||||
> ℹ️ this also works for single files, because files can also be volumes
|
||||
|
||||
|
||||
## dotfiles
|
||||
|
||||
|
|
|
@ -926,6 +926,12 @@ class Up2k(object):
|
|||
with self.mutex, self.reg_mutex:
|
||||
# only need to protect register_vpath but all in one go feels right
|
||||
for vol in vols:
|
||||
if bos.path.isfile(vol.realpath):
|
||||
self.volstate[vol.vpath] = "online (just-a-file)"
|
||||
t = "NOTE: volume [/%s] is a file, not a folder"
|
||||
self.log(t % (vol.vpath,))
|
||||
continue
|
||||
|
||||
try:
|
||||
# mkdir gonna happen at snap anyways;
|
||||
bos.makedirs(vol.realpath, vf=vol.flags)
|
||||
|
|
Loading…
Reference in a new issue