First set SHELVE_HOST env var in your terminal so that client can connect to signal server. For example server is running on 192.168.1.100:8000
export SHELVE_HOST=192.168.1.100:8000
or configure via Client Configuration
This will connect to signal server and start sharing files.
shelve publish /path/of/your/dir /another/path ...
Now you give users ability to retrieve or store files on dedicated paths.
Check does your shares appear with web client http://192.168.1.100:8000/
or run command in other terminal:
shelve ps # This will get you list of active peers and their shares
#Example
ID Host Created File
2d5ce4c backup-server Wed May 19 22:29:49 CEST 2021 etc
1f7a1be backup-server Wed May 19 22:29:49 CEST 2021 home
cdc421a backup-server Wed May 19 22:29:49 CEST 2021 web
8ffae08 mylaptop Wed May 19 22:25:31 CEST 2021 asterisk
3dc8aea mylaptop Wed May 19 22:25:33 CEST 2021 go1.15
To make sharing permanent check out Client Configuration
With web client this is just like using your file explorer. Using cli can be done
shelve ls <peerid>[:/path] # peerid can be used as Host~File
#Example:
shelve ls backup-server~etc # or shorter
# shelve ls 2d5ce4c
ModTime Type Size File
May 28 15:25:57 file 89 B fstab
May 28 15:25:57 file 682 B group
May 19 20:29:49 file 14 B hostname
May 19 20:29:49 file 372 B hosts
May 29 14:20:33 dir 4 KB init.d
May 28 15:25:57 file 570 B inittab
May 29 14:17:04 file 54 B issue
May 29 14:20:33 dir 4 KB logrotate.d
May 22 06:59:49 file 140 B logrotate.d/acpid
May 29 14:20:33 dir 4 KB modprobe.d
May 28 15:25:57 file 1 KB modprobe.d/aliases.conf
May 28 15:25:57 file 1 KB modprobe.d/blacklist.conf
May 28 15:25:57 file 122 B modprobe.d/i386.conf
May 28 15:25:57 file 91 B modprobe.d/kms.conf
...
# Remote to local
shelve cp <peerid>:/path/to/file /destination
# Local to remote
shelve cp /path/to/local/file <peerid>:/path/to/file
Client allows you to search file across all peers. This is useful when you need to find specific file location.
shelve search <query>
Configuration is simple json file. It allows you to configure your shared files and then you can add app to your startup. This will make your shared files to appear when ever your machine boots.
To configure shelve CLI app just run in shell:
shelve config
Example of config:
{
"host": "10.1.1.1:8000",
"shared": [
{
"path": "/absolute/path/to/shared/folder"
},
{
"path": "/absolute/path/to/file.conf"
}
]
}
After that runing shelve
without args will start publishing shared files.