Commit 77a3bfe1debc23586e1947b4f8b1f11c94222dc0

Authored by Andrew8xx8
1 parent ed3f4408

Environments support added to Gitlab config

config/gitlab.yml.example
... ... @@ -7,121 +7,131 @@
7 7 # 2. Replace gitlab -> host with your domain
8 8 # 3. Replace gitlab -> email_from
9 9  
10   -#
11   -# 1. GitLab app settings
12   -# ==========================
13   -
14   -## GitLab settings
15   -gitlab:
16   - ## Web server settings
17   - host: localhost
18   - port: 80
19   - https: false
20   - # Uncomment and customize to run in non-root path
21   - # Note that ENV['RAILS_RELATIVE_URL_ROOT'] in config/unicorn.rb may need to be changed
22   - # relative_url_root: /gitlab
23   -
24   - # Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
25   - # user: git
26   -
27   - ## Email settings
28   - # Email address used in the "From" field in mails sent by GitLab
29   - email_from: gitlab@localhost
30   -
31   - # Email address of your support contact (default: same as email_from)
32   - support_email: support@localhost
33   -
34   - ## Project settings
35   - default_projects_limit: 10
36   - # signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
37   -
38   -## Gravatar
39   -gravatar:
40   - enabled: true # Use user avatar images from Gravatar.com (default: true)
41   - # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
42   - # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
43   -
44   -
45   -
46   -#
47   -# 2. Auth settings
48   -# ==========================
49   -
50   -## LDAP settings
51   -ldap:
52   - enabled: false
53   - host: '_your_ldap_server'
54   - base: '_the_base_where_you_search_for_users'
55   - port: 636
56   - uid: 'sAMAccountName'
57   - method: 'ssl' # "ssl" or "plain"
58   - bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
59   - password: '_the_password_of_the_bind_user'
60   -
61   -## Omniauth settings
62   -omniauth:
63   - # Enable ability for users
64   - # Allow logging in via Twitter, Google, etc. using Omniauth providers
65   - enabled: false
66   -
  10 +production: &base
  11 + #
  12 + # 1. GitLab app settings
  13 + # ==========================
  14 +
  15 + ## GitLab settings
  16 + gitlab:
  17 + ## Web server settings
  18 + host: localhost
  19 + port: 80
  20 + https: false
  21 + # Uncomment and customize to run in non-root path
  22 + # Note that ENV['RAILS_RELATIVE_URL_ROOT'] in config/unicorn.rb may need to be changed
  23 + # relative_url_root: /gitlab
  24 +
  25 + # Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
  26 + # user: git
  27 +
  28 + ## Email settings
  29 + # Email address used in the "From" field in mails sent by GitLab
  30 + email_from: gitlab@localhost
  31 +
  32 + # Email address of your support contact (default: same as email_from)
  33 + support_email: support@localhost
  34 +
  35 + ## Project settings
  36 + default_projects_limit: 10
  37 + # signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
  38 +
  39 + ## Gravatar
  40 + gravatar:
  41 + enabled: true # Use user avatar images from Gravatar.com (default: true)
  42 + # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
  43 + # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
  44 +
  45 +
  46 +
  47 + #
  48 + # 2. Auth settings
  49 + # ==========================
  50 +
  51 + ## LDAP settings
  52 + ldap:
  53 + enabled: false
  54 + host: '_your_ldap_server'
  55 + base: '_the_base_where_you_search_for_users'
  56 + port: 636
  57 + uid: 'sAMAccountName'
  58 + method: 'ssl' # "ssl" or "plain"
  59 + bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
  60 + password: '_the_password_of_the_bind_user'
  61 +
  62 + ## Omniauth settings
  63 + omniauth:
  64 + # Enable ability for users
  65 + # Allow logging in via Twitter, Google, etc. using Omniauth providers
  66 + enabled: false
  67 +
  68 + # CAUTION!
  69 + # This allows users to login without having a user account first (default: false)
  70 + # User accounts will be created automatically when authentication was successful.
  71 + allow_single_sign_on: false
  72 + # Locks down those users until they have been cleared by the admin (default: true)
  73 + block_auto_created_users: true
  74 +
  75 + ## Auth providers
  76 + # Uncomment the lines and fill in the data of the auth provider you want to use
  77 + # If your favorite auth provider is not listed you can user others:
  78 + # see https://github.com/gitlabhq/gitlabhq/wiki/Using-Custom-Omniauth-Providers
  79 + # The 'app_id' and 'app_secret' parameters are always passed as the first two
  80 + # arguments, followed by optional 'args' which can be either a hash or an array.
  81 + providers:
  82 + # - { name: 'google_oauth2', app_id: 'YOUR APP ID',
  83 + # app_secret: 'YOUR APP SECRET',
  84 + # args: { access_type: 'offline', approval_prompt: '' } }
  85 + # - { name: 'twitter', app_id: 'YOUR APP ID',
  86 + # app_secret: 'YOUR APP SECRET'}
  87 + # - { name: 'github', app_id: 'YOUR APP ID',
  88 + # app_secret: 'YOUR APP SECRET' }
  89 +
  90 +
  91 +
  92 + #
  93 + # 3. Advanced settings
  94 + # ==========================
  95 +
  96 + # GitLab Satellites
  97 + satellites:
  98 + # Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
  99 + path: /home/git/gitlab-satellites/
  100 +
  101 + ## Backup settings
  102 + backup:
  103 + path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
  104 + # keep_time: 604800 # default: 0 (forever) (in seconds)
  105 +
  106 + ## GitLab Shell settings
  107 + gitlab_shell:
  108 + # REPOS_PATH MUST NOT BE A SYMLINK!!!
  109 + repos_path: /home/git/repositories/
  110 + hooks_path: /home/git/gitlab-shell/hooks/
  111 +
  112 + # Git over HTTP
  113 + upload_pack: true
  114 + receive_pack: true
  115 +
  116 + # If you use non-standart ssh port you need to specify it
  117 + # ssh_port: 22
  118 +
  119 + ## Git settings
67 120 # CAUTION!
68   - # This allows users to login without having a user account first (default: false)
69   - # User accounts will be created automatically when authentication was successful.
70   - allow_single_sign_on: false
71   - # Locks down those users until they have been cleared by the admin (default: true)
72   - block_auto_created_users: true
73   -
74   - ## Auth providers
75   - # Uncomment the lines and fill in the data of the auth provider you want to use
76   - # If your favorite auth provider is not listed you can user others:
77   - # see https://github.com/gitlabhq/gitlabhq/wiki/Using-Custom-Omniauth-Providers
78   - # The 'app_id' and 'app_secret' parameters are always passed as the first two
79   - # arguments, followed by optional 'args' which can be either a hash or an array.
80   - providers:
81   - # - { name: 'google_oauth2', app_id: 'YOUR APP ID',
82   - # app_secret: 'YOUR APP SECRET',
83   - # args: { access_type: 'offline', approval_prompt: '' } }
84   - # - { name: 'twitter', app_id: 'YOUR APP ID',
85   - # app_secret: 'YOUR APP SECRET'}
86   - # - { name: 'github', app_id: 'YOUR APP ID',
87   - # app_secret: 'YOUR APP SECRET' }
88   -
89   -
90   -
91   -#
92   -# 3. Advanced settings
93   -# ==========================
94   -
95   -# GitLab Satellites
96   -satellites:
97   - # Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
98   - path: /home/git/gitlab-satellites/
99   -
100   -## Backup settings
101   -backup:
102   - path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
103   - # keep_time: 604800 # default: 0 (forever) (in seconds)
104   -
105   -## GitLab Shell settings
106   -gitlab_shell:
107   - # REPOS_PATH MUST NOT BE A SYMLINK!!!
108   - repos_path: /home/git/repositories/
109   - hooks_path: /home/git/gitlab-shell/hooks/
110   -
111   - # Git over HTTP
112   - upload_pack: true
113   - receive_pack: true
114   -
115   - # If you use non-standart ssh port you need to specify it
116   - # ssh_port: 22
117   -
118   -## Git settings
119   -# CAUTION!
120   -# Use the default values unless you really know what you are doing
121   -git:
122   - bin_path: /usr/bin/git
123   - # Max size of git object like commit, in bytes
124   - # This value can be increased if you have a very large commits
125   - max_size: 5242880 # 5.megabytes
126   - # Git timeout to read commit, in seconds
127   - timeout: 10
  121 + # Use the default values unless you really know what you are doing
  122 + git:
  123 + bin_path: /usr/bin/git
  124 + # Max size of git object like commit, in bytes
  125 + # This value can be increased if you have a very large commits
  126 + max_size: 5242880 # 5.megabytes
  127 + # Git timeout to read commit, in seconds
  128 + timeout: 10
  129 +
  130 +development:
  131 + <<: *base
  132 +
  133 +test:
  134 + <<: *base
  135 +
  136 +staging:
  137 + <<: *base
... ...
config/initializers/1_settings.rb
1 1 class Settings < Settingslogic
2 2 source "#{Rails.root}/config/gitlab.yml"
  3 + namespace Rails.env
3 4  
4 5 class << self
5 6 def gitlab_on_non_standard_port?
... ...