pull/153/merge
JeremyRand 1 year ago committed by GitHub
commit 6277876cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -281,6 +281,61 @@ task:
GOX_TAGS: "" GOX_TAGS: ""
GO_VERSION: latest GO_VERSION: latest
task:
name: Resolve Tests Electrum Unbound
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 1
memory: 1G
install_script:
- curl -o /usr/bin/electrum-nmc https://www.namecoin.org/files/electrum-nmc/electrum-nmc-4.0.0b0/electrum-nmc-nc4.0.0b0-x86_64.AppImage
- chmod +x /usr/bin/electrum-nmc
- curl -o ncdns.tar.gz https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/Cross-Compile%20Go%20latest/binaries/dist/ncdns--linux_amd64.tar.gz
- tar -xaf ./ncdns.tar.gz
- mv ./ncdns-*/bin/* /usr/bin/
- apt-get install -y libcap-dev # For ncdns
- apt-get install -y bind9-utils # For dnssec-keygen
- apt-get install -y bind9-dnsutils # For dig
- apt-get install -y unbound
# Set up DNSSEC
- mkdir KSK
- dnssec-keygen -a RSASHA256 -3 -b 2048 -f KSK -K KSK bit
- mkdir ZSK
- dnssec-keygen -a RSASHA256 -3 -b 2048 -K ZSK bit
- mkdir -p /etc/unbound/keys/ /etc/unbound/conf.d/
- cp KSK/*.key /etc/unbound/keys/bit.key
- cp _doc/unbound/conf.d/ncdns.conf /etc/unbound/conf.d/
- cp _doc/unbound/conf.d/ncdns-dnssec-on.conf /etc/unbound/conf.d/
electrum_background_script:
- electrum-nmc $ELECTRUM_ARGS -v daemon
ncdns_background_script:
- ncdns -ncdns.namecoinrpcusername user -ncdns.namecoinrpcpassword pass -ncdns.bind :5391 -ncdns.privatekey $PWD/KSK/*.private -ncdns.publickey $PWD/KSK/*.key -ncdns.zoneprivatekey $PWD/ZSK/*.private -ncdns.zonepublickey $PWD/ZSK/*.key -xlog.severity DEBUG
resolve_electrum_script:
- while ! electrum-nmc $ELECTRUM_ARGS name_show d/namecoin
- do
- echo Waiting for Electrum-NMC to sync...
- sleep 1s
- done
- electrum-nmc $ELECTRUM_ARGS name_show d/namecoin | grep $NAMECOIN_IP
resolve_ncdns_script:
- dig -p 5391 @127.0.0.1 namecoin.bit
- dig -p 5391 @127.0.0.1 namecoin.bit | grep $NAMECOIN_IP
- dig -p 5391 +tcp @127.0.0.1 namecoin.bit
- dig -p 5391 +tcp @127.0.0.1 namecoin.bit | grep $NAMECOIN_IP
resolve_unbound_script:
- dig -p 53 @127.0.0.1 namecoin.bit
- dig -p 53 @127.0.0.1 namecoin.bit | grep $NAMECOIN_IP
depends_on:
- "Cross-Compile Go latest"
env:
NAMECOIN_IP: "91.219.237.223"
ELECTRUM_ARGS: "--rpcport 8336 --rpcuser user --rpcpassword pass"
# Necessary for Electrum-NMC to find its data directory (for some reason
# HOME isn't set by default in docker_builder)
HOME: /root
task: task:
# GitHub Release Upload # GitHub Release Upload
# TODO: implement this. # TODO: implement this.

@ -28,19 +28,9 @@ Using ncdns with a recursive resolver
------------------------------------- -------------------------------------
Of course the daemon can also be used simply as an authoritative nameserver for Of course the daemon can also be used simply as an authoritative nameserver for
bit. directly. One way to do this is to run a recursive resolver (such as bit. directly. One way to do this is to run a recursive resolver (such as
Unbound) and configure it to serve the zone as a 'stub zone'. Here is an example Unbound) and configure it to serve the zone as a 'stub zone'. An example Unbound configuration file `ncdns.conf` is in `_doc/unbound`.
unbound configuration:
server: If you don't want to use DNSSEC, also add `ncdns-dnssec-off.conf` to Unbound's configuration.
do-not-query-localhost: no
stub-zone:
name: bit.
stub-addr: 127.0.0.1@1153
If you don't want to use DNSSEC, also add:
server:
domain-insecure: bit.
If you do want to use DNSSEC, see the instructions below. If you do want to use DNSSEC, see the instructions below.
@ -71,13 +61,7 @@ if you want to use the key as a trust anchor with a recursive resolver such as
unbound, you should specify `bit`.) unbound, you should specify `bit`.)
If using Unbound as a recursive resolver, you should add the KSK's public key file If using Unbound as a recursive resolver, you should add the KSK's public key file
as a trust anchor to unbound like so: as a trust anchor to unbound, as in `ncdns-dnssec-on.conf` in `_doc/unbound`.
server:
trust-anchor-file: "/etc/unbound/keys/bit.key"
`bit.key` should be the file containing the KSK DNSKEY (or DS) which ncdns is
configured to use.
Building Building
-------- --------
@ -139,7 +123,7 @@ ncdns uses a configuration file which is looked for at `../etc/ncdns.conf`
this and all options on the command line. An annotated example configuration this and all options on the command line. An annotated example configuration
file `ncdns.conf.example` is available in doc. file `ncdns.conf.example` is available in doc.
You will need to setup a `namecoind`, `namecoin-qt` or compatible Namecoin node You will need to setup a `namecoind`, `namecoin-qt`, `electrum-nmc`, or compatible Namecoin node
and enable the JSON-RPC interface. You will then need to provide `ncdns` with and enable the JSON-RPC interface. You will then need to provide `ncdns` with
the address of this interface and any necessary username and password via the the address of this interface and any necessary username and password via the
configuration file. configuration file.
@ -147,9 +131,9 @@ configuration file.
If you only want to resolve .bit names yourself, here is a suggested setup on If you only want to resolve .bit names yourself, here is a suggested setup on
Linux: Linux:
- Install `namecoind` (or `namecoin-qt`) and set it to start automatically - Install `namecoind` (or `namecoin-qt` or `electrum-nmc`) and set it to start automatically
at boot or login. Set up the JSON-RPC interface and make sure it works at boot or login. Set up the JSON-RPC interface and make sure it works
by making a test query: `namecoind name_show d/example`. by making a test query: `namecoin-cli name_show d/example` or `electrum-nmc name_show d/example`.
- Write a ncdns configuration file and set ncdns up to start at boot. - Write a ncdns configuration file and set ncdns up to start at boot.
Since Unbound will tie up port 53, set a different port (ideally one >=1024, Since Unbound will tie up port 53, set a different port (ideally one >=1024,

@ -0,0 +1,4 @@
# Include this file if ncdns has DNSSEC disabled.
server:
domain-insecure: bit.

@ -0,0 +1,6 @@
# Include this file if ncdns has DNSSEC enabled.
server:
# bit.key should be the file containing the KSK DNSKEY (or DS) which ncdns is
# configured to use.
trust-anchor-file: "/etc/unbound/keys/bit.key"

@ -0,0 +1,7 @@
# Include this file if ncdns is in use.
server:
do-not-query-localhost: no
stub-zone:
name: bit.
stub-addr: 127.0.0.1@5391
Loading…
Cancel
Save