From 1ae95bd4a44045807cc0522474e44e5060d4c75a Mon Sep 17 00:00:00 2001 From: Mil Date: Thu, 24 Nov 2022 21:39:47 +0100 Subject: [PATCH] Remove tripcodes (for now) How do I know if this actually avoids using FFI? --- package.json | 3 +-- server/server.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 8f45fbb..04f6840 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,8 @@ "chart.js": "^2.7.2", "diskspace": "^2.0.0", "formidable": "1.0.17", - "hashloli": "git+ssh://public@flanchan.moe:hashloli.git", + "hashloli": "git+ssh://git@git.flanchan.moe:flanchan/hashloli.git", "jsoncompress": "^0.1.3", - "kana-hash": "file:../../home/avril/software/libkhash/node", "minimist": "1.2.0", "nan": "^2.14.0", "recaptcha2": "^1.3.2", diff --git a/server/server.js b/server/server.js index 425b2af..fe3c7e2 100644 --- a/server/server.js +++ b/server/server.js @@ -2,7 +2,7 @@ var opts = require('./opts'); if (require.main == module) opts.parse_args(); opts.load_defaults(); -const khash = require("kana-hash"); +//const khash = require("kana-hash"); var _ = require('../lib/underscore'), amusement = require('./amusement'), @@ -23,7 +23,7 @@ var _ = require('../lib/underscore'), render = require('./render'), request = require('request'), STATE = require('./state'), - tripcode = require('../tripcode').make(),//{hash:function(a,b){return new khash.Kana(0, this.salt).once(a);}, setSalt:function(a){if(a) this.salt = new khash.Salt(a); else this.salt = khash.Salt.Default; return this.salt;}}, //require('./../tripcode/tripcode'), + //tripcode = require('../tripcode').make(),//{hash:function(a,b){return new khash.Kana(0, this.salt).once(a);}, setSalt:function(a){if(a) this.salt = new khash.Salt(a); else this.salt = khash.Salt.Default; return this.salt;}}, //require('./../tripcode/tripcode'), urlParse = require('url').parse, web = require('./web'), winston = require('winston'); @@ -845,12 +845,12 @@ function allocate_post(msg, client, callback) { post.name = parsed[0]; var spec = STATE.hot.SPECIAL_TRIPCODES; if (spec && parsed[1] && parsed[1] in spec) { - post.trip = spec[parsed[1]]; + post.trip = spec[parsed[1]]; } else if (parsed[1] || parsed[2]) { - var trip = tripcode.hash(parsed[1], parsed[2]); - if (trip) - post.trip = trip; + var trip = "Can this just be a string?"; //tripcode.hash(parsed[1], parsed[2]); + if (trip) + post.trip = trip; } } if (msg.email) { @@ -1245,8 +1245,8 @@ function non_daemon_pid_setup() { if (require.main == module) { if (!process.getuid()) throw new Error("Refusing to run as root."); - if (!tripcode.setSalt(config.SECURE_SALT)) - throw "Bad SECURE_SALT"; +// if (!tripcode.setSalt(config.SECURE_SALT)) +// throw "Bad SECURE_SALT"; async.series([ imager.make_media_dirs, setup_imager_relay,