spantaleev / sftpman

Application that handles sshfs/sftp file systems mounting.
GNU General Public License v3.0
32 stars 7 forks source link

allow more characters in machine ids #6

Closed anntzer closed 6 years ago

anntzer commented 6 years ago

Hi, Any reason why machine ids need to be alphanumeric? For example, it seems reasonable to have ids name "user@remote" (in case of multiple users on a system). The only restriction that seems necessary is no-slash and no null-byte (so that /mnt/sshfs/$machine-id stays a valid path (and even then I guess the slash could be allowed, it's just whether you want to bother supporting it...)). Thanks.

spantaleev commented 6 years ago

Thanks for the report!

I've allowed _ and @ characters in ids now, so using user@remote should be possible. Released as sftpman = 1.0.2.

Supporting / is more involved, especially because the system id needs to be a valid filename path as well (the configuration is stored in a file named like this: ~/.config/sftpman/mounts/<id>.json). Besides the problem of managing a hierarchy of directories under /mnt/sshfs, we'd need to solve the configuration problem as well. I don't think the added complexity is justified, but if you really have a use-case like that - let me know.

anntzer commented 6 years ago

Thanks for the quick reply. I wasn't really asking for support of hierarchies (although I guess it'd nice to have on a multi-user system... user $foo can have e.g. /mnt/sshfs/$foo/... just for themself), just pointing out that the only characters that really need special handling are "/" and "\0" and nothing else should be problematic.