Finalizing the documentation

This commit is contained in:
Donald Cheng Hong Zou
2021-08-14 23:43:30 -04:00
parent 9d476af384
commit 3140d46c94
3 changed files with 4 additions and 3 deletions

View File

@@ -908,6 +908,7 @@ def download(config_name):
private_key = peer['private_key']
allowed_ip = peer['allowed_ip']
DNS = peer['DNS']
endpoint_allowed_ip = peer['endpoint_allowed_ip']
filename = peer['name']
if len(filename) == 0:
filename = "Untitled_Peers"
@@ -926,7 +927,7 @@ def download(config_name):
filename = filename + "_" + config_name
def generate(private_key, allowed_ip, DNS, public_key, endpoint):
yield "[Interface]\nPrivateKey = " + private_key + "\nAddress = " + allowed_ip + "\nDNS = " + DNS + "\n\n[Peer]\nPublicKey = " + public_key + "\nAllowedIPs = 0.0.0.0/0\nEndpoint = " + endpoint
yield "[Interface]\nPrivateKey = " + private_key + "\nAddress = " + allowed_ip + "\nDNS = " + DNS + "\n\n[Peer]\nPublicKey = " + public_key + "\nAllowedIPs = "+endpoint_allowed_ip+"\nEndpoint = " + endpoint
return app.response_class(generate(private_key, allowed_ip, DNS, public_key, endpoint),
mimetype='text/conf',