Files
ocis/services/postprocessing/README.md
T

31 lines
2.1 KiB
Markdown
Raw Normal View History

2022-12-27 17:17:27 +01:00
# Postprocessing Service
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
The `postprocessing` service handles the coordination of asynchronous postprocessing steps.
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
## General Prerequisites
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
To use the postprocessing service, an event system needs to be configured for all services. By default, `ocis` ships with a preconfigured `nats` service.
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
## Postprocessing Functionality
2022-12-27 16:02:01 +01:00
2022-12-27 17:18:48 +01:00
The storageprovider service (`storage-users`) can be configured to initiate asynchronous postprocessing by setting the `STORAGE_USERS_OCIS_ASYNC_UPLOADS` environment variable to `true`. If this is the case, postprocessing will get initiated *after* uploading a file and all bytes have been received.
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
The `postprocessing` service will then coordinate configured postprocessing steps like scanning the file for viruses. During postprocessing, the file will be in a `processing state` where only a limited set of actions are available. Note that this processing state excludes file accessability by users.
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
When all postprocessing steps have completed successfully, the file will be made accessible for users.
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
## Additional Prerequisites for the `postprocessing` Service
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
When postprocessing has been enabled, configuring any postprocessing step will require the requested services to be enabled and pre-configured. For example, to use the `virusscan` step, one needs to have an enabled and configured `antivirus` service.
2022-12-27 16:02:01 +01:00
2022-12-27 17:17:27 +01:00
## Postprocessing Steps
As of now, `ocis` allows two different postprocessing steps to be enabled via an environment variable.
### Virus Scanning
2022-12-28 06:48:11 +05:45
To enable virus scanning as a postprocessing step after uploading a file, the environment variable `POSTPROCESSING_VIRUSSCAN` needs to be set to ` true`. As a result, each uploaded file gets virus scanned as part of the postprocessing steps. Note that the `antivirus` service is required to be enabled and configured for this to work.
2022-12-27 16:02:01 +01:00
### Delay
2022-12-28 06:48:11 +05:45
Though this is for development purposes only and NOT RECOMMENDED on production systems, setting the environment variable `POSTPROCESSING_DELAY` to a duration not equal to zero will add a delay step with the configured amount of time. ocis will continue postprocessing the file after the configured delay.