Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions plugin/pluginDns.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class pluginDns(plugin.PluginThread):
'getIp4': [1, 1, '<domain>', 'Get a list of IPv4 for the domain'],
'getIp6': [1, 1, '<domain>', 'Get a list of IPv6 for the domain'],
'getOnion': [1, 1, '<domain>', 'Get the .onion for the domain'],
'getIpfs': [1, 1, '<domain>', 'Get the ipfs address for the domain'],
'getI2p': [1, 1, '<domain>', 'Get the i2p config for the domain'],
'getI2p_b32': [1, 1, '<domain>', 'Get the i2p base32 config for the domain'],
'getFreenet': [1, 1, '<domain>', 'Get the freenet config for the domain'],
Expand Down Expand Up @@ -109,6 +110,11 @@ def _getRecordForRPC(self, domain, recType):
if not recType in ['getOnion', 'getFingerprint', 'getTls']: #ToDo: support translate
return '[]'
domain = domain[:-8] + 'bit'
for ext in ['_ipfs.bit', 'b-i', 'ipfs', 'i']:
if domain.endswith(ext):
if not recType is 'getIpfs':
return '[]'
domain = domain[:-len(ext)] + 'bit'
if domain.endswith('_i2p.bit'):
if not recType in ['getI2p', 'getI2p_b32', 'getFingerprint', 'getTls']: #ToDo: support translate
return '[]'
Expand Down Expand Up @@ -163,6 +169,10 @@ def getIp6(self, domain):
def getOnion(self, domain):
return self._getRecordForRPC(domain, 'getOnion')

@plugin.public
def getIpfs(self, domain):
return self._getRecordForRPC(domain, 'getIpfs')

@plugin.public
def getI2p(self, domain):
return self._getRecordForRPC(domain, 'getI2p')
Expand Down
1 change: 1 addition & 0 deletions plugin/pluginNamespaceDomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class pluginNamespaceDomain(plugin.PluginThread):
'getIp4' : 'ip',
'getIp6' : 'ip6',
'getOnion' : 'tor',
'getIpfs' : 'ipfs',
'getI2p' : 'i2p',
'getI2p_b32' : 'i2p_b32',
'getFreenet' : 'freenet',
Expand Down