mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
monkeysphere: Clarify arguments for import actions
This commit is contained in:
parent
79edbd6195
commit
cc6f44d87e
@ -39,12 +39,12 @@ def parse_arguments():
|
|||||||
host_import_ssh_key = subparsers.add_parser(
|
host_import_ssh_key = subparsers.add_parser(
|
||||||
'host-import-ssh-key', help='Import host SSH key')
|
'host-import-ssh-key', help='Import host SSH key')
|
||||||
host_import_ssh_key.add_argument(
|
host_import_ssh_key.add_argument(
|
||||||
'hostname', help='Fully-qualified hostname')
|
'domain', help='Fully-qualified domain name')
|
||||||
|
|
||||||
host_import_https_key = subparsers.add_parser(
|
host_import_https_key = subparsers.add_parser(
|
||||||
'host-import-https-key', help='Import host HTTPS key')
|
'host-import-https-key', help='Import host HTTPS key')
|
||||||
host_import_https_key.add_argument(
|
host_import_https_key.add_argument(
|
||||||
'hostname', help='Fully-qualified hostname')
|
'domain', help='Fully-qualified domain name')
|
||||||
|
|
||||||
host_publish_key = subparsers.add_parser(
|
host_publish_key = subparsers.add_parser(
|
||||||
'host-publish-key', help='Push host key to keyserver')
|
'host-publish-key', help='Push host key to keyserver')
|
||||||
@ -92,7 +92,7 @@ def subcommand_host_import_ssh_key(arguments):
|
|||||||
"""Import host SSH key."""
|
"""Import host SSH key."""
|
||||||
output = subprocess.check_output(
|
output = subprocess.check_output(
|
||||||
['monkeysphere-host', 'import-key',
|
['monkeysphere-host', 'import-key',
|
||||||
'/etc/ssh/ssh_host_rsa_key', arguments.hostname])
|
'/etc/ssh/ssh_host_rsa_key', 'ssh://' + arguments.domain])
|
||||||
print(output.decode())
|
print(output.decode())
|
||||||
|
|
||||||
|
|
||||||
@ -100,7 +100,8 @@ def subcommand_host_import_https_key(arguments):
|
|||||||
"""Import host HTTPS key."""
|
"""Import host HTTPS key."""
|
||||||
output = subprocess.check_output(
|
output = subprocess.check_output(
|
||||||
['monkeysphere-host', 'import-key',
|
['monkeysphere-host', 'import-key',
|
||||||
'/etc/ssl/private/ssl-cert-snakeoil.key', arguments.hostname])
|
'/etc/ssl/private/ssl-cert-snakeoil.key',
|
||||||
|
'https://' + arguments.domain])
|
||||||
print(output.decode())
|
print(output.decode())
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ def generate(request, domain):
|
|||||||
if valid_domain:
|
if valid_domain:
|
||||||
try:
|
try:
|
||||||
actions.superuser_run(
|
actions.superuser_run(
|
||||||
'monkeysphere', ['host-import-ssh-key', 'ssh://' + domain])
|
'monkeysphere', ['host-import-ssh-key', domain])
|
||||||
messages.success(request, _('Generated OpenPGP key.'))
|
messages.success(request, _('Generated OpenPGP key.'))
|
||||||
except actions.ActionError as exception:
|
except actions.ActionError as exception:
|
||||||
messages.error(request, str(exception))
|
messages.error(request, str(exception))
|
||||||
@ -70,7 +70,7 @@ def generate_https(request, domain):
|
|||||||
if valid_domain:
|
if valid_domain:
|
||||||
try:
|
try:
|
||||||
actions.superuser_run(
|
actions.superuser_run(
|
||||||
'monkeysphere', ['host-import-https-key', 'https://' + domain])
|
'monkeysphere', ['host-import-https-key', domain])
|
||||||
messages.success(request, _('Generated OpenPGP key.'))
|
messages.success(request, _('Generated OpenPGP key.'))
|
||||||
except actions.ActionError as exception:
|
except actions.ActionError as exception:
|
||||||
messages.error(request, str(exception))
|
messages.error(request, str(exception))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user