Add New Page: You are not allowed to add pages Select section/namespace. New page title.
 

Commotion Service Signing

When a Commotion service is added, an announcement is created and signed by a Serval key. In DR1, the node's primary Serval key is used, and in DR2 it is planned to use a different key for each service. The following is the template used for signing:

<type>$full_type</type>
<domain-name>$domain</domain-name>
<port>$port</port>
<txt-record>application=$APPNAME</txt-record>
<txt-record>ttl=$ttl</txt-record>
<txt-record>ipaddr=$ipaddr</txt-record>
$app_types
<txt-record>icon=$icon</txt-record>
<txt-record>description=$description</txt-record>
<txt-record>expiration=$expiration</txt-record>

Above, each @$variable@ is replaced by the service's relevant information. The one exception is @$app_types@, which has the following format:

<txt-record>type=$type</txt-record>

Note that the above type template is repeated for each service category, all on one line.

Example

The following is an example of a signing template:

<type>_http._tcp</type>
<domain-name>mesh.local</domain-name>
<port>80</port>
<txt-record>application=Dan's webchat server</txt-record>
<txt-record>ttl=2</txt-record>
<txt-record>ipaddr=http://101.70.50.1</txt-record>
<txt-record>type=Community</txt-record><txt-record>type=Fun</txt-record>
<txt-record>icon=http://102.70.50.1/luci-static/commotion/commotion_tiny.png</txt-record>
<txt-record>description=Chat online with your friends!</txt-record>
<txt-record>expiration=86400</txt-record>

A signature is created by piping the filled-out template into the @serval-sign@ program, as follows:

$ echo "<type>_http._tcp</type>
> <domain-name>mesh.local</domain-name>
> <port>80</port>
> <txt-record>application=Dan's webchat server</txt-record>
> <txt-record>ttl=2</txt-record>
> <txt-record>ipaddr=http://101.70.50.1</txt-record>
> <txt-record>type=Community</txt-record><txt-record>type=Fun</txt-record>
> <txt-record>icon=http://102.70.50.1/luci-static/commotion/commotion_tiny.png</txt-record>
> <txt-record>description=Chat online with your friends!</txt-record>
> <txt-record>expiration=86400</txt-record>" \
> |serval-sign
19EB924F907782A4D8600B48C9F64425B1EC675416FA1182BCFEBBC61562197580B114C6992BDE19957712ECD5478341FC90E197819DC83B354867BA35C3B608
5B0DFE63D1848D2F23DDF00D0007CD0FF204649A8107066F7495C8B63F4E2422

The first line of output, a 128-character hex string, is the signature, while the second 64-char hex string is the Serval key used to sign the announcement. You can optionally pass @-s <key>@ to the @serval-sign@ program to use a specific Serval key.

Future improvements

  • Include each service category txt-record on a new line, and sort them alphabetically