Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
uriPriv = raw_input("Site private URI (if any - press ENTER for new\n: ").strip()
if not uriPriv:
uriPub, uriPriv = sitemgr.node.genkey()
else:
if not fcp.node.uriIsPrivate(uriPriv):
print "Sorry, that's a public URI, we need a private URI"
continue
try:
uriPub = sitemgr.node.invertprivate(uriPriv)
except:
traceback.print_exc()
print "Invalid private URI:\n %s" % uriPriv
continue
break
uriPub = fixUri(uriPub, sitename)
uriPriv = fixUri(uriPriv, sitename)
# good to go - add the site
sitemgr.addSite(name=sitename, dir=sitedir, uriPub=uriPub, uriPriv=uriPriv)
print "Added new freesite: '%s' => %s" % (sitename, sitedir)
while 1:
uriPriv = raw_input("Site private URI (if any - press ENTER for new\n: ").strip()
if not uriPriv:
uriPub, uriPriv = sitemgr.node.genkey()
else:
if not fcp.node.uriIsPrivate(uriPriv):
print "Sorry, that's a public URI, we need a private URI"
continue
try:
uriPub = sitemgr.node.invertprivate(uriPriv)
except:
traceback.print_exc()
print "Invalid private URI:\n %s" % uriPriv
continue
break
uriPub = fixUri(uriPub, sitename)
uriPriv = fixUri(uriPriv, sitename)
# good to go - add the site
sitemgr.addSite(name=sitename, dir=sitedir, uriPub=uriPub, uriPriv=uriPriv)
print "Added new freesite: '%s' => %s" % (sitename, sitedir)