mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-25 00:50:31 +00:00
docs: add some notes about the new virtual folders support
fixe a failing test case for the memory provider
This commit is contained in:
parent
d6dc3a507e
commit
f249286cb1
5 changed files with 19 additions and 8 deletions
|
@ -196,7 +196,7 @@ More information about custom actions can be found [here](./docs/custom-actions.
|
|||
|
||||
## Virtual folders
|
||||
|
||||
Directories outside the user home directory can be exposed as virtual folders, more information [here](./docs/virtual-folders.md).
|
||||
Directories outside the user home directory or based on a different storage provider can be exposed as virtual folders, more information [here](./docs/virtual-folders.md).
|
||||
|
||||
## Other hooks
|
||||
|
||||
|
|
|
@ -1991,6 +1991,9 @@ func TestQuotaTrackDisabled(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestGetQuotaError(t *testing.T) {
|
||||
if dataprovider.GetProviderStatus().Driver == "memory" {
|
||||
t.Skip("this test is not available with the memory provider")
|
||||
}
|
||||
u := getTestUser()
|
||||
mappedPath := filepath.Join(os.TempDir(), "vdir")
|
||||
folderName := filepath.Base(mappedPath)
|
||||
|
|
|
@ -27,6 +27,12 @@ docker run --name some-sftpgo -p 127.0.0.1:8080:8080 -p 2022:2022 -d "drakkan/sf
|
|||
|
||||
Now visit [http://localhost:8080/](http://localhost:8080/), the default credentials are `admin/password`, and create a new SFTPGo user. The SFTP service is available on port 2022.
|
||||
|
||||
If you don't want to persist any files, for example for testing purposes, you can run an SFTPGo instance like this:
|
||||
|
||||
```shell
|
||||
docker run --rm --name some-sftpgo -p 8080:8080 -p 2022:2022 -d "drakkan/sftpgo:tag"
|
||||
```
|
||||
|
||||
If you prefer GitHub Container Registry to Docker Hub replace `drakkan/sftpgo:tag` with `ghcr.io/drakkan/sftpgo:tag`.
|
||||
|
||||
### Container shell access and viewing SFTPGo logs
|
||||
|
|
|
@ -16,4 +16,3 @@ The encrypted filesystem has some limitations compared to the local, unencrypted
|
|||
- Opening a file for both reading and writing at the same time is not supported and so clients that require advanced filesystem-like features such as `sshfs` are not supported too.
|
||||
- Truncate is not supported.
|
||||
- System commands such as `git` or `rsync` are not supported: they will store data unencrypted.
|
||||
- Virtual folders are not implemented for now, if you are interested in this feature, please consider submitting a well written pull request (fully covered by test cases) or sponsoring this development. We could add a filesystem configuration to each virtual folder so we can mount encrypted or cloud backends as subfolders for local filesystems and vice versa.
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
# Virtual Folders
|
||||
|
||||
A virtual folder is a mapping between a SFTPGo virtual path and a filesystem path outside the user home directory.
|
||||
The specified paths must be absolute and the virtual path cannot be "/", it must be a sub directory.
|
||||
The parent directory to the specified virtual path must exist. SFTPGo will try to automatically create any missing parent directory for the configured virtual folders at user login.
|
||||
A virtual folder is a mapping between a SFTPGo virtual path and a filesystem path outside the user home directory or a different storage provider.
|
||||
|
||||
For example, you can have a local user with an S3-based virtual folder or vice versa.
|
||||
|
||||
The specified local paths must be absolute and the virtual path cannot be "/", it must be a sub directory.
|
||||
|
||||
SFTPGo will try to automatically create any missing parent directory for the configured virtual folders at user login.
|
||||
|
||||
For each virtual folder, the following properties can be configured:
|
||||
|
||||
- `folder_name`, is the ID for an existings folder. The folder structure contains the absolute filesystem path to expose as virtual folder
|
||||
- `filesystem`, this way you can map a local path or a Cloud backend to mount as virtual folders
|
||||
- `virtual_path`, the SFTPGo absolute path to use to expose the mapped path
|
||||
- `quota_size`, maximum size allowed as bytes. 0 means unlimited, -1 included in user quota
|
||||
- `quota_files`, maximum number of files allowed. 0 means unlimited, -1 included in user quota
|
||||
|
@ -15,6 +20,7 @@ For example if the configure folder has configured `/tmp/mapped` or `C:\mapped`
|
|||
|
||||
The same virtual folder can be shared among users, different folder quota limits for each user are supported.
|
||||
Folder quota limits can also be included inside the user quota but in this case the folder is considered "private" and sharing it with other users will break user quota calculation.
|
||||
The calculation of the quota for a given user is obtained as the sum of the files contained in his home directory and those within each defined virtual folder.
|
||||
|
||||
Using the REST API you can:
|
||||
|
||||
|
@ -24,6 +30,3 @@ Using the REST API you can:
|
|||
- delete a virtual folder. SFTPGo removes folders from the data provider, no files deletion will occur
|
||||
|
||||
If you remove a folder, from the data provider, any users relationships will be cleared up. If the deleted folder is included inside the user quota you need to do a user quota scan to update its quota. An orphan virtual folder will not be automatically deleted since if you add it again later then a quota scan is needed and it could be quite expensive, anyway you can easily list the orphan folders using the REST API and delete them if they are not needed anymore.
|
||||
|
||||
Overlapping virtual paths are not allowed for the same user, overlapping mapped paths are allowed only if quota tracking is globally disabled inside the configuration file (`track_quota` must be set to `0`).
|
||||
Virtual folders are supported for local filesystem only.
|
||||
|
|
Loading…
Reference in a new issue