Skip to content

Commit

Permalink
i forgor oh yea updated syntax and tests to work w node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyannehall committed Nov 20, 2024
1 parent d50475f commit 64e1d06
Show file tree
Hide file tree
Showing 29 changed files with 328 additions and 574 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM debian:buster
FROM debian:bookworm
LABEL maintainer "[email protected]"
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -yq upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install wget apt-transport-https gnupg curl libssl-dev git python build-essential tor
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install wget apt-transport-https gnupg curl libssl-dev git python3 build-essential tor
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
ENV GRANAX_USE_SYSTEM_TOR="1"
RUN git clone https://github.com/tactcicalchihuahua/kadence /root/kadence; \
RUN git clone https://github.com/lilyannehall/kadence /root/kadence; \
cd /root/kadence; \
git fetch --tags; \
git checkout $(git describe --tags `git rev-list --tags --max-count=1`); \
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM debian:buster
FROM debian:bookworm
LABEL maintainer "[email protected]"
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -yq upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install wget apt-transport-https gnupg curl libssl-dev git python build-essential tor
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install wget apt-transport-https gnupg curl libssl-dev git python3 build-essential tor
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
ENV GRANAX_USE_SYSTEM_TOR="1"
RUN git clone https://github.com/tacticalchihuahua/kadence /root/kadence; \
RUN git clone https://github.com/lilyannehall/kadence /root/kadence; \
cd /root/kadence && npm install --unsafe-perm --production
VOLUME ["/root/.config/kadence"]
EXPOSE 5274
Expand Down
6 changes: 3 additions & 3 deletions bin/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';

const ini = require('ini');
const { existsSync, writeFileSync } = require('fs');
const { existsSync, writeFileSync } = require('node:fs');
const mkdirp = require('mkdirp');
const { tmpdir, homedir } = require('os');
const { join } = require('path');
const { tmpdir, homedir } = require('node:os');
const { join } = require('node:path');

const DEFAULT_DATADIR = join(homedir(), '.config/kadence');

Expand Down
12 changes: 6 additions & 6 deletions bin/kadence.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@
// NB: identified by public key hashes and verified by signatures.
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
const { homedir } = require('os');
const assert = require('assert');
const { homedir } = require('node:os');
const assert = require('node:assert');
const async = require('async');
const program = require('commander');
const kadence = require('../index');
const bunyan = require('bunyan');
const RotatingLogStream = require('bunyan-rotating-file-stream');
const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
const options = require('./config');
const npid = require('npid');
const daemon = require('daemon');
const pem = require('pem');
const levelup = require('levelup');
const leveldown = require('leveldown');
const boscar = require('boscar');
const { fork } = require('child_process');
const os = require('os');
const { fork } = require('node:child_process');
const os = require('node:os');
const ms = require('ms');
const rc = require('rc');
const ini = require('ini');
Expand Down
4 changes: 2 additions & 2 deletions lib/messenger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { EventEmitter } = require('events');
const { Transform: TransformStream } = require('stream');
const { EventEmitter } = require('node:events');
const { Transform: TransformStream } = require('node:stream');
const merge = require('merge');
const jsonrpc = require('jsonrpc-lite');
const uuid = require('uuid');
Expand Down
2 changes: 1 addition & 1 deletion lib/node-kademlia.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const async = require('async');
const { Writable: WritableStream } = require('stream');
const { Writable: WritableStream } = require('node:stream');
const constants = require('./constants');
const { knuthShuffle: shuffle } = require('knuth-shuffle');
const utils = require('./utils');
Expand Down
4 changes: 2 additions & 2 deletions lib/plugin-contentaddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

'use strict';

const { createHash } = require('crypto');
const { createHash } = require('node:crypto');
const merge = require('merge');
const assert = require('assert');
const assert = require('node:assert');


/**
Expand Down
4 changes: 2 additions & 2 deletions lib/plugin-eclipse.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

'use strict';

const assert = require('assert');
const assert = require('node:assert');
const utils = require('./utils');
const constants = require('./constants');
const { EventEmitter } = require('events');
const { EventEmitter } = require('node:events');


/**
Expand Down
10 changes: 5 additions & 5 deletions lib/plugin-hashcash.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

'use strict';

const { fork } = require('child_process');
const path = require('path');
const { Transform } = require('stream');
const { fork } = require('node:child_process');
const path = require('node:path');
const { Transform } = require('node:stream');
const async = require('async');
const merge = require('merge');
const jsonrpc = require('jsonrpc-lite');
const crypto = require('crypto');
const assert = require('assert');
const crypto = require('node:crypto');
const assert = require('node:assert');
const LRUCache = require('lru-cache');
const utils = require('./utils');

Expand Down
4 changes: 2 additions & 2 deletions lib/plugin-hibernate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

'use strict';

const { EventEmitter } = require('events');
const { Transform } = require('stream');
const { EventEmitter } = require('node:events');
const { Transform } = require('node:stream');
const merge = require('merge');
const bytes = require('bytes');
const ms = require('ms');
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

'use strict';

const { Transform } = require('stream');
const { Transform } = require('node:stream');
const bunyan = require('bunyan');


Expand Down
6 changes: 3 additions & 3 deletions lib/plugin-onion.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

'use strict';

const os = require('os');
const fs = require('fs');
const path = require('path');
const os = require('node:os');
const fs = require('node:fs');
const path = require('node:path');
const split = require('split');
const merge = require('merge');
const socks = require('socks');
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin-quasar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

'use strict';

const assert = require('assert');
const assert = require('node:assert');
const merge = require('merge');
const async = require('async');
const { knuthShuffle } = require('knuth-shuffle');
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin-rolodex.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

const fs = require('fs');
const utils = require('./utils');
const { EventEmitter } = require('events');
const { EventEmitter } = require('node:events');


/**
Expand Down
4 changes: 2 additions & 2 deletions lib/plugin-spartacus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
'use strict';

const merge = require('merge');
const assert = require('assert');
const assert = require('node:assert');
const secp256k1 = require('secp256k1');
const utils = require('./utils');
const jsonrpc = require('jsonrpc-lite');
const { Transform } = require('stream');
const { Transform } = require('node:stream');


/**
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin-traverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const async = require('async');
const { get_gateway_ip: getGatewayIp } = require('network');
const natpmp = require('nat-pmp');
const natupnp = require('nat-upnp');
const url = require('url');
const url = require('node:url');
const diglet = require('@tacticalchihuahua/diglet');


Expand Down
2 changes: 1 addition & 1 deletion lib/plugin-trust.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

'use strict';

const assert = require('assert');
const assert = require('node:assert');
const utils = require('./utils');


Expand Down
2 changes: 1 addition & 1 deletion lib/routing-table.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { EventEmitter } = require('events');
const { EventEmitter } = require('node:events');
const Bucket = require('./bucket');
const utils = require('./utils');
const constants = require('./constants');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules-kademlia.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const assert = require('assert');
const assert = require('node:assert');
const utils = require('./utils');


Expand Down
6 changes: 3 additions & 3 deletions lib/transport-http.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

const http = require('http');
const https = require('https');
const { Duplex: DuplexStream } = require('stream');
const http = require('node:http');
const https = require('node:https');
const { Duplex: DuplexStream } = require('node:stream');
const merge = require('merge');
const concat = require('concat-stream');
const constants = require('./constants');
Expand Down
2 changes: 1 addition & 1 deletion lib/transport-https.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const HTTPTransport = require('./transport-http');
const https = require('https');
const https = require('node:https');
const merge = require('merge');

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/transport-udp.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

const merge = require('merge');
const { Duplex: DuplexStream } = require('stream');
const dgram = require('dgram');
const { Duplex: DuplexStream } = require('node:stream');
const dgram = require('node:dgram');
const utils = require('./utils');


Expand Down
6 changes: 3 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
'use strict';

const secp256k1 = require('secp256k1');
const url = require('url');
const url = require('node:url');
const constants = require('./constants');
const semver = require('semver');
const ip = require('ip');
const crypto = require('crypto');
const assert = require('assert');
const crypto = require('node:crypto');
const assert = require('node:assert');
const { randomBytes, createHash } = crypto;
const ms = require('ms');
const equihash = require('@tacticalchihuahua/equihash');
Expand Down
2 changes: 1 addition & 1 deletion lib/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'use strict';

var semver = require('semver');
var assert = require('assert');
var assert = require('node:assert');

module.exports = {
/**
Expand Down
Loading

0 comments on commit 64e1d06

Please sign in to comment.