certificate_authorities: /etc/pki/tls/certs/ca-bundle.crt | certificate_authorities: /etc/pki/tls/certs/ca-bundle.crt | ||||
url: https://example.org/ | url: https://example.org/ | ||||
server: | server: | ||||
listen: 127.0.0.1:3000 | |||||
rails_environment: production | rails_environment: production | ||||
settings: | settings: | ||||
pod_name: example diaspora* pod | pod_name: example diaspora* pod |
certificate_authorities: /etc/pki/tls/certs/ca-bundle.crt | certificate_authorities: /etc/pki/tls/certs/ca-bundle.crt | ||||
url: https://example.org/ | url: https://example.org/ | ||||
server: | server: | ||||
listen: 127.0.0.1:3000 | |||||
rails_environment: production | rails_environment: production | ||||
settings: | settings: | ||||
pod_name: example diaspora* pod | pod_name: example diaspora* pod |
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | certificate_authorities: /etc/ssl/certs/ca-certificates.crt | ||||
url: https://example.org/ | url: https://example.org/ | ||||
server: | server: | ||||
listen: 127.0.0.1:3000 | |||||
rails_environment: production | rails_environment: production | ||||
settings: | settings: | ||||
pod_name: example diaspora* pod | pod_name: example diaspora* pod |
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | certificate_authorities: /etc/ssl/certs/ca-certificates.crt | ||||
url: https://example.org/ | url: https://example.org/ | ||||
server: | server: | ||||
listen: 127.0.0.1:3000 | |||||
rails_environment: production | rails_environment: production | ||||
settings: | settings: | ||||
pod_name: example diaspora* pod | pod_name: example diaspora* pod |
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | certificate_authorities: /etc/ssl/certs/ca-certificates.crt | ||||
url: https://example.org/ | url: https://example.org/ | ||||
server: | server: | ||||
listen: 127.0.0.1:3000 | |||||
rails_environment: production | rails_environment: production | ||||
settings: | settings: | ||||
pod_name: example diaspora* pod | pod_name: example diaspora* pod |
certificate_authorities: /etc/ssl/certs/ca-certificates.crt | certificate_authorities: /etc/ssl/certs/ca-certificates.crt | ||||
url: https://example.org/ | url: https://example.org/ | ||||
server: | server: | ||||
listen: 127.0.0.1:3000 | |||||
rails_environment: production | rails_environment: production | ||||
settings: | settings: | ||||
pod_name: example diaspora* pod | pod_name: example diaspora* pod |
it { should be_owned_by 'diaspora' } | it { should be_owned_by 'diaspora' } | ||||
it { should be_grouped_into 'root' } | it { should be_grouped_into 'root' } | ||||
its('mode') { should cmp '0600' } | its('mode') { should cmp '0600' } | ||||
its('content') do | its('content') do | ||||
should include '# This file is managed by Salt! Do not edit by hand!' | should include '# This file is managed by Salt! Do not edit by hand!' | ||||
end | end | ||||
its('content') do | |||||
should include <<~CONTENT | |||||
postgresql: &postgresql | |||||
adapter: postgresql | |||||
host: localhost | |||||
port: 5432 | |||||
username: diaspora | |||||
password: "secret" | |||||
encoding: unicode | |||||
CONTENT | |||||
end | |||||
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 | describe file('/srv/diaspora/config/diaspora.yml') do | ||||
it { should be_file } | it { should be_file } | ||||
it { should be_owned_by 'diaspora' } | it { should be_owned_by 'diaspora' } | ||||
it { should be_grouped_into 'root' } | it { should be_grouped_into 'root' } | ||||
its('mode') { should cmp '0600' } | its('mode') { should cmp '0600' } | ||||
its('content') do | its('content') do | ||||
should include '# This file is managed by Salt! Do not edit by hand!' | should include '# This file is managed by Salt! Do not edit by hand!' | ||||
end | end | ||||
its('content') { should include 'rails_environment: production' } | its('content') { should include 'rails_environment: production' } | ||||
its('content') { should include "certificate_authorities: #{ca_file}" } | |||||
end | end | ||||
end | end |
# 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 |
# 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 |
user: | user: | ||||
shell: /bin/bash | shell: /bin/bash | ||||
configuration: | |||||
server: | |||||
listen: 127.0.0.1:3000 |