assert_files_missing! :ca_cert, :ca_key
assert_config! 'provider.ca.name'
assert_config! 'provider.ca.bit_size'
+ assert_config! 'provider.ca.life_span'
provider = manager.provider
root = CertificateAuthority::Certificate.new
end
# set expiration
- years = 2
- today = Date.today
- root.not_before = Time.gm today.year, today.month, today.day
- root.not_after = root.not_before + years * 60 * 60 * 24 * 365
+ root.not_before = today
+ root.not_after = years_from_today(provider.ca.life_span.to_i)
# generate private key
root.serial_number.number = 1
cert.subject.common_name = node.domain.full
# set expiration
- years = provider.ca.server_certificates.life_span.to_i
- today = Date.today
- cert.not_before = Time.gm today.year, today.month, today.day
- cert.not_after = cert.not_before + years * 60 * 60 * 24 * 365
+ cert.not_before = today
+ cert.not_after = years_from_today(provider.ca.server_certificates.life_span.to_i)
# generate key
cert.serial_number.number = cert_serial_number(node.domain.full)
Digest::MD5.hexdigest("#{domain_name} -- #{Time.now}").to_i(16)
end
+ def today
+ t = Time.now
+ Time.utc t.year, t.month, t.day
+ end
+
+ def years_from_today(num)
+ t = Time.now
+ Time.utc t.year + num, t.month, t.day
+ end
+
end; end
#
{
"domain": {
- "full_suffix": "rewire.co",
- "internal_suffix": "rewire",
+ "full_suffix": "= global.provider.domain",
+ "internal_suffix": "= global.provider.internal_domain",
"full": "= node.name + '.' + domain.full_suffix",
"internal": "= node.name + '.' + domain.internal_suffix",
"name": "= node.name + '.' + (dns.public ? domain.full_suffix : domain.internal_suffix)"
"authorized_keys": "= file :authorized_keys",
"known_hosts": "= file :known_hosts",
"port": 22
+ },
+ "x509": {
+ "use": false,
+ "cert": "= x509.use ? file(:node_x509_cert) : nil",
+ "key": "= x509.use ? file(:node_x509_key) : nil"
}
- #"x509": {
- # "use": false,
- # "cert": "= x509.use ? file(:node_x509_cert) : nil",
- # "key": "= x509.use ? file(:node_x509_key) : nil"
- #}
}
# General service provider configuration.
#
{
+ "domain": "bitmask.net",
+ "internal_domain": "= domain.sub(/\\..*$/,'.i')",
"name": {
- "en": "The Rewire Company"
+ "en": "Bitmask"
},
"description": {
"en": "A demonstration service provider using the LEAP platform"
"default_language": "en",
"enrollment_policy": "open",
"ca": {
- "name": "Rewire Root CA",
+ "name": "= global.provider.ca.organization + ' Root CA'",
"organization": "= global.provider.name[global.provider.default_language]",
"organizational_unit": "= 'https://' + global.common.domain.full_suffix",
"bit_size": 4096,
+ "life_span": "10y",
"server_certificates": {
"bit_size": 3248,
"life_span": "1y"
--- /dev/null
+{
+ "couch_admin_password": "Wf@W&@fQeK@qcItm-9fH~9ve8A4V5Dua",
+ "couch_webapp_password": "rXYr3RfJyqutsLZ6zQZ=&@WPXWnvdMpe"
+}
{
- "service_type": "internal_service"
+ "service_type": "internal_service",
+ "users": {
+ "admin": {"username":"admin", "password":"= secret :couch_admin_password"},
+ "webapp": {"username":"webapp", "password":"= secret :couch_webapp_password"}
+ }
}
\ No newline at end of file
{
"webapp": {
"modules": ["user", "billing", "help"],
- "couchdb_hosts": "= nodes[:services => :couchdb].field('domain.name')"
+ "couchdb_hosts": "= nodes[:services => :couchdb].field('domain.name')",
+ "couchdb_users": "= global.services['couchdb'].users['admin']"
},
"definition_files": {
"provider": "= file('service-definitions/provider.json.erb')",