Compare commits

..

2 Commits
master ... v1.3

Author SHA1 Message Date
AJ ONeal 630fd7efbf handle bad packet more correctly 2018-02-21 11:39:43 -07:00
AJ ONeal 313f0a70a6 enable tcp by default 2017-12-14 20:28:13 -07:00
6 changed files with 10 additions and 14 deletions

View File

@ -5,7 +5,7 @@ digd.js
| [dig.js](https://git.coolaj86.com/coolaj86/dig.js)
| [mdig.js](https://git.coolaj86.com/coolaj86/mdig.js)
| **digd.js**
| A [Root project](https://rootprojects.org).
| Sponsored by [Daplie](https://daplie.com).
A lightweight DNS / mDNS daemon (server) in node.js.
@ -39,7 +39,8 @@ npm install -g 'git+https://git.coolaj86.com/coolaj86/digd.js.git#v1.2.0'
### without git
Don't have git? You can use npm's centralized repository:
Don't have git? Well, you can also bow down to the gods of the centralized, monopolized, concentrated, *dictator*net
(as we like to call it here at Daplie Labs), if that's how you roll:
```bash
npm install -g digd.js

View File

@ -67,12 +67,6 @@ cli.main(function (args, cli) {
}
});
if (!cli.tcp) {
if (!cli.notcp) {
console.info("[WARNING] Set '+notcp' to disable tcp connections. The default behavior changes to +tcp in v1.3");
}
}
if (cli.mdns) {
if (!cli.type) {
cli.type = cli.t = 'PTR';
@ -406,7 +400,7 @@ cli.main(function (args, cli) {
}
}
});
if (cli.tcp /* TODO v1.3 !cli.notcp */) {
if (!cli.notcp) {
require('../lib/tcpd.js').create(cli, dnsd);
}

View File

@ -8,7 +8,7 @@ Wants=network-online.target systemd-networkd-wait-online.service
# Restart on crash (bad signal), but not on 'clean' failure (error exit code)
# Allow up to 3 restarts within 10 seconds
# (it's unlikely that a user or properly-running script will do this)
Restart=always
Restart=on-abnormal
StartLimitInterval=10
StartLimitBurst=3

View File

@ -6,7 +6,7 @@ sudo mkdir -p /opt/digd.js /srv/digd.js
#chown -R $(whoami):$(whoami) /opt/digd.js /srv/digd.js
chown -R digd:digd /opt/digd.js /srv/digd.js
echo "v8.9.3" > /tmp/NODEJS_VER
echo "v8.9.0" > /tmp/NODEJS_VER
export NODE_PATH=/opt/digd.js/lib/node_modules
export NPM_CONFIG_PREFIX=/opt/digd.js
curl -fsSL https://git.coolaj86.com/coolaj86/node-installer.sh/raw/master/install.sh -o ./node-installer.sh.tmp
@ -16,7 +16,7 @@ rm ./node-installer.sh.tmp
git clone https://git.coolaj86.com/coolaj86/digd.js /opt/digd.js/lib/node_modules/digd.js
pushd /opt/digd.js/lib/node_modules/digd.js
git checkout v1.2
git checkout v1.1
/opt/digd.js/bin/node /opt/digd.js/bin/npm install
popd

View File

@ -27,9 +27,10 @@ module.exports.create = function (cli, dnsd) {
// TODO pad two bytes for lengths
dnsd.onMessage(nb, function (err, newAb, dbgmsg) {
var lenbuf = Buffer.from([ newAb.length >> 8, newAb.length & 255 ]);
// TODO XXX generate legit error packet
if (err) { console.error("Error", err); c.end(); return; }
var lenbuf = Buffer.from([ newAb.length >> 8, newAb.length & 255 ]);
console.log('TCP ' + dbgmsg);
c.write(lenbuf);

View File

@ -1,6 +1,6 @@
{
"name": "digd.js",
"version": "1.2.1",
"version": "1.2.0",
"description": "A lightweight DNS / mDNS daemon (server) for creating and capturing DNS and mDNS query and response packets to disk as binary and/or JSON. Options are similar to the Unix dig command.",
"main": "bin/digd.js",
"homepage": "https://git.coolaj86.com/coolaj86/digd.js",