Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Add ECOMMERCE_SECURE_PROXY_SSL_HEADER - #110

Merged
viadanna merged 1 commit into
opencraft-release/ironwood.master-hmsfrom
paulo/ecommerce-ssl-header
Aug 23, 2019
Merged

Add ECOMMERCE_SECURE_PROXY_SSL_HEADER#110
viadanna merged 1 commit into
opencraft-release/ironwood.master-hmsfrom
paulo/ecommerce-ssl-header

Conversation

@viadanna

Copy link
Copy Markdown
Member

This PR adds ECOMMERCE_SECURE_PROXY_SSL_HEADER ansible variable and the SECURE_PROXY_SSL_HEADER configuration on ecommerce.yml

Testing

  1. Provision a VM for testing (Vagrant is recommended).
  2. Run the Ecommerce playbook without any variables to make sure there's a sane default:
$ ansible-playbook -vvv --user=ubuntu -i hosts playbooks/ecommerce.yml
  1. Make sure the defaults produce a sane /edx/etc/ecommerce.yml:
(...)
SECURE_PROXY_SSL_HEADER: null
(...)
  1. Run the playbook setting a value for the added config:
$ ansible-playbook -vvv --user=ubuntu -i hosts playbooks/ecommerce.yml -e '{"ECOMMERCE_SECURE_PROXY_SSL_HEADER":["HTTP_X_FORWARDED_PROTO","https"]}'
  1. Make sure the resulting configuration is correct:
(...)
SECURE_PROXY_SSL_HEADER:
- HTTP_X_FORWARDED_PROTO
- https
(...)

@giovannicimolin giovannicimolin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

  • I tested this:
  1. Provisioned an Ubuntu 16.04 vagrant instance.
  2. Set up a ssh-config to ansible connect with the vagrant instance and copied a working ansible.cfg file with the correct settings.
  3. Checked out this branch.
  4. Run provisioning with this line:
ansible-playbook -v --user=vagrant -i hosts playbooks/ecommerce.yml -e @../configuration-secure/vars-stage.yml -e EDXAPP_LMS_ROOT_URL=123 -e EDXAPP_LMS_BASE_SCHEME=123
  1. Checked that the file had the correct default set ✔️
SECURE_PROXY_SSL_HEADER: null
  1. Run the provisioning again with this line:
ansible-playbook -v --user=vagrant -i hosts playbooks/ecommerce.yml -e @../configuration-secure/vars-stage.yml -e EDXAPP_LMS_ROOT_URL=123 -e EDXAPP_LMS_BASE_SCHEME=123 -e '{"ECOMMERCE_SECURE_PROXY_SSL_HEADER":["HTTP_X_FORWARDED_PROTO","https"]}'

  1. Checked that the file had the correct contents ✔️
SECURE_PROXY_SSL_HEADER:
- HTTP_X_FORWARDED_PROTO
- https
  • I read through the code
  • I checked for accessibility issues NA
  • Includes documentation NA

@viadanna Nice work on this! Good to merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants