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

Temporary configs for the Canada migration #454

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion inventory/host_vars/openfoodnetwork.ca/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,40 @@
domain: openfoodnetwork.ca
rails_env: production

admin_email:
admin_email: [email protected]
mail_domain: openfoodnetwork.ca

swapfile_size: 2G

certbot_domains:
- openfoodnetwork.ca
- www.openfoodnetwork.ca
- upgrade.openfoodnetwork.ca


# Letsencrpyt validation proxy-hack so we can register certificates on the new server
# Works like a charm! :D
# Delete and provision again when finished...
ofn_80:
- |
listen 80;
listen [::]:80;
server_name {{ certbot_domains | default([domain]) | join(' ') }};

add_header X-Content-Type-Options nosniff always;
add_header X-Xss-Protection "1; mode=block" always;

location '/.well-known/acme-challenge' {
# Now we can validate a multi-domain certificate for openfoodnetwork.ca from the *other* server
# without affecting anything on the current server.
proxy_pass http://upgrade.openfoodnetwork.ca/.well-known/acme-challenge;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
port_in_redirect off;
proxy_connect_timeout 300;
}

location / {
return 301 https://$host$request_uri;
}
16 changes: 16 additions & 0 deletions inventory/host_vars/upgrade.openfoodnetwork.ca/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

domain: upgrade.openfoodnetwork.ca
rails_env: production

admin_email: [email protected]
mail_domain: openfoodnetwork.ca

swapfile_size: 2G

certbot_domains: # The order here is important
- openfoodnetwork.ca
- www.openfoodnetwork.ca
- upgrade.openfoodnetwork.ca

certbot_cert_name: openfoodnetwork.ca # This bit is very important
6 changes: 5 additions & 1 deletion inventory/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ au-staging
# Canada

[ca-prod]
openfoodnetwork.ca
openfoodnetwork.ca ansible_host=159.203.30.206

[ca-prod2]
upgrade.openfoodnetwork.ca ansible_host=68.183.204.127

[ca:children]
ca-prod
ca-prod2

#------------------------------------------------------------------------------
# Ireland
Expand Down