bflad / chef-stash

Chef Cookbook for Atlassian Stash
Other
37 stars 42 forks source link

Allow disabling of SSL #56

Closed sunruh closed 8 years ago

sunruh commented 9 years ago

Allows to disable to the SSL configuration of Tomcat and Apache by setting the port attributes to -1.

It is a replacement for PR #22 with the difference, that a34d15db1de390c4ece8ab94059d4f7f9ce5f419 (add proxy preserve host) has not been applied as it is unrelated to SSL (but important nevertheless).

bflad commented 9 years ago

Overall looks good -- would it be cleaner just to accept false instead of comparing to -1 everywhere?

bflad commented 9 years ago

Reasoning is that you can change all those unless node['stash']['tomcat']['ssl_port'] == -1 to if node['stash']['tomcat']['ssl_port'] which is a little easier to read personally.

sunruh commented 9 years ago

Changed the if statements to check for false status instead of comparing to -1 and rebased on top of current master.

linc01n commented 9 years ago

Hi @sunruh,

Thanks for your contribution. Sorry for the late review since I was having problem on testing your pull request(#69)

I tried to use your PR to deploy the cookbook. But I am redirected to the https site. It is caused by this line of code https://github.com/humance/chef-stash-cookbook/blob/2ec8709c3c75b2078f73e13202ea31711e52ef69/templates/default/server-tomcat8.xml.erb#L80

You need to change it

--- a/templates/default/server-tomcat8.xml.erb
+++ b/templates/default/server-tomcat8.xml.erb
@@ -77,7 +77,7 @@
                    useBodyEncodingForURI="true"
                    compression="on"
                    compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
-                   <% if node['stash']['apache2'] -%>
+                   <% if node['stash']['apache2'] && node['stash']['tomcat']['ssl_port'] -%>
                    redirectPort="<%= node['stash']['apache2']['ssl']['port'] %>"
                    secure="true"
                    scheme="https"
linc01n commented 9 years ago

It may also affect this default

default['stash']['backup_client']['baseurl']      = "https://#{node['fqdn']}/"

https://github.com/bflad/chef-stash/blob/551fb495fbf3b6c0b1e6f9d93ce1f07d96e4cb85/attributes/default.rb#L130

ramonskie commented 9 years ago

any update on this? because without disabling ssl can't seem to get test-kitchen to run on ubuntu

ramonskie commented 9 years ago

bump