Skip to content

Configure PROFILE_IMAGE_BACKEND when using AWS s3

Gustavo Sampaio requested to merge gustavokatel/profile-image-s3-backend into master

See SE-559

Turns out that to upload profile images to aws, the profile images backend has to be configured similar to the default file storage. This PR adds the ansible variable to the configuration_storage_settings entry in OCIM.

Ref: https://github.com/edx/configuration/blob/master/playbooks/roles/edxapp/defaults/main.yml#L688

Sandbox URL: Sandbox with the current change in the extra settings: https://gustavo-profile-image-test.stage.opencraft.hosting/

Testing instructions:

  1. Set up the Ocim devstack with this branch.
  2. Deploy an instance with default configurations and using s3.
  3. Create a new AppServer and check on its configurations if EDXAPP_PROFILE_IMAGE_BACKEND is set and matches:
EDXAPP_PROFILE_IMAGE_BACKEND:
  class: storages.backends.s3boto.S3BotoStorage
  options:
    headers:
      Cache-Control: max-age-"{{ EDXAPP_PROFILE_IMAGE_MAX_AGE }}"
    location: '{{ EDXAPP_AWS_LOCATION }}/profile-images'
  1. After the provision, set a profile picture for one of its user and check if the url points to aws s3.

Reviewers

Merge request reports