Commit 2603f3378205312733d1d945bc70a337df42d5c3

Authored by Alexandre Barbosa
Committed by Sergio Oliveira
1 parent 0f8453bc

Inserting Colab Settings file

Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Signed-off-by: Lucas Moura <lucas.moura128@gmail.com>
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Signed-off-by: Paulo Tada <paulohtfs@gmail.com>
cookbooks/colab/recipes/default.rb
@@ -48,6 +48,13 @@ template &#39;/etc/colab/settings.d/00-database.py&#39; do @@ -48,6 +48,13 @@ template &#39;/etc/colab/settings.d/00-database.py&#39; do
48 notifies :restart, 'service[colab]' 48 notifies :restart, 'service[colab]'
49 end 49 end
50 50
  51 +template '/etc/colab/settings.d/04-settings.py' do
  52 + owner 'root'
  53 + group 'colab'
  54 + mode 0640
  55 + notifies :restart, 'service[colab]'
  56 +end
  57 +
51 # Creating a gitlab admin user 58 # Creating a gitlab admin user
52 template '/tmp/admin-gitlab.json' do 59 template '/tmp/admin-gitlab.json' do
53 60
cookbooks/colab/templates/04-settings.py.erb 0 → 100644
@@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
  1 +## Set to false in production
  2 +DEBUG = False
  3 +TEMPLATE_DEBUG = False
  4 +
  5 +## System admins
  6 +ADMINS = [
  7 +<%- node['config']['admins'].each do |admin| %>
  8 + [
  9 + <%- admin.each do |item| %>
  10 + "<%= item %>",
  11 + <%- end %>
  12 + ],
  13 +<% end %>
  14 +]
  15 +
  16 +MANAGERS = ADMINS
  17 +
  18 +# general Django settings
  19 +DEFAULT_FROM_EMAIL = "<%= node['config']['colab_from_address'] %>"
  20 +
  21 +# colab-specific
  22 +COLAB_FROM_ADDRESS = "<%= node['config']['colab_from_address'] %>"
  23 +SERVER_EMAIL = "<%= node['config']['server_email'] %>"
  24 +
  25 +EMAIL_HOST = "localhost"
  26 +EMAIL_PORT = 25
  27 +EMAIL_SUBJECT_PREFIX = "<%= node['config']['email_subject_prefix'] %>"
  28 +
  29 +SECRET_KEY = "<%= File.read('/etc/colab/secret.key').strip %>"
  30 +
  31 +SITE_URL = "<%= node['config']['site_url'] %>"
  32 +
  33 +ALLOWED_HOSTS = ["<%= node['config']['external_hostname'] %>"]
  34 +
  35 +## Disable indexing
  36 +ROBOTS_NOINDEX = False
  37 +
  38 +## Set URL of Colab home
  39 +COLAB_HOME_URL = '/social'
  40 +
  41 +GOOGLE_ANALYTICS_TRACKING_ID = "<%= node['config']['google_analytics_id'] %>"