Merge branch 'develop' into 443-docker-experimental

indiachan-spamvector
Thomas Lynch 2 years ago
commit 9fd11f45a4
  1. 14
      README.md
  2. 4
      models/forms/makepost.js
  3. 0
      tools/example_request.sh
  4. 0
      tools/self_signed.sh
  5. 0
      tools/update_geoip.sh
  6. 10
      tools/update_tor_exits.sh

@ -7,20 +7,12 @@ API documentation: [fatchan/jschan-docs](https://gitgud.io/fatchan/jschan-docs/)
Join the IRC: [irc.fatpeople.lol](ircs://irc.fatpeople.lol:6697/general)
## Goals
- Oldschool look, newschool features
- Work with javascript disabled
- Support using anonymizers such as Tor, Lokinet or I2P
- Be usable on mobile
- Simple static file serving
## Features
- [x] User created boards ala infinity
- [x] Multiple files per post
- [x] Basic antispam & multiple captcha options
- [x] API ([documentation](http://fatchan.gitgud.site/jschan-docs/))
- [x] Multi-select moderation actions
- [x] Webring +proxy support (compatible with [lynxchan](https://gitlab.com/alogware/LynxChanAddon-Webring) & [infinity](https://gitlab.com/Tenicu/infinityaddon-webring) versions)
- [x] Antispam & multiple captcha options
- [x] [API documentation](http://fatchan.gitgud.site/jschan-docs/)
- [x] Built-in webring (compatible w/ [lynxchan](https://gitlab.com/alogware/LynxChanAddon-Webring) & [infinity](https://gitlab.com/Tenicu/infinityaddon-webring))
- [x] Manage everything from the web panel
- [x] Detailed accounts permissions system
- [x] Works properly with anonymizer networks

@ -3,7 +3,7 @@
const path = require('path')
, { createHash, randomBytes } = require('crypto')
, randomBytesAsync = require('util').promisify(randomBytes)
, { remove, pathExists, stat: fsStat } = require('fs-extra')
, { remove, emptyDir, pathExists, stat: fsStat } = require('fs-extra')
, uploadDirectory = require(__dirname+'/../../helpers/files/uploadDirectory.js')
, Mongo = require(__dirname+'/../../db/db.js')
, Socketio = require(__dirname+'/../../socketio.js')
@ -628,7 +628,7 @@ ${res.locals.numFiles > 0 ? req.files.file.map(f => f.name+'|'+(f.phash || '')).
if (enableCaptcha) {
if (res.locals.board.settings.captchaMode == 2) {
//only delete threads if all posts require threads, otherwise just build board pages for thread captcha
await remove(`${uploadDirectory}/html/${req.params.board}/thread/`); //not deleting json cos it doesnt need to be
await emptyDir(`${uploadDirectory}/html/${req.params.board}/thread/`); //not deleting json cos it doesnt need to be
}
const endPage = Math.ceil(threadLimit/10);
buildQueue.push({

@ -2,7 +2,7 @@
#
# A way to map IPs to the "T1" country code, for tor exit node identification. For sites not using cloudflare.
# 1. (optional) Add this to a cronjob
# 2. Add "include /etc/nginx/includes/map.conf;" to the http block of your /etc/nginx/nginx.conf
# 2. Add "include /etc/nginx/snippets/map.conf;" to the http block of your /etc/nginx/nginx.conf
# 3. Change all the proxy_set_header directives in your nginx config to use the $mapped_country_code variable instead of $geoip_country_code or a fixed value like 'TOR'
# 4. (optional) If you want to instead redirect all these known exits to your .onion instead, add "if ($mapped_country_code = "T1") { return 302 'http://xxxx.onion$request_uri'; }" to your clearnet vhost (server block) of your jschan nginx sites-available config
#
@ -13,11 +13,9 @@ wget --retry-connrefused -qO- https://raw.githubusercontent.com/SecOps-Institute
wget --retry-connrefused -qO- https://lists.fissionrelays.net/tor/exits-ipv6.txt | tee -a /tmp/tor-exits >/dev/null
wget --retry-connrefused -qO- https://lists.fissionrelays.net/tor/exits-ipv4.txt | tee -a /tmp/tor-exits >/dev/null
#add start of nginx conf file for default, loki and .onion
printf "map \$remote_addr \$mapped_country_code {\nhostnames;\ndefault \$geoip_country_code;\n172.16.0.* \"LOKI\";\n\"unix:\" \"TOR\";\n" | tee /etc/nginx/includes/map.conf
printf "map \$remote_addr \$mapped_country_code {\nhostnames;\ndefault \$geoip_country_code;\n172.16.0.* \"LOKI\";\n\"unix:\" \"TOR\";\n" | tee /etc/nginx/snippets/map.conf
#add exits list and set T1 code, prefix.suffix lines, etc
cat /tmp/tor-exits | sort -h | uniq | sed "s/$/\ \"T1\";/g;" | sed -r 's/([0-9]{1,3}\.){3}[0-9]{1,3}/::ffff:&/g' | tee -a /etc/nginx/includes/map.conf
cat /tmp/tor-exits | sort -h | uniq | sed "s/$/\ \"T1\";/g;" | sed -r 's/([0-9]{1,3}\.){3}[0-9]{1,3}/::ffff:&/g' | tee -a /etc/nginx/snippets/map.conf
rm /tmp/tor-exits
#close off nginx conf file
printf "\n}" | tee -a /etc/nginx/includes/map.conf
#reload nginx to apply changes
systemctl reload nginx
printf "\n}" | tee -a /etc/nginx/snippets/map.conf

Loading…
Cancel
Save