Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
630fd7efbf | ||
|
313f0a70a6 |
@ -5,7 +5,7 @@ digd.js
|
|||||||
| [dig.js](https://git.coolaj86.com/coolaj86/dig.js)
|
| [dig.js](https://git.coolaj86.com/coolaj86/dig.js)
|
||||||
| [mdig.js](https://git.coolaj86.com/coolaj86/mdig.js)
|
| [mdig.js](https://git.coolaj86.com/coolaj86/mdig.js)
|
||||||
| **digd.js**
|
| **digd.js**
|
||||||
| A [Root project](https://rootprojects.org).
|
| Sponsored by [Daplie](https://daplie.com).
|
||||||
|
|
||||||
A lightweight DNS / mDNS daemon (server) in node.js.
|
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
|
### 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
|
```bash
|
||||||
npm install -g digd.js
|
npm install -g digd.js
|
||||||
|
@ -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.mdns) {
|
||||||
if (!cli.type) {
|
if (!cli.type) {
|
||||||
cli.type = cli.t = 'PTR';
|
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);
|
require('../lib/tcpd.js').create(cli, dnsd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
dist/etc/systemd/system/digd.js.service
vendored
2
dist/etc/systemd/system/digd.js.service
vendored
@ -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)
|
# Restart on crash (bad signal), but not on 'clean' failure (error exit code)
|
||||||
# Allow up to 3 restarts within 10 seconds
|
# Allow up to 3 restarts within 10 seconds
|
||||||
# (it's unlikely that a user or properly-running script will do this)
|
# (it's unlikely that a user or properly-running script will do this)
|
||||||
Restart=always
|
Restart=on-abnormal
|
||||||
StartLimitInterval=10
|
StartLimitInterval=10
|
||||||
StartLimitBurst=3
|
StartLimitBurst=3
|
||||||
|
|
||||||
|
@ -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 $(whoami):$(whoami) /opt/digd.js /srv/digd.js
|
||||||
chown -R digd:digd /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 NODE_PATH=/opt/digd.js/lib/node_modules
|
||||||
export NPM_CONFIG_PREFIX=/opt/digd.js
|
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
|
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
|
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
|
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
|
/opt/digd.js/bin/node /opt/digd.js/bin/npm install
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -27,9 +27,10 @@ module.exports.create = function (cli, dnsd) {
|
|||||||
|
|
||||||
// TODO pad two bytes for lengths
|
// TODO pad two bytes for lengths
|
||||||
dnsd.onMessage(nb, function (err, newAb, dbgmsg) {
|
dnsd.onMessage(nb, function (err, newAb, dbgmsg) {
|
||||||
var lenbuf = Buffer.from([ newAb.length >> 8, newAb.length & 255 ]);
|
|
||||||
// TODO XXX generate legit error packet
|
// TODO XXX generate legit error packet
|
||||||
if (err) { console.error("Error", err); c.end(); return; }
|
if (err) { console.error("Error", err); c.end(); return; }
|
||||||
|
|
||||||
|
var lenbuf = Buffer.from([ newAb.length >> 8, newAb.length & 255 ]);
|
||||||
console.log('TCP ' + dbgmsg);
|
console.log('TCP ' + dbgmsg);
|
||||||
|
|
||||||
c.write(lenbuf);
|
c.write(lenbuf);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "digd.js",
|
"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.",
|
"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",
|
"main": "bin/digd.js",
|
||||||
"homepage": "https://git.coolaj86.com/coolaj86/digd.js",
|
"homepage": "https://git.coolaj86.com/coolaj86/digd.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user