@@ -6,6 +6,7 @@ configuration: | |||
certificate_authorities: /etc/pki/tls/certs/ca-bundle.crt | |||
url: https://example.org/ | |||
server: | |||
listen: 127.0.0.1:3000 | |||
rails_environment: production | |||
settings: | |||
pod_name: example diaspora* pod |
@@ -6,6 +6,7 @@ configuration: | |||
certificate_authorities: /etc/pki/tls/certs/ca-bundle.crt | |||
url: https://example.org/ | |||
server: | |||
listen: 127.0.0.1:3000 | |||
rails_environment: production | |||
settings: | |||
pod_name: example diaspora* pod |
@@ -6,6 +6,7 @@ configuration: | |||
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | |||
url: https://example.org/ | |||
server: | |||
listen: 127.0.0.1:3000 | |||
rails_environment: production | |||
settings: | |||
pod_name: example diaspora* pod |
@@ -6,6 +6,7 @@ configuration: | |||
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | |||
url: https://example.org/ | |||
server: | |||
listen: 127.0.0.1:3000 | |||
rails_environment: production | |||
settings: | |||
pod_name: example diaspora* pod |
@@ -6,6 +6,7 @@ configuration: | |||
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | |||
url: https://example.org/ | |||
server: | |||
listen: 127.0.0.1:3000 | |||
rails_environment: production | |||
settings: | |||
pod_name: example diaspora* pod |
@@ -6,6 +6,7 @@ configuration: | |||
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | |||
url: https://example.org/ | |||
server: | |||
listen: 127.0.0.1:3000 | |||
rails_environment: production | |||
settings: | |||
pod_name: example diaspora* pod |
@@ -8,19 +8,43 @@ control 'diaspora configuration' do | |||
it { should be_owned_by 'diaspora' } | |||
it { should be_grouped_into 'root' } | |||
its('mode') { should cmp '0600' } | |||
its('content') do | |||
should include '# This file is managed by Salt! Do not edit by hand!' | |||
end | |||
its('content') do | |||
should include <<~CONTENT | |||
postgresql: &postgresql | |||
adapter: postgresql | |||
host: localhost | |||
port: 5432 | |||
username: diaspora | |||
password: "secret" | |||
encoding: unicode | |||
CONTENT | |||
end | |||
end | |||
ca_file = | |||
case platform[:family] | |||
when 'debian' | |||
'/etc/ssl/certs/ca-certificates.crt' | |||
when 'redhat' | |||
'/etc/pki/tls/certs/ca-bundle.crt' | |||
end | |||
describe file('/srv/diaspora/config/diaspora.yml') do | |||
it { should be_file } | |||
it { should be_owned_by 'diaspora' } | |||
it { should be_grouped_into 'root' } | |||
its('mode') { should cmp '0600' } | |||
its('content') do | |||
should include '# This file is managed by Salt! Do not edit by hand!' | |||
end | |||
its('content') { should include 'rails_environment: production' } | |||
its('content') { should include "certificate_authorities: #{ca_file}" } | |||
end | |||
end |
@@ -0,0 +1,24 @@ | |||
# frozen_string_literal: true | |||
control 'diaspora webserver' do | |||
impact 0.5 | |||
title 'should be working' | |||
https_header = { 'X-Forwarded-Proto': 'https' } | |||
30.times do | |||
break if port(3000).listening? | |||
puts "Port 3000 isn't ready, retrying.." | |||
sleep 1 | |||
end | |||
describe http('http://localhost:3000', headers: https_header) do | |||
its('status') { should cmp 302 } | |||
its('headers.Location') { should cmp 'https://localhost:3000/podmin' } | |||
end | |||
describe http('http://localhost:3000/podmin', headers: https_header) do | |||
its('status') { should cmp 200 } | |||
end | |||
end |
@@ -0,0 +1,10 @@ | |||
# frozen_string_literal: true | |||
control 'diaspora' do | |||
impact 0.5 | |||
title 'should be installed' | |||
describe directory('/srv/diaspora/.git') do | |||
it { should be_owned_by 'diaspora' } | |||
end | |||
end |
@@ -6,3 +6,7 @@ diaspora: | |||
user: | |||
shell: /bin/bash | |||
configuration: | |||
server: | |||
listen: 127.0.0.1:3000 |