Coder Social home page Coder Social logo

namecoin / nmcontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from khalahan/nmcontrol

136.0 26.0 39.0 798 KB

Namecoin Control. This repo is deprecated in favor of https://github.com/namecoin/ncdns

Python 95.95% Batchfile 1.39% Shell 0.19% Inno Setup 2.48%

nmcontrol's Introduction

NMControl

Copyright: 2012- Namecoin Project
License: LGPLv3 (unless otherwise noted in code)
Original idea and implementation: Khal

NMControl connects .bit domain lookups to the Namecoin client to allow for easy browsing of .bit domains. It's modular design allows for easy extension via plugins.

On the first start NMControl will generate various configuration files which can be edited to change behavior (see below for operating system specific folder locations). NMControl needs to be restarted for changes to the configuration files to take effect.

Prerequisites

Fetching data from an API server or as an SPV client is in development but for now a Namecoin client needs to run and have finished downloading the blockchain. The Namecoin client datadir (= configuration folder) needs to be in the default location. Also you need to create a namecoin.conf file in the Namecoin config folder (with a custom password) like below. Restart the client afterwards.

    # server=1 tells Namecoin Core GUI to accept JSON-RPC commands.
    # By default, only RPC connections from localhost (the local system) are allowed.
    server=1

    # You must set rpcuser and rpcpassword to secure the JSON-RPC api
    rpcuser=winston
    rpcpassword=USE_THIS_STRING_TO_GET_ROBBED._JUST_HAMMER_YOUR_KEYBOARD

    # namehistory=1 tells Namecoin Core to enable name history at the cost of
    # a slightly larger database (optional) (always enabled for v0.3.x client)
    #namehistory=1

Windows

NMControl config folder in %appdata%\Nmcontrol
Namecoin config folder in %appdata%\Namecoin

Binaries

The setup file will automatically install .bit support on Windows 8 and higher. Only .bit DNS requests will be handled by NMControl in the default configuration. See below for configuration on Windows 7 and lower. Note the system tray icon.

Running from source: Windows

    pip install pywin32
    pip install bottle
    python nmcontrolwin.pyw  # GUI version
    
    # alternatively start console version in debug mode
    python nmcontrol.py --debug=1

Linux / Mac OS X

NMControl config folder Linux: /var/lib/nmcontrol OR ~/.config/nmcontrol
Namecoin config folder Linux: ~/.namecoin

NMControl config folder OS X: ~/Library/Application Support/Nmcontrol
Namecoin config folder OS X: ~/Library/Application Support/Namecoin

Running from source: Linux / Mac OS X

Unfortunately we currently need to be started privileged with sudo so that we can open the local DNS port.

    # install pip on Linux
    sudo apt-get install python-pip

    # install pip on Mac OS X
    sudo easy_install pip

    sudo pip install bottle
    
    git clone https://github.com/namecoin/nmcontrol/
    cd nmcontrol
    sudo python ./nmcontrol.py

    # alternatively start in debug mode:
    sudo python nmcontrol.py --daemon=0 --debug=1 start

DNS config on Linux / Mac OS X / Manual DNS config Windows 7 and below

Point your primary system DNS to 127.0.0.1 (leave the secondary empty). This will redirect ALL your DNS requests to NMControl so you should to tell NMControl how to handle things as follows.
In %appdata%/Nmcontrol/conf/service-dns.conf:
set disable_standard_lookups to 0 (and make sure there is no semicolon ";" in front)
optional: set resolver to your favorite DNS server if you don't like the Google default ones. (often this is a router IP address, e.g. 192.168.0.1). ; There has to be a comma at the end!
Restart NMControl
You can test on the command line like this: nslookup namecoin.org 127.0.0.1 or nslookup nx.bit 127.0.0.1.

; service-dns.conf example

[dns]
; Launch at startup
;start=1

; Listen on ip
;host=127.0.0.1

; Disable lookups for standard domains
disable_standard_lookups=0

; Listen on port
;port=53

; Forward standard requests to your standard DNS
; There has to be a comma at the end!
; e.g. lokal router ip: resolver=192.168.0.1,
; e.g. Google DNS: resolver=8.8.8.8, 8.8.4.4,
resolver=192.168.0.1,

Developer Notes

The windows build system consisting of the PyInstaller batch files "build_windows_gui.bat" and "build_windows_console.bat" as well as the InnoSetup "setup_script.iss" might be replaced with something different in the future.

nmcontrol's People

Contributors

blrhc avatar domob1812 avatar gboily avatar jeremyrand avatar jimmysong avatar josephbisch avatar jrwe avatar khalahan avatar lukehoersten avatar phelixbtc avatar phelixnmc avatar uvadn2vuw2amensu19cy7ic24gvp7fd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmcontrol's Issues

Port to Android

Python runs on Android, so it's plausible that we could run NMControl on Android with minimal modifications. (We could access a namecoind instance remotely.)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5097616-port-to-android?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Tor Support

continued from: #58 (comment)

@JeremyRand There is a current version of Socksipy/Pysocks that looks more stable and maintained: https://github.com/Anorov/PySocks Also it can be used without monkey patching. What do you think? In any case I suggest we create a separate module to handle all outside connections (replacing urllib2) to keep things lean and mean.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24819830-tor-support?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Plugin Management

Forgive my ignorance of previous discussions, but shouldn't the plugins be modularized away from the core repo? This occurred to me while working on a post about development vs stable branches and I don't think that major changes to a plugin shouldn't require breaking the main repo or switching branches.

I'm not sure what the right level of abstraction is, perhaps there should be a repo with default plugins that is a submodule to namecoin/nmcontrol. Since we have mainly first-party plugins, we could just host them all right there. However, I think each plugin should have it's own directory and perhaps a setup.py file for version info.

I'm not sure if we should have external plugins register with PyPi yet, I don't think that there are enough of them. We could just have a list of links on the main NMControl repo readme.md. Once that get's unwieldy, we could switch to PyPi.....

Expiry Grace Period

Have NMControl bail on names that are about to expire.

https://forum.namecoin.info/viewtopic.php?p=10756#p10756

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9413408-expiry-grace-period?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

nmcontrol can't be launched from another folder

One must change to the directory where nmcontrol.py is to be able to launch it.

When launched from another folder :

~/nmcontrol/nmcontrol.py --help
Traceback (most recent call last):
  File "/home/khal/nmcontrol/nmcontrol.py", line 130, in <module>
    main()
  File "/home/khal/nmcontrol/nmcontrol.py", line 51, in main
    modules = dircache.listdir(modType)
  File "/usr/lib/python2.7/dircache.py", line 28, in listdir
    mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: 'service'

Better error should be shown when Namecoin Core is still syncing

Namecoin Core gives this error when name_show is issued during syncup, so that the user doesn't unexpectedly get old data:

Namecoin is downloading blocks... (code -10)

Unfortunately NMControl isn't aware of this error (it doesn't happen in NamecoinQ), which causes getValue to return False, which isn't a useful error, particularly since a nonexistent name will also (I think) return False.

I suggest raising an exception in the namecoin and rest backends when this is encountered, so that NMControl returns the exception.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24805787-better-error-should-be-shown-when-namecoin-core-is-still-syncing?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Google DNS

For non .bit queries it should not use Google DNS servers by default but use the system default dns resolving.

Resolving of Nameservers & Privacy

For example when resolving explorer.bit NMControl will query a DNS server giving away your ip address.
explorer.bit value:

"map": {
"": {
"ns": [
"ns0.web-sweet-web.net",
"ns1.web-sweet-web.net"
]
}
},

I had not expected it to do that. Not sure whether there is an option to disable lookups like this but IMHO it should be disabled by default.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8163270-resolving-of-nameservers-privacy?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Integrate mitmproxy

Integrate a proxy server using mitmproxy. Hopefully this will make Convergence unnecessary.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7483411-integrate-mitmproxy?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

getIPv4FromNS doesn't handle CNAME records

In _getIPv4FromNS (equivalently, _getIPv6FromNS) the returned results are parsed like this:

return app['services']['dns']._lookup(domain, 1 , server)[0]['data']

But in the case of a CNAME record, that is another domain name and not an IP address. A fix could be to handle the DNS result properly (or use an actual external DNS library for this job), but I'd rather improve the handling of {"ns": "ns.example.com"}-style domains when disable_ns_lookups=1. Specifically, I'd expect the server to return an NS entry in this case, so my own DNS implementation can recurse manually. That imo should be the proper way to do things, instead of relying on nmcontrol to get DNS right.

Ps. Is the A/AAAA record, assuming it exists, even guaranteed to be in the first position of the result, or why does this method simply return [0]?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Use libcoind as a backend instead of namecoind

It would be awesome to have libcoind as an NMControl backend. libcoind supports name_scan and name_filter, so this should be relatively straightforward (unless I'm unaware of something).

To qualify as solving this issue, the solution must be well-documented, and work with both standard and pre-cached modes of NMControl operation.

OS X Auto DNS Config

Here is some information on TLD-specific DNS servers for OS X. We might want to integrate this in the future.

http://passingcuriosity.com/2013/dnsmasq-dev-osx/

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/10764899-os-x-auto-dns-config?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Investigate replacing PyDNS and PyMDS with Unbound

PyDNS and PyMDS don't seem to have undergone much review. Unbound appears to be much more actively maintained, and appears to have received much more review. Unbound also supports DNSSEC, which is a feature that we can't easily add to NMControl in its current state.

Based on looking at the Unbound documentation, it looks like we can replace PyDNS and PyMDS pretty easily. I'm willing to try this if people think it's a good idea.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3972128-investigate-replacing-pydns-and-pymds-with-unbound?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

"Name Lint" Functionality

Would be nice to have the ability to check a name for common errors and make suggestions for ways to fix it. This would be particularly nice if integrated into the web interface.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4417022-name-lint-functionality?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

missing import

diff --git a/plugin/pluginData.py b/plugin/pluginData.py
index 8aa97ae..8672fdc 100644
--- a/plugin/pluginData.py
+++ b/plugin/pluginData.py
@@ -1,4 +1,5 @@
 from common import *
+import traceback
 import json, StringIO, os, sys, time
 import plugin
 import rpcClient

Multiple simultaneous instances of nmcontrol don't produce an error

Expected behavior: running multiple instances of nmcontrol with the same data directory should result in an error.

Observed behavior: Starting multiple instances of nmcontrol doesn't produce an error. Instead, multiple python processes will exist. Sending the stop command will stop one of them; multiple stop commands are necessary to stop all of them.

I think this bug was responsible for a bug report I received regarding FreeSpeechMe.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2963413-multiple-simultaneous-instances-of-nmcontrol-don-t-produce-an-error?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Name Expiration Warning Plugin

Have a notification pop up if a name is close to expiry. Could also go into the client GUI

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9413496-name-expiration-warning-plugin?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Verify that the reload method works as expected

The reload method should apply all changes from the config files; we should test it with all plugins to make sure that the new config file options actually take effect.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/14411176-verify-that-the-reload-method-works-as-expected?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Investigate PyInstaller alternatives

cx_Freeze appears to have a much better feature set than PyInstaller, including support for generating Windows MSI installers, Linux RPM packages, and support for Python 3. We should investigate whether it would be a good idea to switch at some point.

http://cx-freeze.sourceforge.net/

Relevant to #34 and #33

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3036019-investigate-pyinstaller-alternatives?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

import.mode=all "TypeError: string indices must be integers, not str"

Sometimes when I run nmcontrol with "import.mode=all" in plugin-data.conf, I get the following output while it's parsing the name data (might take a couple minutes to show up):

Cmdline args: ['start']
Cmdline options: {'http.host': None, 'dns.host': None, 'data.update.mode': None, 'data.import.file': None, 'data.export.freq': None, 'data.import.from': None, 'data.update.freq': None, 'data.update.from': None, 'rpc.port': None, 'data.export.mode': None, 'dns.resolver': None, 'data.import.namecoin': None, 'data.export.to': None, 'dns.disable_standard_lookups': None, 'data.import.mode': None, 'dns.port': None, 'daemon': '0', 'data.update.file': None, 'http.port': None, 'dns.disable_ns_lookups': None, 'rpc.host': None, 'data.update.namecoin': None, 'debug': '1', 'data.export.file': None}
Plugin domain parent starting
Plugin data parent starting
Plugin guiHttp parent starting
Plugin Data : loading... BackendDataNamecoin: [Plugin guiHttp parent start'
name_filter'Plugin guiHttpConfig parent starting
, '']
Plugins started : domain, guiHttp, guiHttpConfig, dns
Plugin dns parent starting
Plugin main parent starting
Plugin rpc parent starting
Plugin dns parent start
Plugin http parent starting
Plugin guiHttpConfig parent start
Plugin dns parent starting Plugin domain parent start

Service dns started
Exception in thread data:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/home/jeremy/Downloads/NMControl/FreshGit/nmcontrol/lib/plugin.py", line 43, in run
self.start2()
File "/home/jeremy/Downloads/NMControl/FreshGit/nmcontrol/lib/plugin.py", line 56, in start2
return self.pStart()
File "/home/jeremy/Downloads/NMControl/FreshGit/nmcontrol/plugin/pluginData.py", line 74, in pStart
error, data = backend.getAllNames()
File "/home/jeremy/Downloads/NMControl/FreshGit/nmcontrol/lib/backendDataNamecoin.py", line 37, in getAllNames
datas[name['name']] = name
TypeError: string indices must be integers, not str

It doesn't happen consistently, but it happens often enough that it's a major problem. When this occurs, all subsequent name lookups appear to fail.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Installer instructed not to start service at startup, but does the opposite

v0.8:

When installing I chose not to install NMControl as service, but it still tried to start:

2015-09-03 14:33:58,776 - nmcontrol - INFO - ###################################################################################
2015-09-03 14:33:59,065 - nmcontrol - INFO - Daemon mode not possible on MS Windows.

I looked at service-dns.conf and I have this:

[dns]
; Launch at startup
; start=1

Does ; mean this is the default?
It seems the installer always sets this to 1, or doesn't specifically set start=0 even when instructed.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Unnecessary json.dumps in data and dns plugins

Several of the methods in the data and dns plugins are returning a string (generated using json.dumps) instead of simply returning the JSON data itself. This seems completely unnecessary, and makes it more complicated for applications (or people!) to query NMControl. While fixing this will break existing client applications until they're patched (the patch is trivial), I think we should fix this sooner rather than later. (And I speak as the maintainer of at least two applications that will need patching.) Notably, data.getValueProcessed is doing this the correct way already.

If we can get an ACK on the desirability of fixing this, I'm happy to implement the fix.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/10466864-unnecessary-json-dumps-in-data-and-dns-plugins?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

PEP 8 compliance

We should make sure that our code is PEP 8 compliant, particularly before many people are relying on noncompliant aspects of the current codebase.

https://www.python.org/dev/peps/pep-0008/

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9238736-pep-8-compliance?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

TypeError exceptions generated

Hello,

This bit was working just before, but no longer works now, which is unfortunate timing, as I can't double check my results I reported in #21.

Lookup: {'query': '', 'domain': 'flightless.bit', 'src_addr': ('127.0.0.1', 48968), 'qtype': 1, 'qclass': 1}
Resolving : flightless.bit getIp4
BackendDataNamecoin: ['name_show', 'd/flightless']
Traceback (most recent call last):
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginData.py", line 128, in getValueProcessed
    data = json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer
Possible domains : [[]]
* result:  {}
Lookup: {'query': '', 'domain': 'flightless.bit', 'src_addr': ('127.0.0.1', 53632), 'qtype': 1, 'qclass': 1}
Resolving : flightless.bit getIp4
BackendDataNamecoin: ['name_show', 'd/flightless']
Traceback (most recent call last):
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginData.py", line 128, in getValueProcessed
    data = json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer
Possible domains : [[]]
* result:  {}

And:

Lookup: {'query': '', 'domain': 'www.flightless.bit', 'src_addr': ('127.0.0.1', 47829), 'qtype': 1, 'qclass': 1}
Resolving : www.flightless.bit getIp4
BackendDataNamecoin: ['name_show', 'd/flightless']
Traceback (most recent call last):
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginData.py", line 128, in getValueProcessed
    data = json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer
Traceback (most recent call last):
  File "/home/brian/tree/bitcoin/nmcontrol/lib/dnsServer/__init__.py", line 95, in serve
    rcode, an_resource_records = source_instance.get_response(query, ".".join(question), qtype, qclass, src_addr)
  File "/home/brian/tree/bitcoin/nmcontrol/lib/dnsServer/namecoindns.py", line 99, in get_response
    answers = app['services']['dns'].lookup({"query":query, "domain":domain, "qtype":qtype, "qclass":qclass, "src_addr":src_addr})
  File "/home/brian/tree/bitcoin/nmcontrol/service/serviceDNS.py", line 39, in lookup
    return app['plugins']['domain'].lookup(qdict)
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginNamespaceDomain.py", line 182, in lookup
    return self._bitLookup(qdict)
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginNamespaceDomain.py", line 209, in _bitLookup
    answers = app['plugins']['dns'].getIp4(qdict["domain"])
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginDns.py", line 93, in getIp4
    result = self._getRecordForRPC(domain, 'getIp4')
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginDns.py", line 89, in _getRecordForRPC
    self._resolve(domain, recType, result)
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginDns.py", line 82, in _resolve
    handler._resolve(domain, recType, result)
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginNamespaceDomain.py", line 78, in _resolve
    nameData = self._expandSelectedRecord(nameData, subs)
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginNamespaceDomain.py", line 157, in _expandSelectedRecord
    subData = self._fetchSubTree(nameData, subDoms)
  File "/home/brian/tree/bitcoin/nmcontrol/plugin/pluginNamespaceDomain.py", line 141, in _fetchSubTree
    elif 'map' in subData and sub in subData['map']:
TypeError: argument of type 'bool' is not iterable

Did I stuff something up?

Debug output privacy

Right now, debug mode will output a lot of private data (e.g. domains being looked up). We should clearly warn the user of this if debug mode is enabled (both by outputting a warning, and in end user documentation). We should also audit the code to make sure that no private data is leaked outside of debug mode (I wouldn't be surprised at all if we fail this test right now).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9069478-debug-output-privacy?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Binaries & Installer

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2996359-binaries-installer?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

.conf files folder location

On more recent Windows versions there is no write access for any software to the programs folder. This means Nmcontrol will fail when trying to create the default .conf files. I have been playing with a workarounds (ask for elevated privileges when creating the configuration files) but it is not pretty and the proper solution would be to move the .conf files folder some place within the home folder where all other config files are stored (e.g. namecoin.conf).

command line options don't work

Trying variations like --dns.port=8053 didn't seem to work.

I had to use the following hack instead:

diff --git a/lib/dnsServer/__init__.py b/lib/dnsServer/__init__.py
index efaae67..00ece29 100644
--- a/lib/dnsServer/__init__.py
+++ b/lib/dnsServer/__init__.py
@@ -55,6 +55,7 @@ class DnsServer(threading.Thread):
                udps = self.udps
                listen_host = app['services']['dns'].conf['host']
                listen_port = int(app['services']['dns'].conf['port'])
+               listen_port = 8053
                try:
                        udps.bind((listen_host, listen_port))
                except socket.error as e:

Format Validation

Right now you can put spec-invalid data in a name's value and NMControl's "dns" plugin will happily return the invalid data. The dns plugin should actually validate data according to the namespace spec before returning it to user applications.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4426394-format-validation?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

NMControl's handling of "ns" field makes more sense than the spec

The .bit spec says about "ns":

"Note that this delegates all IP related responsibility of this domain and its sub-domains to the master server, effectively bypassing other settings (e.g. ip)."

However, NMControl does not delegate subdomains unless the "map" field is used with "ns" to delegate subdomains.

In my opinion, the spec is broken. There are cases where a domain owner may want to have a 2nd-level domain use a nameserver, but still have control over a 3rd-level domain, which the spec makes impossible. I do not think this is a bug in NMControl; the spec is wrong, and the spec should be revised to match NMControl's behavior.

The difference between spec behavior and NMControl behavior has resulted in some confusion among end users, both on IRC and on Reddit. See comment by @brianmay in #21 for an example of user difficulties caused by this.

Do other developers agree that the NMControl behavior is reasonable?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2845987-nmcontrol-s-handling-of-ns-field-makes-more-sense-than-the-spec?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Dealing with the namecoind RPC interface

The namecoind RPC interface in NMControl is an ugly hack. As far as I can tell it's violating the HTTP spec, and we're just lucky that it works at all. No one wants to maintain that code.

We have 2 options. We could replace it with something more standard. The Bitcoin devs recommend https://github.com/jgarzik/python-bitcoinrpc . That code is actively maintained, and Python3 support is being worked on (though isn't completely working yet). Alternatively, we could switch to relying on Namecoin Core's REST interface.

I would prefer to switch to REST and remove the RPC interface. The reason for this is that right now, NMControl has the capability to issue arbitrary RPC commands, including looking at private data relating to the wallet (although not signing transactions). I would like to restrict NMControl via AppArmor/SELinux or similar things, so that even if NMControl is somehow compromised, it can't do nasty things to namecoind, but this is only possible with the REST interface to namecoind.

Thoughts on this?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/14857886-dealing-with-the-namecoind-rpc-interface?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

DNSCrypt support

We should look at what would be involved in supporting DNSCrypt. This might be as simple as shoving a proxy in the middle of the connection.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7430042-dnscrypt-support?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Port to Python 3

Python 3 is becoming the default on many Linux distros, and Python 2 is not receiving feature updates anymore. We should port to Python 3.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3033117-port-to-python-3?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Standard logging module

The current logging system is pretty inflexible, it doesn't show timestamps, only supports two verbosity levels, and doesn't directly support logging to a file. Python has a standard logging module, has anyone used it before?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9105951-standard-logging-module?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

pLoadconfig doesn't always have access to dependencies

The pLoadconfig method of plugins doesn't have access to all of the plugin's dependencies when the plugin first starts. This causes a nasty race condition where a plugin can fail to be initialized if its dependencies haven't started already. pluginNamespaceDomain is erroring for me because of this (its pLoadconfig method tries to access the "dns" plugin).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/23086219-ploadconfig-doesn-t-always-have-access-to-dependencies?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

NMControl URI Scheme

nmc:id/satoshi

Display value data in browser.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3035288-nmcontrol-uri-scheme?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Fails to resolve IPv6 addresses via external NS

Querying nmcontrol for haasn.bit's AAAA record, I get:

Lookup: {'query': '', 'domain': 'haasn.bit', 'src_addr': ('127.0.0.1', 35362), 'qtype': 28, 'qclass': 1}
Resolving : haasn.bit getIp6
BackendDataNamecoin: ['name_show', 'd/haasn']
Processing import for {u'info': u'nanovps', u'import': u's/nand-tls', u'ns': [u'nandns.wakku.to'], u'email': u'[email protected]'}
Recursing import on s/nand-tls
BackendDataNamecoin: ['name_show', u's/nand-tls']
Processing import for {u'tls': {u'tcp': {u'443': [[1, u'B57ED516A3693B3B43A91562952E103D27A3DC51', 1], [1, u'B898285C31E56592C7292AD922CC258F7E449A64', 1]]}}}
Possible domains : [[]]
Fetching ip6 for haasn.bit in sub-domain []
* result:  {}

It fails to respect and query the configured "ns", instead looks for a hard-coded ip6 and gives up. Meanwhile:

nand@nanodesu ~ λ dig @nandns.wakku.to haasn.bit AAAA +short
2a01:4f8:d13:5245::2

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Stop using optparse

NMControl uses optparse, which has been deprecated since Python 2.7. We should rebase on an API that isn't deprecated.

https://docs.python.org/2/library/optparse.html

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/14359717-stop-using-optparse?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

REST TLS code uses bad TLS settings

As discussed in #49 , the REST TLS code (not yet merged, but probably will be merged soon) supports old SSL/TLS versions and weak and non-forward-secret ciphersuites. I have some untested code that should mostly fix this (and also includes a test script using SSLLabs):

JeremyRand@7226650

However, it needs Python 2.7.9 or Python 3.4. So, we should revisit this once we support Python 3, or once 2.7.9 is supported in more systems (Fedora 21 is using 2.7.8 as of this writing). In the meantime, we should make it absolutely clear to end users that they should NOT be using HTTPS with REST.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8186941-rest-tls-code-uses-bad-tls-settings?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.