From 2603f3378205312733d1d945bc70a337df42d5c3 Mon Sep 17 00:00:00 2001 From: Alexandre Barbosa Date: Mon, 14 Sep 2015 14:13:23 -0300 Subject: [PATCH] Inserting Colab Settings file --- cookbooks/colab/recipes/default.rb | 7 +++++++ cookbooks/colab/templates/04-settings.py.erb | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 0 deletions(-) create mode 100644 cookbooks/colab/templates/04-settings.py.erb diff --git a/cookbooks/colab/recipes/default.rb b/cookbooks/colab/recipes/default.rb index cd7f7e7..c084481 100644 --- a/cookbooks/colab/recipes/default.rb +++ b/cookbooks/colab/recipes/default.rb @@ -48,6 +48,13 @@ template '/etc/colab/settings.d/00-database.py' do notifies :restart, 'service[colab]' end +template '/etc/colab/settings.d/04-settings.py' do + owner 'root' + group 'colab' + mode 0640 + notifies :restart, 'service[colab]' +end + # Creating a gitlab admin user template '/tmp/admin-gitlab.json' do diff --git a/cookbooks/colab/templates/04-settings.py.erb b/cookbooks/colab/templates/04-settings.py.erb new file mode 100644 index 0000000..5e84f14 --- /dev/null +++ b/cookbooks/colab/templates/04-settings.py.erb @@ -0,0 +1,41 @@ +## Set to false in production +DEBUG = False +TEMPLATE_DEBUG = False + +## System admins +ADMINS = [ +<%- node['config']['admins'].each do |admin| %> + [ + <%- admin.each do |item| %> + "<%= item %>", + <%- end %> + ], +<% end %> +] + +MANAGERS = ADMINS + +# general Django settings +DEFAULT_FROM_EMAIL = "<%= node['config']['colab_from_address'] %>" + +# colab-specific +COLAB_FROM_ADDRESS = "<%= node['config']['colab_from_address'] %>" +SERVER_EMAIL = "<%= node['config']['server_email'] %>" + +EMAIL_HOST = "localhost" +EMAIL_PORT = 25 +EMAIL_SUBJECT_PREFIX = "<%= node['config']['email_subject_prefix'] %>" + +SECRET_KEY = "<%= File.read('/etc/colab/secret.key').strip %>" + +SITE_URL = "<%= node['config']['site_url'] %>" + +ALLOWED_HOSTS = ["<%= node['config']['external_hostname'] %>"] + +## Disable indexing +ROBOTS_NOINDEX = False + +## Set URL of Colab home +COLAB_HOME_URL = '/social' + +GOOGLE_ANALYTICS_TRACKING_ID = "<%= node['config']['google_analytics_id'] %>" -- libgit2 0.21.2