|
|
@ -2,7 +2,7 @@ var opts = require('./opts');
|
|
|
|
if (require.main == module) opts.parse_args();
|
|
|
|
if (require.main == module) opts.parse_args();
|
|
|
|
opts.load_defaults();
|
|
|
|
opts.load_defaults();
|
|
|
|
|
|
|
|
|
|
|
|
//const khash = require("kana-hash");
|
|
|
|
const khash = require("kana-hash");
|
|
|
|
|
|
|
|
|
|
|
|
var _ = require('../lib/underscore'),
|
|
|
|
var _ = require('../lib/underscore'),
|
|
|
|
amusement = require('./amusement'),
|
|
|
|
amusement = require('./amusement'),
|
|
|
@ -23,7 +23,7 @@ var _ = require('../lib/underscore'),
|
|
|
|
render = require('./render'),
|
|
|
|
render = require('./render'),
|
|
|
|
request = require('request'),
|
|
|
|
request = require('request'),
|
|
|
|
STATE = require('./state'),
|
|
|
|
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,
|
|
|
|
urlParse = require('url').parse,
|
|
|
|
web = require('./web'),
|
|
|
|
web = require('./web'),
|
|
|
|
winston = require('winston');
|
|
|
|
winston = require('winston');
|
|
|
@ -602,12 +602,12 @@ web.resource(/^\/outbound\/a\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
|
|
|
|
|
|
|
|
web.resource(/^\/outbound\/sysint\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
web.resource(/^\/outbound\/sysint\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
var thread = parseInt(params[1], 10);
|
|
|
|
var thread = parseInt(params[1], 10);
|
|
|
|
var url = '/sysint/';
|
|
|
|
var url = 'https://flanchan.moe/sysint/';
|
|
|
|
if (thread)
|
|
|
|
if (thread)
|
|
|
|
url += thread;
|
|
|
|
url += thread;
|
|
|
|
cb(null, 303.1, url);
|
|
|
|
cb(null, 303.1, url);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
/* TODO: this is never hit in master anyway
|
|
|
|
web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
var thread = parseInt(params[1], 10);
|
|
|
|
var thread = parseInt(params[1], 10);
|
|
|
|
var url = '/faq.html';
|
|
|
|
var url = '/faq.html';
|
|
|
@ -615,7 +615,7 @@ web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
url += thread;
|
|
|
|
url += thread;
|
|
|
|
cb(null, 303.1, url);
|
|
|
|
cb(null, 303.1, url);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
*/
|
|
|
|
web.resource(/^\/outbound\/nap\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
web.resource(/^\/outbound\/nap\/(\d{0,10})$/, function (req, params, cb) {
|
|
|
|
var thread = parseInt(params[1], 10);
|
|
|
|
var thread = parseInt(params[1], 10);
|
|
|
|
var url = 'https://nineball.party/nap/';
|
|
|
|
var url = 'https://nineball.party/nap/';
|
|
|
@ -845,12 +845,12 @@ function allocate_post(msg, client, callback) {
|
|
|
|
post.name = parsed[0];
|
|
|
|
post.name = parsed[0];
|
|
|
|
var spec = STATE.hot.SPECIAL_TRIPCODES;
|
|
|
|
var spec = STATE.hot.SPECIAL_TRIPCODES;
|
|
|
|
if (spec && parsed[1] && parsed[1] in spec) {
|
|
|
|
if (spec && parsed[1] && parsed[1] in spec) {
|
|
|
|
post.trip = spec[parsed[1]];
|
|
|
|
post.trip = spec[parsed[1]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (parsed[1] || parsed[2]) {
|
|
|
|
else if (parsed[1] || parsed[2]) {
|
|
|
|
var trip = "Can this just be a string?"; //tripcode.hash(parsed[1], parsed[2]);
|
|
|
|
var trip = tripcode.hash(parsed[1], parsed[2]);
|
|
|
|
if (trip)
|
|
|
|
if (trip)
|
|
|
|
post.trip = trip;
|
|
|
|
post.trip = trip;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (msg.email) {
|
|
|
|
if (msg.email) {
|
|
|
@ -1245,8 +1245,8 @@ function non_daemon_pid_setup() {
|
|
|
|
if (require.main == module) {
|
|
|
|
if (require.main == module) {
|
|
|
|
if (!process.getuid())
|
|
|
|
if (!process.getuid())
|
|
|
|
throw new Error("Refusing to run as root.");
|
|
|
|
throw new Error("Refusing to run as root.");
|
|
|
|
// if (!tripcode.setSalt(config.SECURE_SALT))
|
|
|
|
if (!tripcode.setSalt(config.SECURE_SALT))
|
|
|
|
// throw "Bad SECURE_SALT";
|
|
|
|
throw "Bad SECURE_SALT";
|
|
|
|
async.series([
|
|
|
|
async.series([
|
|
|
|
imager.make_media_dirs,
|
|
|
|
imager.make_media_dirs,
|
|
|
|
setup_imager_relay,
|
|
|
|
setup_imager_relay,
|
|
|
|