diff options
Diffstat (limited to 'protocols/luci-proto-yggdrasil')
-rw-r--r-- | protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js | 6 | ||||
-rwxr-xr-x | protocols/luci-proto-yggdrasil/root/usr/libexec/rpcd/luci.yggdrasil | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js b/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js index 3b878799a1..849242abff 100644 --- a/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js +++ b/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js @@ -50,10 +50,12 @@ var cbiKeyPairGenerate = form.DummyValue.extend({ 'class':'btn', 'click':ui.createHandlerFn(this, function(section_id,ev) { var prv = this.section.getUIElement(section_id,'private_key'), + pub = this.section.getUIElement(section_id,'public_key'), map = this.map; return generateKey().then(function(keypair){ prv.setValue(keypair.priv); + pub.setValue(keypair.pub); map.save(null,true); }); },section_id) @@ -189,6 +191,10 @@ return network.registerProtocol('yggdrasil', o.password=true; o.validate=validatePrivateKey; + o=s.taboption('general',form.Value,'public_key',_('Public key'),_('The public key for your Yggdrasil node')); + o.optional=true; + o.validate=validatePublicKey; + s.taboption('general',cbiKeyPairGenerate,'_gen_server_keypair',' '); o=s.taboption('advanced',form.Value,'mtu',_('MTU'),_('A default MTU of 65535 is set by Yggdrasil. It is recomended to utilize the default.')); diff --git a/protocols/luci-proto-yggdrasil/root/usr/libexec/rpcd/luci.yggdrasil b/protocols/luci-proto-yggdrasil/root/usr/libexec/rpcd/luci.yggdrasil index d4545277ab..35d6627be7 100755 --- a/protocols/luci-proto-yggdrasil/root/usr/libexec/rpcd/luci.yggdrasil +++ b/protocols/luci-proto-yggdrasil/root/usr/libexec/rpcd/luci.yggdrasil @@ -16,12 +16,12 @@ case "$1" in case "$2" in generateKeyPair) json_load "$(yggdrasil -genconf -json)" - json_get_vars PublicKey PrivateKey + json_get_vars PrivateKey json_cleanup json_init json_add_object "keys" json_add_string "priv" "$PrivateKey" - json_add_string "pub" "$PublicKey" + json_add_string "pub" "${PrivateKey:64}" json_close_object json_dump ;; |