-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency fileenhancementrubyPull requests that update Ruby codePull requests that update Ruby code
Description
In the current context, every uploaded file is uploaded with CarrierWave, which has a few drawbacks:
- Files are uploaded to the publics/uploads folder and thus need special handling to prevent unauthorized access.
- Files are stored on the local file system, need a dedicated backup strategy and are currently not available in a potential high availability setting involving multiple hosts.
- The CarrierWave integration is very manual with multiple quirks, and would deserve a refactoring.
Hence, we should replace CarrierWave with a proper ActiveStorage backend. ActiveStorage allows multiple backend (local file, S3, ...) and hence would address above issues. Further, it would allow a smooth migration in multiple steps (first switch to ActiveStorage, then change the ActiveStorage backend, ...)
When changing the upload, the following should be considered:
- Authorization for file access
- Embedding audio and video files (when implementing an exercise)
FilesController
forshow_protected_upload
(regular download)- The Renderhost and access when viewing a rendered HTML / CSS exercise (
FilesController#render_protected_upload
) - nginx configuration and
X-Accel-Redirect
:config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - Model changes (especially
CodeOcean::File
) and the native_file attribute - Potentially, integrate the new file upload mechanism with the Markdown editor.
Metadata
Metadata
Assignees
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency fileenhancementrubyPull requests that update Ruby codePull requests that update Ruby code