This repository has been archived by the owner on Apr 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Added SSL certificates uploading. #164
Open
ghost
wants to merge
6
commits into
intercity:master
Choose a base branch
from
unknown repository
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
edc2990
Added SSL certificates uploading.
oiuzikov 43e9580
Houndci fixes
oiuzikov 988da51
Changed ssl config options
oiuzikov b662d03
Houndci fixes
oiuzikov cd36011
Houndci fixes
oiuzikov b522bf7
Updated method's docs
oiuzikov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
|
||
# Include library helpers | ||
::Chef::Resource.send(:include, Rails::Helpers) | ||
::Chef::Recipe.send(:include, Rails::Helpers) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for my curiosity: what does this do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. without this line, the following wouldn't work, method missing:
since it's a level of recipe, not resource such as:
|
||
|
||
node[:active_applications].each do |app, app_info| | ||
rails_env = app_info['rails_env'] || "production" | ||
|
@@ -93,21 +94,17 @@ | |
|
||
end | ||
|
||
if app_info['ssl_info'] | ||
template "#{applications_root}/#{app}/shared/config/certificate.crt" do | ||
owner "deploy" | ||
group "deploy" | ||
mode 0644 | ||
source "app_cert.crt.erb" | ||
variables :app_crt=> app_info['ssl_info']['crt'] | ||
end | ||
|
||
template "#{applications_root}/#{app}/shared/config/certificate.key" do | ||
owner "deploy" | ||
group "deploy" | ||
mode 0644 | ||
source "app_cert.key.erb" | ||
variables :app_key=> app_info['ssl_info']['key'] | ||
ssl_certificate_path = ssl_certificate(applications_root, app, app_info) | ||
ssl_certificate_key_path = ssl_certificate_key(applications_root, app, app_info) | ||
|
||
if app_info["ssl_enabled"] | ||
[ssl_certificate_path, ssl_certificate_key_path].each do |pathname| | ||
cookbook_file pathname.to_s do | ||
source "certificates/#{pathname.basename}" | ||
owner "deploy" | ||
group "deploy" | ||
mode 0644 | ||
end | ||
end | ||
end | ||
|
||
|
@@ -117,7 +114,9 @@ | |
name: app, | ||
domain_names: app_info["domain_names"], | ||
redirect_domain_names: app_info["redirect_domain_names"], | ||
enable_ssl: File.exists?("#{applications_root}/#{app}/shared/config/certificate.crt"), | ||
ssl_enabled: app_info["ssl_enabled"], | ||
ssl_certificate: ssl_certificate_path, | ||
ssl_certificate_key: ssl_certificate_key_path, | ||
custom_configuration: nginx_custom_configuration(app_info)) | ||
notifies :reload, resources(service: "nginx") | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding this information back into a key value hash like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done