Skip to content

Commit a7acd0f

Browse files
author
GitLab Bot
committed
Automatic merge of gitlab-org/omnibus-gitlab master
2 parents b12afa8 + ac6ec4e commit a7acd0f

File tree

8 files changed

+79
-5
lines changed

8 files changed

+79
-5
lines changed

config/software/pgbouncer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616

1717
name 'pgbouncer'
18-
version = Gitlab::Version.new('pgbouncer', 'pgbouncer_1_18_0')
18+
version = Gitlab::Version.new('pgbouncer', 'pgbouncer_1_21_0')
1919
default_version version.print(false)
2020

2121
license 'ISC'

doc/settings/ssl/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ The certificate is renewed only if it expires in 30 days.
104104
For example, if you set it to renew on the 1st of every month at 00:00 and the
105105
certificate expires on the 31st, then the certificate will expire before it's renewed.
106106

107+
Automatic renewals are managed with [go-crond](https://github.com/webdevops/go-crond).
108+
If wanted, one can pass [CLI arguments](https://github.com/webdevops/go-crond#usage) to
109+
go-crond by editing the `/etc/gitlab/gitlab.rb`:
110+
111+
```ruby
112+
crond['flags'] = {
113+
'log.json' = true,
114+
'server.bind' = ':8040'
115+
}
116+
```
117+
107118
To disable the automatic renewal:
108119

109120
1. Edit `/etc/gitlab/gitlab.rb`:

files/gitlab-config-template/gitlab.rb.template

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,7 +3209,7 @@ external_url 'GENERATED_EXTERNAL_URL'
32093209
# patroni['tls_verify'] = true
32103210

32113211
################################################################################
3212-
# Consul (EEP only)
3212+
# Consul (EE only)
32133213
################################################################################
32143214
# consul['enable'] = false
32153215
# consul['dir'] = '/var/opt/gitlab/consul'
@@ -3327,7 +3327,7 @@ external_url 'GENERATED_EXTERNAL_URL'
33273327
#### encoded with base64
33283328
# gitlab_rails['service_desk_email_auth_token'] = nil
33293329

3330-
################################################################################
3330+
#################################################################################
33313331
## Spamcheck (EE only)
33323332
#################################################################################
33333333

@@ -3349,3 +3349,10 @@ external_url 'GENERATED_EXTERNAL_URL'
33493349
# 'SSL_CERT_DIR' => '/opt/gitlab/embedded/ssl/cers'
33503350
# }
33513351
# spamcheck['classifier']['log_directory'] = "/var/log/gitlab/spam-classifier"
3352+
3353+
#################################################################################
3354+
## (Go-)Crond
3355+
#################################################################################
3356+
# crond['log_directory'] = '/var/log/gitlab/crond'
3357+
# crond['cron_d'] = '/var/opt/gitlab/crond'
3358+
# crond['flags'] = {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
default['crond']['enable'] = false
22
default['crond']['log_directory'] = '/var/log/gitlab/crond'
33
default['crond']['cron_d'] = '/var/opt/gitlab/crond'
4+
default['crond']['flags'] = {}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require 'shellwords'
2+
3+
class CrondHelper
4+
attr_reader :node
5+
6+
def initialize(node)
7+
@node = node
8+
end
9+
10+
def flags
11+
config = []
12+
13+
node['crond']['flags'].each do |flag_key, flag_value|
14+
next if flag_key == 'include' || flag_value == false
15+
16+
config << if flag_value == true
17+
"--#{flag_key}"
18+
elsif !flag_value.empty?
19+
"--#{flag_key}=#{Shellwords.escape(flag_value)}"
20+
end
21+
end
22+
23+
config << "--include=#{Shellwords.escape(node['crond']['cron_d'])}"
24+
25+
config.join(" ")
26+
end
27+
end

files/gitlab-cookbooks/crond/recipes/enable.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
owner "root"
2121
end
2222

23+
crond_flags = CrondHelper.new(node).flags
24+
2325
runit_service "crond" do
2426
owner "root"
2527
group "root"
2628
options({
27-
cron_d: node['crond']['cron_d'],
29+
flags: crond_flags,
2830
log_directory: logging_settings[:log_directory],
2931
log_user: logging_settings[:runit_owner],
3032
log_group: logging_settings[:runit_group]

files/gitlab-cookbooks/crond/templates/default/sv-crond-run.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ exec 2>&1
66

77
exec chpst -P \
88
/opt/gitlab/embedded/bin/go-crond \
9-
--include=<%= @options[:cron_d] %>
9+
<%= @options[:flags] %>

spec/chef/cookbooks/crond/recipes/crond_enable_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,32 @@
2020

2121
it_behaves_like "enabled runit service", "crond", "root", "root"
2222

23+
context 'custom flags' do
24+
before do
25+
stub_gitlab_rb(
26+
crond: {
27+
enable: true,
28+
flags: {
29+
'verbose': true,
30+
'auto': false,
31+
'log-json': true,
32+
'default-user': 'user'
33+
}
34+
}
35+
)
36+
end
37+
38+
it "should pass correct options to runit_service" do
39+
expect(chef_run).to render_file("/opt/gitlab/sv/crond/run").with_content { |content|
40+
expect(content).to match(/--include=\/var\/opt\/gitlab\/crond/)
41+
expect(content).to match(/--default-user=user/)
42+
expect(content).to match(/--log-json/)
43+
expect(content).to match(/--verbose/)
44+
expect(content).not_to match(/--auto/)
45+
}
46+
end
47+
end
48+
2349
context 'log directory and runit group' do
2450
context 'default values' do
2551
before do

0 commit comments

Comments
 (0)