Commit 1af248c5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4457e2d5
......@@ -32,7 +32,36 @@ key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
# gitlab instance parameters
configuration.name = XXX
configuration.email_enabled = true
configuration.email_from = admin@example.com
configuration.email_display_name = GitLab
configuration.email_reply_to = noreply@example.com
# FIXME XXX smtp_enable not used yet
configuration.smtp_enable = true
configuration.smtp_address = smtp.server
configuration.smtp_port = 456
configuration.smtp_user_name = smtp user
configuration.smtp_password = smtp password
configuration.smtp_domain = lab.example.com
configuration.smtp_authentication = login
configuration.smtp_enable_starttls_auto = true
configuration.smtp_openssl_verify_mode = peer
configuration.default_can_create_group = true
configuration.username_changing_enabled = true
configuration.default_theme = 2
configuration.default_projects_features.issues = true
configuration.default_projects_features.merge_requests = true
configuration.default_projects_features.wiki = true
configuration.default_projects_features.snippets = true
# NOTE can be public|private|internal
configuration.default_projects_features.visibility_level= public
configuration.webhook_timeout = 10
# for convenience
......@@ -41,6 +70,9 @@ host = ${instance-parameter:ipv6-random}
port = 7777
url = http://[${:host}]:${:port}
# current slapuserX
user = {{ pwd.getpwuid(os.getuid())[0] }}
[publish-instance-info]
recipe = slapos.cookbook:publish
......@@ -124,6 +156,12 @@ output = ${gitlab:etc}/resque.yml
aaa = ${request-redis:connection-redis_ip}
[smtp_settings.rb]
recipe = slapos.recipe.template
url = {{ smtp_settings_rb_in }}
output = ${gitlab:etc}/smtp_settings.rb
# TODO log: logrotate
......@@ -217,7 +255,7 @@ command =
# config/initializers/
cd initializers &&
ln -s ${gitlab:etc}/rack_attack.rb . &&
ln -s ${gitlab:etc}/smtp_settings.rb . &&
ln -s ${smtp_settings.rb:output} smtp_settings.rb &&
# public/
cd ../../public &&
rm -rf uploads &&
......
......@@ -15,6 +15,8 @@ recipe = slapos.recipe.template:jinja2
template= ${instance-gitlab.cfg.in:target}
rendered= $${buildout:directory}/instance-gitlab.cfg
context =
import os os
import pwd pwd
import urlparse urlparse
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -26,6 +28,7 @@ context =
raw database_yml_in ${database.yml.in:target}
raw gitlab_yml_in ${gitlab.yml.in:target}
raw resque_yml_in ${resque.yml.in:target}
raw smtp_settings_rb_in ${smtp_settings.rb.in:target}
[switch-softwaretype]
......
......@@ -197,6 +197,10 @@ url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
<= download-template
# TODO md5sum
[smtp_settings.rb.in]
<= download-template
# TODO md5sum
# [buildout]
......
......@@ -17,6 +17,39 @@ production: &base
#https: <%= @gitlab_https %>
https: false
user: ${gitlab-backend:user}
## Email settings
email_enabled: ${instance-parameter:configuration.email_enabled}
email_from: ${instance-parameter:configuration.email_from}
email_display_name: ${instance-parameter:configuration.email_display_name}
email_reply_to: ${instance-parameter:configuration.email_reply_to}
# Email server smtp settings are in template/smtp_settings.rb.in
## User settings
default_can_create_group: ${instance-parameter:configuration.default_can_create_group}
username_changing_enabled: ${instance-parameter:configuration.username_changing_enabled}
default_theme: ${instance-parameter:configuration.default_theme}
# TODO
# restricted_visibility_levels: ...
# issue_closing_pattern: ...
## Default project features settings
default_projects_features:
issues: ${instance-parameter:configuration.default_projects_features.issues}
merge_requests: ${instance-parameter:configuration.default_projects_features.merge_requests}
wiki: ${instance-parameter:configuration.default_projects_features.wiki}
snippets: ${instance-parameter:configuration.default_projects_features.snippets}
visibility_level: '${instance-parameter:configuration.default_projects_features.visibility_level}'
## Webhook settings
webhook_timeout: ${instance-parameter:configuration.webhook_timeout}
# TODO
# repository_downloads_path: ...
# # no rack-attack enabled
......
# @autogenerated
# see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/smtp_settings.rb.sample
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/smtp_settings.rb.erb
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "${instance-parameter:configuration.smtp_address}",
port: ${instance-parameter:configuration.smtp_port},
user_name: "${instance-parameter:configuration.smtp_user_name}",
password: "${instance-parameter:configuration.smtp_password}",
domain: "${instance-parameter:configuration.smtp_domain}",
authentication: :${instance-parameter:configuration.smtp_authentication},
enable_starttls_auto: ${instance-parameter:configuration.smtp_enable_starttls_auto},
openssl_verify_mode: '${instance-parameter:configuration.smtp_openssl_verify_mode}'
}
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment