summaryrefslogtreecommitdiff
path: root/provider_base
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-05-24 01:35:54 -0700
committerelijah <elijah@riseup.net>2014-06-02 11:28:27 -0700
commit24f0cc3c64aab59db436e0827ba24ec08023100a (patch)
tree179c4464d13b3aed4e8b6b78735508c4bd7cb700 /provider_base
parent09916946f8eb0ab17689255fd626a52ef1808e6a (diff)
added support for /provider.json served from static site.
Diffstat (limited to 'provider_base')
-rw-r--r--provider_base/files/service-definitions/provider.json.erb2
-rw-r--r--provider_base/services/static.json9
2 files changed, 9 insertions, 2 deletions
diff --git a/provider_base/files/service-definitions/provider.json.erb b/provider_base/files/service-definitions/provider.json.erb
index be8ae484..2d0a5886 100644
--- a/provider_base/files/service-definitions/provider.json.erb
+++ b/provider_base/files/service-definitions/provider.json.erb
@@ -7,7 +7,7 @@
hsh['domain'] = domain.full_suffix
# advertise services that are 'user services' and for which there are actually nodes
- hsh['services'] ||= global.services[:service_type => :user_service].field(:name).select do |service|
+ hsh['services'] ||= global.env(environment).services[:service_type => :user_service].field(:name).select do |service|
nodes_like_me[:services => service].any?
end
diff --git a/provider_base/services/static.json b/provider_base/services/static.json
index d9155a84..3bbc1240 100644
--- a/provider_base/services/static.json
+++ b/provider_base/services/static.json
@@ -1,6 +1,13 @@
{
"static": {
- "formats": "=> (self.static.domains||{}).values.collect{|d| (d.locations||{}).values.collect{|l|l['format']}}.flatten.uniq"
+ "formats": "=> (self.static.domains||{}).values.collect{|d| (d.locations||{}).values.collect{|l|l['format']}}.flatten.uniq",
+ // include a copy of provider.json in case any of the configured domains happens to match provider.domain
+ "bootstrap_files": {
+ "domain": "= provider.domain",
+ "enabled": "= (self.static.domains||{})[provider.domain] ? true : false",
+ "provider_json": "=> static.bootstrap_files.enabled ? try{nodes_like_me[:services => 'webapp'].values.first.definition_files['provider']} : nil",
+ "client_version": "= static.bootstrap_files.enabled ? provider.client_version : nil"
+ }
},
"service_type": "public_service"
} \ No newline at end of file