Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos
Commits
23e826c4
Commit
23e826c4
authored
Oct 21, 2015
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X Switch to jinja2
parent
c0025cbc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
65 deletions
+82
-65
software/gitlab/instance-gitlab.cfg.in
software/gitlab/instance-gitlab.cfg.in
+34
-25
software/gitlab/instance.cfg.in
software/gitlab/instance.cfg.in
+1
-1
software/gitlab/template/database.yml.in
software/gitlab/template/database.yml.in
+5
-5
software/gitlab/template/gitlab.yml.in
software/gitlab/template/gitlab.yml.in
+28
-25
software/gitlab/template/resque.yml.in
software/gitlab/template/resque.yml.in
+1
-1
software/gitlab/template/smtp_settings.rb.in
software/gitlab/template/smtp_settings.rb.in
+13
-8
No files found.
software/gitlab/instance-gitlab.cfg.in
View file @
23e826c4
...
...
@@ -165,7 +165,7 @@ return = redis_ip redis_port
# GitLab instance setup #
#############################
#
create gitlab dirs structure
#
1. directories
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
...
...
@@ -202,41 +202,50 @@ etc = ${directory:etc}/gitlab-shell
[gitlab-database.yml]
recipe = slapos.recipe.template
url = {{ database_yml_in }}
output = ${gitlab:etc}/database.yml
# FIXME aaa should not be here
aaa = ${request-postgresql:connection-url}
# 2. configuration files
[gitlab-etc-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
rendered= ${gitlab:etc}/${:_buildout_section_name_}
mode = 0640
[database.yml]
<= gitlab-etc-template
template= {{ database_yml_in }}
context =
section pgsql postgresql-urlparse
[gitlab.yml]
recipe = slapos.recipe.template
url = {{ gitlab_yml_in }}
output = ${gitlab:etc}/gitlab.yml
<= gitlab-etc-template
template= {{ gitlab_yml_in }}
context =
section gitlab gitlab
section gitlab_backend gitlab-backend
section instance_parameter instance-parameter
[resque.yml]
recipe = slapos.recipe.template
url = {{ resque_yml_in }}
output = ${gitlab:etc}/resque.yml
# FIXME aaa should not be here
aaa = ${request-redis:connection-redis_ip}
<= gitlab-etc-template
template= {{ resque_yml_in }}
context =
section redis request-redis
[smtp_settings.rb]
recipe = slapos.recipe.template
url = {{ smtp_settings_rb_in }}
output = ${gitlab:etc}/smtp_settings.rb
<= gitlab-etc-template
template= {{ smtp_settings_rb_in }}
context =
section instance_parameter instance-parameter
# TODO log: logrotate
# bin/
#
3.
bin/
# gitlab-rails
# gitlab-rake
#
?
gitlab-unicorn
#
?
gitlab-sidekiq
# gitlab-unicorn
# gitlab-sidekiq
[gitlab-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/${:_buildout_section_name_}
...
...
@@ -318,13 +327,13 @@ command =
# config/
cd config &&
ln -s ${gitlab:etc}/unicorn.rb . &&
ln -s ${gitlab.yml:
output} gitlab.yml
&&
ln -s ${
gitlab-database.yml:output} database.yml
&&
ln -s ${resque.yml:
output} resque.yml
&&
ln -s ${gitlab.yml:
rendered} gitlab.yml
&&
ln -s ${
database.yml:rendered} database.yml
&&
ln -s ${resque.yml:
rendered} resque.yml
&&
# config/initializers/
cd initializers &&
ln -s ${gitlab:etc}/rack_attack.rb . &&
ln -s ${smtp_settings.rb:
output} smtp_settings.rb
&&
ln -s ${smtp_settings.rb:
rendered} smtp_settings.rb
&&
# public/
cd ../../public &&
rm -rf uploads &&
...
...
software/gitlab/instance.cfg.in
View file @
23e826c4
...
...
@@ -17,7 +17,7 @@ default = $${instance-gitlab.cfg:rendered}
[instance-gitlab.cfg]
#<= jinja2-template-base
recipe = slapos.recipe.template:jinja2
mode = 064
0
mode = 064
4
template= ${instance-gitlab.cfg.in:target}
rendered= $${buildout:directory}/instance-gitlab.cfg
context =
...
...
software/gitlab/template/database.yml.in
View file @
23e826c4
...
...
@@ -7,10 +7,10 @@ production:
adapter: postgresql
encoding: unicode
#database: gitlabhq_production
database:
${postgresql-urlparse:path
}
database:
{{ pgsql.path }
}
pool: 10
username: '
${postgresql-urlparse:username
}'
password: '
${postgresql-urlparse:password
}'
host:
${postgresql-urlparse:host
}
port:
${postgresql-urlparse:port
}
username: '
{{ pgsql.username }
}'
password: '
{{ pgsql.password }
}'
host:
{{ pgsql.host }
}
port:
{{ pgsql.port }
}
# socket:
software/gitlab/template/gitlab.yml.in
View file @
23e826c4
...
...
@@ -4,6 +4,9 @@
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
# (last updated for v7.13.0.rc2)
{# cfg(name) -> instance_parameter:configuration.<name> #}
{% macro cfg(name) %}{{ instance_parameter[str("configuration." + name)] }}{% endmacro %}
production: &base
#
# 1. GitLab app settings
...
...
@@ -12,30 +15,30 @@ production: &base
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host:
${gitlab-backend:host
}
port:
${gitlab-backend:port
}
host:
{{ gitlab_backend.host }
}
port:
{{ gitlab_backend.port }
}
# TODO
#https: <%= @gitlab_https %>
https: false
# XXX temp workaround for gitlab not building correct url for host being ipv6 addr
url:
${gitlab-backend:url
}
url:
{{ gitlab_backend.url }
}
user:
${gitlab-backend:user
}
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_enabled:
{{ cfg('email_enabled') }
}
email_from:
{{ cfg('email_from') }
}
email_display_name:
{{ cfg('email_display_name') }
}
email_reply_to:
{{ cfg('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
}
default_can_create_group:
{{ cfg('default_can_create_group') }
}
username_changing_enabled:
{{ cfg('username_changing_enabled') }
}
default_theme:
{{ cfg('default_theme') }
}
# TODO
# restricted_visibility_levels: ...
...
...
@@ -43,14 +46,14 @@ production: &base
## 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
}'
issues:
{{ cfg('default_projects_features.issues') }
}
merge_requests:
{{ cfg('default_projects_features.merge_requests') }
}
wiki:
{{ cfg('default_projects_features.wiki') }
}
snippets:
{{ cfg('default_projects_features.snippets') }
}
visibility_level: '
{{ cfg("default_projects_features.visibility_level") }
}'
## Webhook settings
webhook_timeout:
${instance-parameter:configuration.webhook_timeout
}
webhook_timeout:
{{ cfg('webhook_timeout') }
}
# TODO
# repository_downloads_path: ...
...
...
@@ -89,8 +92,8 @@ production: &base
## Backup settings
backup:
path:
${gitlab:backup
}
keep_time:
${instance-parameter:configuration.backup_keep_time
}
path:
{{ gitlab.backup }
}
keep_time:
{{ cfg('backup_keep_time') }
}
upload:
# TODO ?
# connection: ...
...
...
@@ -100,10 +103,10 @@ production: &base
## GitLab Shell settings
gitlab_shell:
path:
${gitlab-backend:gitlab-shell
}
path:
{{ gitlab_backend['gitlab-shell'] }
}
repos_path:
${gitlab:repositories
}
hooks_path:
${gitlab-backend:gitlab-shell
}/hooks/
repos_path:
{{ gitlab.repositories }
}
hooks_path:
{{ gitlab_backend['gitlab-shell'] }
}/hooks/
# Git over HTTP is enabled
upload_pack: true
...
...
@@ -115,9 +118,9 @@ production: &base
## Git settings
git:
bin_path:
${gitlab-backend:git
}
max_size:
${instance-parameter:configuration.git_max_size
}
timeout:
${instance-parameter:configuration.git_timeout
}
bin_path:
{{ gitlab_backend.git }
}
max_size:
{{ cfg('git_max_size') }
}
timeout:
{{ cfg('git_timeout') }
}
#
...
...
software/gitlab/template/resque.yml.in
View file @
23e826c4
...
...
@@ -3,4 +3,4 @@
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/resque.yml.example
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/resque.yml.erb
production: redis://[
${request-redis:connection-redis_ip}]:${request-redis:connection-redis_port
}
production: redis://[
{{ redis['connection-redis_ip'] }}]:{{ redis['connection-redis_port'] }
}
software/gitlab/template/smtp_settings.rb.in
View file @
23e826c4
...
...
@@ -3,17 +3,22 @@
# 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
{# cfg(name) -> instance_parameter:configuration.<name> #}
{# XXX dup -> import from gitlab.yml.in ? #}
{% macro cfg(name) %}{{ instance_parameter[str("configuration." + name)] }}{% endmacro %}
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
}'
address: "
{{ cfg('smtp_address') }
}",
port:
{{ cfg('smtp_port') }
},
user_name: "
{{ cfg('smtp_user_name') }
}",
password: "
{{ cfg('smtp_password') }
}",
domain: "
{{ cfg('smtp_domain') }
}",
authentication: :
{{ cfg('smtp_authentication') }
},
enable_starttls_auto:
{{ cfg('smtp_enable_starttls_auto') }
},
openssl_verify_mode: '
{{ cfg("smtp_openssl_verify_mode") }
}'
}
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment