Commit 82856100 authored by ibuler's avatar ibuler

[Update] 创建Host Key

parent 6acac9cb
...@@ -71,11 +71,11 @@ def auto_generate_terminal_host_key(sender, **kwargs): ...@@ -71,11 +71,11 @@ def auto_generate_terminal_host_key(sender, **kwargs):
try: try:
if Setting.objects.filter(name='TERMINAL_HOST_KEY').exists(): if Setting.objects.filter(name='TERMINAL_HOST_KEY').exists():
return return
private_key, public_key = ssh_key_gen()
value = json.dumps(private_key)
Setting.objects.create(name='TERMINAL_HOST_KEY', value=value)
except: except:
return pass
private_key, public_key = ssh_key_gen()
value = json.dumps(private_key)
Setting.objects.create(name='TERMINAL_HOST_KEY', value=value)
@receiver(pre_save, dispatch_uid="my_unique_identifier") @receiver(pre_save, dispatch_uid="my_unique_identifier")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment