diff --git a/roles/sockethub.rb b/roles/sockethub.rb index 6b7fcd4..0c3ef58 100644 --- a/roles/sockethub.rb +++ b/roles/sockethub.rb @@ -2,6 +2,16 @@ name "sockethub" default_attributes 'kosmos_redis' => { 'requirepass' => false +}, +'sockethub' => { + 'about' => { + 'name' => 'Kosmos Sockethub', + 'description' => '', + 'contact' => 'ops@kosmos.org', + 'links' => [], + 'showVersion' => false, + 'showUptime' => false + } } run_list %w( diff --git a/site-cookbooks/sockethub/CHANGELOG.md b/site-cookbooks/sockethub/CHANGELOG.md index e5bc8c5..66af729 100644 --- a/site-cookbooks/sockethub/CHANGELOG.md +++ b/site-cookbooks/sockethub/CHANGELOG.md @@ -1,6 +1,16 @@ CHANGELOG ========= +0.4.0 +----- +- Update to sockethub 5.0.0-beta.0 +- The root URL now serves a server info page (and a JSON service descriptor + with `Accept: application/json`); the examples moved to /examples +- Generate the `about` block from `node['sockethub']['about']`, letting the + deployment name, description, contact and links be set in the role +- Set an explicit `platforms` list from `node['sockethub']['platforms']`, + disabling the `@sockethub/platform-dummy` platform in production + 0.3.0 ----- - Update to sockethub 5.0.0-alpha.25 diff --git a/site-cookbooks/sockethub/README.md b/site-cookbooks/sockethub/README.md index 9b1c85b..969be3b 100644 --- a/site-cookbooks/sockethub/README.md +++ b/site-cookbooks/sockethub/README.md @@ -10,7 +10,19 @@ Attributes | Key | Type | Description | Default | | --- | --- | --- | --- | -| `['sockethub']['version']` | String | The npm version of sockethub to install | `5.0.0-alpha.25` | +| `['sockethub']['version']` | String | The npm version of sockethub to install | `5.0.0-beta.0` | | `['sockethub']['port']` | Integer | The local port to run sockethub on | `10550` | | `['sockethub']['domain']` | String | The public domain served by the openresty proxy | `sockethub.kosmos.org` | | `['sockethub']['log_level']` | String | Console log level (error, warn, info, debug) | `info` | +| `['sockethub']['about']['name']` | String | Display name of this instance on the root info page | `''` | +| `['sockethub']['about']['description']` | String | Short description shown on the root info page | `''` | +| `['sockethub']['about']['contact']` | String | Operator contact (email or URL) on the root info page | `''` | +| `['sockethub']['about']['links']` | Array | Extra links (`{ "label": ..., "url": "https://..." }`) on the root info page | `[]` | +| `['sockethub']['about']['showVersion']` | Boolean | Show the exact server version on the root info page | `false` | +| `['sockethub']['about']['showUptime']` | Boolean | Show the process uptime on the root info page | `false` | +| `['sockethub']['platforms']` | Array | Platform packages to load (the production set, without `platform-dummy`) | see `attributes/default.rb` | + +The `about` values are set per deployment in `roles/sockethub.rb`; the cookbook +defaults are empty, so the root info page shows only the technical details. +`links` entries must be objects with a `label` and an `http(s)` `url`. + diff --git a/site-cookbooks/sockethub/attributes/default.rb b/site-cookbooks/sockethub/attributes/default.rb index 1d367c0..76b08ef 100644 --- a/site-cookbooks/sockethub/attributes/default.rb +++ b/site-cookbooks/sockethub/attributes/default.rb @@ -1,4 +1,22 @@ -node.default['sockethub']['version'] = '5.0.0-alpha.25' +node.default['sockethub']['version'] = '5.0.0-beta.0' node.default['sockethub']['port'] = '10550' node.default['sockethub']['domain'] = 'sockethub.kosmos.org' -node.default['sockethub']['log_level'] = 'info' \ No newline at end of file +node.default['sockethub']['log_level'] = 'info' + +node.default['sockethub']['about'] = { + 'name' => '', + 'description' => '', + 'contact' => '', + 'links' => [], + 'showVersion' => false, + 'showUptime' => false, +} + +node.default['sockethub']['platforms'] = [ + '@sockethub/platform-carddav', + '@sockethub/platform-caldav', + '@sockethub/platform-feeds', + '@sockethub/platform-irc', + '@sockethub/platform-metadata', + '@sockethub/platform-xmpp', +] diff --git a/site-cookbooks/sockethub/metadata.rb b/site-cookbooks/sockethub/metadata.rb index 43de904..b586bfb 100644 --- a/site-cookbooks/sockethub/metadata.rb +++ b/site-cookbooks/sockethub/metadata.rb @@ -4,7 +4,7 @@ maintainer_email 'mail@kosmos.org' license 'MIT' description 'Installs/Configures sockethub' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.3.0' +version '0.4.0' depends 'firewall' depends 'kosmos-base' diff --git a/site-cookbooks/sockethub/recipes/default.rb b/site-cookbooks/sockethub/recipes/default.rb index b22f626..8eb4beb 100644 --- a/site-cookbooks/sockethub/recipes/default.rb +++ b/site-cookbooks/sockethub/recipes/default.rb @@ -40,7 +40,9 @@ template "/etc/sockethub/sockethub.config.json" do mode 0640 variables port: node['sockethub']['port'], domain: node['sockethub']['domain'], - log_level: node['sockethub']['log_level'] + log_level: node['sockethub']['log_level'], + about: node['sockethub']['about'], + platforms: node['sockethub']['platforms'] notifies :restart, 'systemd_unit[sockethub_nodejs.service]', :delayed end diff --git a/site-cookbooks/sockethub/templates/default/sockethub.config.json.erb b/site-cookbooks/sockethub/templates/default/sockethub.config.json.erb index be60db8..91d840d 100644 --- a/site-cookbooks/sockethub/templates/default/sockethub.config.json.erb +++ b/site-cookbooks/sockethub/templates/default/sockethub.config.json.erb @@ -1,5 +1,14 @@ { "examples": false, + "platforms": <%= @platforms.to_json %>, + "about": { + "name": <%= @about['name'].to_json %>, + "description": <%= @about['description'].to_json %>, + "contact": <%= @about['contact'].to_json %>, + "links": <%= @about['links'].to_json %>, + "showVersion": <%= @about['showVersion'] ? 'true' : 'false' %>, + "showUptime": <%= @about['showUptime'] ? 'true' : 'false' %> + }, "logging": { "level": "<%= @log_level %>", "file": ""