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

Integrate ELB with the CloudFormation stack #1170

Closed
hackdna opened this issue May 25, 2016 · 8 comments
Closed

Integrate ELB with the CloudFormation stack #1170

hackdna opened this issue May 25, 2016 · 8 comments

Comments

@hackdna
Copy link
Member

hackdna commented May 25, 2016

The current beta site is deployed behind an ELB which terminates HTTPS. We should be able to create a new ELB when setting up a brand new stack or re-use an existing one if available.
There should be settings added to the config.yml.template for load balancer name, all necessary HTTPS certificate files and other items necessary for provisioning an ELB.
Apache config template should be changed to configure redirect from HTTP to HTTPS.
Set ServerName in Apache config from SITE_URL

@hackdna
Copy link
Member Author

hackdna commented May 25, 2016

Add ELB to the stack

@hackdna
Copy link
Member Author

hackdna commented May 25, 2016

@drj11 drj11 modified the milestones: Yarmouth, Next Jun 15, 2016
@hackdna
Copy link
Member Author

hackdna commented Jun 15, 2016

An example of Apache config file updated for HTTPS:

# Generated from apache.erb.conf
# by refinery-modules/refinery/manifests/init.pp

WSGIPythonHome /home/ubuntu/.virtualenvs/refinery-platform

SetEnv DJANGO_SETTINGS_MODULE config.settings.aws

<VirtualHost *:80>
    ServerName dev.stemcellcommons.org

    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    <Directory /srv/refinery-platform/refinery/config>
        <Files wsgi.py>
            Order deny,allow
            Require all granted
        </Files>
    </Directory>
    WSGIScriptAlias / /srv/refinery-platform/refinery/config/wsgi.py

    WSGIDaemonProcess refinery user=ubuntu group=ubuntu \
        python-path=/srv/refinery-platform/refinery:/home/ubuntu/.virtualenvs/refinery-platform/lib/python2.7/site-packages
    WSGIProcessGroup refinery

    #Alias /robots.txt /vagrant/refinery/static/robots.txt
    #Alias /favicon.ico /vagrant/refinery/static/favicon.ico

    AliasMatch ^/([^/]*\.css) /srv/refinery-platform/refinery/static/styles/$1

    Alias /static/ /srv/refinery-platform/static/
    Alias /media/ /data/media/

    <Directory /srv/refinery-platform/static>
        Order deny,allow
        Require all granted
    </Directory>

    <Directory /data/media>
        Order deny,allow
        Require all granted
    </Directory>

</VirtualHost>

@ngehlenborg ngehlenborg modified the milestones: Yarmouth, Acton Jul 12, 2016
@ngehlenborg ngehlenborg modified the milestones: Acton, Barre Jul 26, 2016
@drj11
Copy link
Contributor

drj11 commented Jul 27, 2016

Noting here so I don't lose it. Can get Amazon to create our certificates: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ssl-server-cert.html

@hackdna
Copy link
Member Author

hackdna commented Jul 27, 2016

Btw, it is possible to have conditionals in the template: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html

@hackdna
Copy link
Member Author

hackdna commented Jul 27, 2016

As we discussed, there should be a single file for all stack settings, including tags. Also, we should probably have two AWS deployment modes. Prod: with SSL and dev: with no SSL. Dev mode settings/templates would be useful for Vagrant deployments too.

@hackdna
Copy link
Member Author

hackdna commented Aug 3, 2016

Regarding HTTPS handing in Django: https://docs.djangoproject.com/en/1.9/topics/security/#ssl-https
See also #1293

@hackdna
Copy link
Member Author

hackdna commented Aug 3, 2016

Also, we should log actual client IPs in Apache logs, not the ELB IPs (X-Forwarded-For header)

@drj11 drj11 mentioned this issue Aug 9, 2016
2 tasks
@ngehlenborg ngehlenborg modified the milestones: Barre, Canton Aug 16, 2016
@ngehlenborg ngehlenborg modified the milestones: Canton, Danvers Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants