Skip to content

Commit

Permalink
SideBar plugin: add self-onion in copy-nodes-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
caryoscelus committed Nov 14, 2022
1 parent 21699d0 commit c9ea546
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/Sidebar/SidebarPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import gevent

import util
import main
from Config import config
from Plugin import PluginManager
from Debug import Debug
Expand Down Expand Up @@ -115,11 +116,11 @@ def sidebarRenderPeerStats(self, body, site):
local_html = ""

peer_ips = [peer.key for peer in site.getConnectablePeers(20, allow_private=False)]
self_onion = main.file_server.tor_manager.site_onions.get(site.address, None)
if self_onion is not None:
peer_ips.append(self_onion+'.onion')
peer_ips.sort(key=lambda peer_ip: ".onion:" in peer_ip)
copy_link = "http://127.0.0.1:43110/%s/?zeronet_peers=%s" % (
site.content_manager.contents.get("content.json", {}).get("domain", site.address),
",".join(peer_ips)
)
copy_link = f'http://127.0.0.1:43110/{site.address}/?zeronet_peers={",".join(peer_ips)}'

body.append(_("""
<li>
Expand Down

0 comments on commit c9ea546

Please sign in to comment.