Skip to content

Commit 5565827

Browse files
author
Kim Jahn
committed
Allow supervisord environment vars to have "+"
1 parent c0b178c commit 5565827

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

data/export/supervisord/app.conf.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ engine.each_process do |name, process|
99
value = value.gsub('\=', '=')
1010
value = value.gsub('\&', '&')
1111
value = value.gsub('\?', '?')
12+
value = value.gsub('\+', '+')
1213
"#{key}=\"#{value}\""
1314
end
1415
app_names << full_name

spec/foreman/engine_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,15 @@ def shutdown
8383
f.puts "FRED='barney'"
8484
f.puts 'OTHER="escaped\"quote"'
8585
f.puts 'URL="http://example.com/api?foo=bar&baz=1"'
86+
f.puts 'KEY="LkZAMKGHwA9MsLj+rIVLmSMg+p206CeNaliqyFrjt9"'
8687
end
8788
subject.load_env "/tmp/env"
8889
expect(subject.env["FOO"]).to eq("bar")
8990
expect(subject.env["BAZ"]).to eq("qux")
9091
expect(subject.env["FRED"]).to eq("barney")
9192
expect(subject.env["OTHER"]).to eq('escaped"quote')
9293
expect(subject.env["URL"]).to eq("http://example.com/api?foo=bar&baz=1")
94+
expect(subject.env["KEY"]).to eq("LkZAMKGHwA9MsLj+rIVLmSMg+p206CeNaliqyFrjt9")
9395
end
9496

9597
it "should handle multiline strings" do

spec/foreman/export/supervisord_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
before(:each) { allow(supervisord).to receive(:say) }
1515

1616
it "exports to the filesystem" do
17-
write_env(".env", "FOO"=>"bar", "URL"=>"http://example.com/api?foo=bar&baz=1")
17+
write_env(".env", "FOO"=>"bar", "URL"=>"http://example.com/api?foo=bar&baz=1", "KEY"=>"LkZAMKGHwA9MsLj+rIVLmSMg+p206CeNaliqyFrjt9")
1818
supervisord.engine.load_env('.env')
1919
supervisord.export
2020
expect(File.read("/tmp/init/app.conf")).to eq(example_export_file("supervisord/app-alpha-1.conf"))

spec/resources/export/supervisord/app-alpha-1.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ stdout_logfile=/var/log/app/alpha-1.log
66
stderr_logfile=/var/log/app/alpha-1.error.log
77
user=app
88
directory=/tmp/app
9-
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",PORT="5000"
9+
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",KEY="LkZAMKGHwA9MsLj+rIVLmSMg+p206CeNaliqyFrjt9",PORT="5000"
1010

1111
[program:app-bravo-1]
1212
command=./bravo
@@ -16,7 +16,7 @@ stdout_logfile=/var/log/app/bravo-1.log
1616
stderr_logfile=/var/log/app/bravo-1.error.log
1717
user=app
1818
directory=/tmp/app
19-
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",PORT="5100"
19+
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",KEY="LkZAMKGHwA9MsLj+rIVLmSMg+p206CeNaliqyFrjt9",PORT="5100"
2020

2121
[program:app-foo_bar-1]
2222
command=./foo_bar
@@ -26,7 +26,7 @@ stdout_logfile=/var/log/app/foo_bar-1.log
2626
stderr_logfile=/var/log/app/foo_bar-1.error.log
2727
user=app
2828
directory=/tmp/app
29-
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",PORT="5200"
29+
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",KEY="LkZAMKGHwA9MsLj+rIVLmSMg+p206CeNaliqyFrjt9",PORT="5200"
3030

3131
[program:app-foo-bar-1]
3232
command=./foo-bar
@@ -36,7 +36,7 @@ stdout_logfile=/var/log/app/foo-bar-1.log
3636
stderr_logfile=/var/log/app/foo-bar-1.error.log
3737
user=app
3838
directory=/tmp/app
39-
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",PORT="5300"
39+
environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",KEY="LkZAMKGHwA9MsLj+rIVLmSMg+p206CeNaliqyFrjt9",PORT="5300"
4040

4141
[group:app]
4242
programs=app-alpha-1,app-bravo-1,app-foo_bar-1,app-foo-bar-1

0 commit comments

Comments
 (0)