Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-only] added the details to the 'Restore Trash-Bins Items' doc section' #9228

Merged
merged 10 commits into from
May 22, 2024
5 changes: 5 additions & 0 deletions changelog/unreleased/update-storage-users-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: The storage-users doc updated

The storage-users doc was updated, added the details to the 'Restore Trash-Bins Items' section.

https://github.com/owncloud/ocis/pull/9228
21 changes: 13 additions & 8 deletions services/storage-users/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ When using Infinite Scale as user storage, a directory named `storage/users/uplo

Example cases for expired uploads:

* In the final step the upload blob is moved from the upload area to the final blobstore (e.g. S3).
* In the final step the upload blob is moved from the upload area to the final blobstore (e.g. S3).
2403905 marked this conversation as resolved.
Show resolved Hide resolved

* If the bandwidth is limited and the file to transfer can't be transferred completely before the upload expiration time is reached, the file expires and can't be processed.

Expand Down Expand Up @@ -173,32 +173,37 @@ ocis storage-users trash-bin purge-expired

The behaviour of the `purge-expired` command can be configured by using the following environment variables.

* `STORAGE_USERS_PURGE_TRASH_BIN_USER_ID`
* `STORAGE_USERS_PURGE_TRASH_BIN_USER_ID`
2403905 marked this conversation as resolved.
Show resolved Hide resolved
Used to obtain space trash-bin information and takes the system admin user as the default which is the `OCIS_ADMIN_USER_ID` but can be set individually. It should be noted, that the `OCIS_ADMIN_USER_ID` is only assigned automatically when using the single binary deployment and must be manually assigned in all other deployments. The command only considers spaces to which the assigned user has access and delete permission.

* `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE`
* `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE`
2403905 marked this conversation as resolved.
Show resolved Hide resolved
Has a default value of `720h` which equals `30 days`. This means, the command will delete all files older than `30 days`. The value is human-readable, for valid values see the duration type described in the [Environment Variable Types](https://doc.owncloud.com/ocis/5.0/deployment/services/envvar-types-description.html). A value of `0` is equivalent to disable and prevents the deletion of `personal space` trash-bin files.

* `STORAGE_USERS_PURGE_TRASH_BIN_PROJECT_DELETE_BEFORE`
* `STORAGE_USERS_PURGE_TRASH_BIN_PROJECT_DELETE_BEFORE`
2403905 marked this conversation as resolved.
Show resolved Hide resolved
Has a default value of `720h` which equals `30 days`. This means, the command will delete all files older than `30 days`. The value is human-readable, for valid values see the duration type described in the [Environment Variable Types](https://doc.owncloud.com/ocis/5.0/deployment/services/envvar-types-description.html). A value of `0` is equivalent to disable and prevents the deletion of `project space` trash-bin files.

#### List and Restore Trash-Bins Items

The variable `STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE` defines a maximum number of attempts to rename a file when the admin restores the file with the CLI option `--option keep-both` to an existing destination with the same name.
Restoring is possible only at the original location. The personal or project spase ID `spaceID` is required for the items restoring.
2403905 marked this conversation as resolved.
Show resolved Hide resolved
To authenticate the cli tool use `OCIS_SERVICE_ACCOUNT_SECRET=<acc-secret>` and `OCIS_SERVICE_ACCOUNT_ID=<acc-id>`. The `storage-users` cli tool uses the default address to establish the connection to the `gateway` service. If the connection is failed check your custom `gateway`
2403905 marked this conversation as resolved.
Show resolved Hide resolved
service `GATEWAY_GRPC_ADDR` configuration and set the same address to `storage-users` variable `OCIS_GATEWAY_GRPC_ADDR` or `STORAGE_USERS_GATEWAY_GRPC_ADDR`.

* Print a list of all trash-bin items of a space
```bash
ocis storage-users trash-bin list
ocis storage-users trash-bin list [command options] ['spaceID' required]
2403905 marked this conversation as resolved.
Show resolved Hide resolved
```

The restore option defines the behavior for an item to be restored, when the item name already exists in the target space. Supported options are: `skip`, `replace` and `keep-both`. The default value is `skip`
2403905 marked this conversation as resolved.
Show resolved Hide resolved
When the cli tool restores the item with the `replace` option, the existing item will be moved to a trash-bin. When the cli tool restores the item with the `keep-both` option and the designation item already exists, the name of the restored item will be changed by adding the numeric suffix in parentheses. The variable `STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE` defines a maximum number of attempts to rename an item.
2403905 marked this conversation as resolved.
Show resolved Hide resolved

* Restore all trash-bin items for a space
```bash
ocis storage-users trash-bin restore-all
ocis storage-users trash-bin restore-all [command options] ['spaceID' required]
2403905 marked this conversation as resolved.
Show resolved Hide resolved
```

* Restore a trash-bin item by ID
```bash
ocis storage-users trash-bin restore
ocis storage-users trash-bin restore [command options] ['spaceID' required] ['itemID' required]
2403905 marked this conversation as resolved.
Show resolved Hide resolved
```

## Caching
Expand Down