jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Thomas Lynch 85d1c83575 close #327 3 years ago
configs close #319 3 years ago
controllers make schedules able to run separately and dont make instance on import, do it in the tasks folder index 3 years ago
db start making the config able to reload, for now just clearing require.cache 3 years ago
gulp/res image hide buttons improvements. changes between "show"/"hide" works across refresh and clearing/post updates 3 years ago
helpers start making the config able to reload, for now just clearing require.cache 3 years ago
migrations improve migrations 3 years ago
models publish on global settings change and start the massive task of making more stuff configurable 3 years ago
schedules make schedules able to run separately and dont make instance on import, do it in the tasks folder index 3 years ago
views close #327 3 years ago
.gitignore Add in hcaptcha support. 4 years ago
LICENSE Create LICENSE 5 years ago
README.md Update README.md 3 years ago
TODO.txt publish on global settings change and start the massive task of making more stuff configurable 3 years ago
backup.sh.example dont deflate backup files since its mostly images that are already compressed 5 years ago
ecosystem.config.js more general ecosystem config for how many cpu cores 4 years ago
getconfig.js start making the config able to reload, for now just clearing require.cache 3 years ago
gulpfile.js make subscriber only start when there is any listener so its not needed in gulptasks for example 3 years ago
package-lock.json npm update 3 years ago
package.json npm update 3 years ago
queue.js Dev auto reset triggers (#152) 4 years ago
redis.js make subscriber only start when there is any listener so its not needed in gulptasks for example 3 years ago
redlock.js no more lmx. since we have redis, use it for redlock and connect-redis for sessions instead of mongo 5 years ago
remarkup.js reference #256 unique message per board/thread option 4 years ago
server.js make subscriber only start when there is any listener so its not needed in gulptasks for example 3 years ago
socketio.js bugfix socket for board recents 3 years ago
worker.js start making the config able to reload, for now just clearing require.cache 3 years ago

README.md

jschan

Anonymous imageboard software.

Demo/test site: clearnet tor hidden service

Goals

  • Oldschool look, newschool features
  • Work with javascript disabled
  • Support running as a hidden service
  • Be usable on mobile
  • Simple static file serving

Features

  • User created boards ala infinity
  • Multiple files per post
  • Basic antispam & multiple captcha options
  • Read-only JSON api
  • Multi-select moderation actions
  • Websocket update threads w/o polling
  • Webring w/proxy support (compatible with lynxchan & infinity)
  • Run as a tor hidden service

Todo

  • More features
  • Mobile app integration
  • Improve installation instructions

Setup

Please note:

🚨 jschan is not production-ready. There may be bugs and WILL be breaking changes. 🚨

If you insist on running your own instance, do not expect help when something breaks. Please read everything including the update section thoroughly. These instructions are NOT step-by-step or complete, and assume you have some experience with software setup, servers, networking, etc.
Requirements
  • Linux - Debian used in this example
  • Node.js - the application runtime
  • MongoDB >= 4.4 - the database
  • Redis - session store, task queue, locks, caching, websocket message arbiter
  • Nginx - webserver/proxy, serve static files, handle https, GeoIP lookup
  • Certbot/letsencrypt - to get a free https certificate
  • Graphicsmagick+Imagemagick - identify and thumbnail images, generate captchas
  • Ffmpeg - identify and thumbnail audio, video and gifs

1. Setup server with some basics

  • Separate, non-root user to run the application
  • Basic security like ssh root login disabled, key login only, firewall all ports besides http/s and ssh.

2. Install dependencies.

NOTE: You may need to add sources depending on your distro. If you intent to have animated gif thumbnails, ffmpeg 4.3.x is recommended. For debian, it can be found in the testing repos or compiled from source.

$ sudo apt-get update
$ sudo apt-get install nginx ffmpeg imagemagick graphicsmagick

3. Install MongoDB

MongoDB Installation & enable authentication

4. Install Redis

Redis Installation

5. Install Node.js

For easy installation, use node version manager "nvm". Install nvm then run the following commands to get the LTS version of nodejs.

$ nvm install --lts
$ nvm use --lts

You can repeat this process in future to update node versions.

You may install Node.js yourself without nvm if you prefer.

6. Configure nginx

  • Copy the nginx.example config to the sites-eavailable folder, and create a symlink from sites-available -> sites-enabled
$ sudo cp configs/nginx/nginx.example /etc/nginx/sites-available/DOMAIN.COM
$ sudo ln -s /etc/nginx/sites-available/DOMAIN.COM /etc/nginx/sites-enabled/DOMAIN.COM

Edit/replace the following in your nginx config:

  • "domain.com" with your domain name
  • "/path/to/jschan" with the path of your jschan root folder
  • If using .onion, uncomment the .onion block, and replace the example address with your .onion
$ sudo editor /etc/nginx/sites-available/DOMAIN.COM

sed can be used to automate this process:

$ sudo sed -i 's|/path/to/jschan|/path/to/your/install|g' /etc/nginx/sites-available/DOMAIN.COM
$ sudo sed -i 's/domain.com/your.domain.com/g' /etc/nginx/sites-available/DOMAIN.COM
  • Make sure the sites enabled folder is included by /etc/nginx/nginx.conf (it is in debian nginx package)
  • Use certbot to get a free https certificate.
  • For post flags to work, follow this guide to setup the legacy GeoIP database and add these directives to the http block in /etc/nginx/nginx.conf:
geoip_country /usr/share/GeoIP/GeoIP.dat;
geoip_city /usr/share/GeoIP/GeoIPCity.dat;

If your nginx doesn't have the necessary module by default, or is using v2 instead, find your own guide.

If you use cloudflare, please read these articles to setup proper IP forwarding and geolocation headers. Similar steps would apply to other CDNs/reverse proxies. There are also 2 config entries in configs/main.js, ipHeader and countryCodeHeader that you can tweak for jschan to use different headers for country code or real visitor IP.

Also included is an "nginx_advanced" config, and a snippets folder for advanced users who want to better organise and more easily customise the nginx configuration. It functions the same as the normal nginx.example, but you need to create the snippets folder in /etc/nginx/snippets, and copy the example snippets.

7. Clone this repo, browse to the folder and set some things up

# copy example config file and edit it
$ cp configs/main.js.example configs/main.js && editor configs/main.js

# copy example custompages for rules and faq and edit
$ cp views/custompages/faq.pug.example views/custompages/faq.pug
$ cp views/custompages/rules.pug.example views/custompages/rules.pug

# install dependencies and run build tasks
$ npm install
$ npm run-script setup

# setup the database and folder structure, and creates the admin account. **The (random) password will be printed in the command line.**
$ gulp reset 
# NOTE: dont run gulp reset again unless you want to completely irreversibly wipe everything

# make pm2 (process manager) start on server restart
$ pm2 startup #and follow any prompts
# save the process list so jschan is started with pm2
$ pm2 save

Use https://realfavicongenerator.net/ to generate favicons how you want them to look and replace the files in gulp/res/icons/ with the icons from that package

# start all the backend processes
$ npm run-script start
$ gulp

# some commands you may need to use in future/find helpful
# pm2 is a process manager for nodejs
$ pm2 list #list running pm2 processes
$ pm2 logs #see logs
$ pm2 reload all #reload all backend processes

# gulp is used for various jobs like minifying and compiling scripts
$ gulp --tasks #list available gulp tasks
$ gulp migrate #check for and run db migrations
$ gulp password #reset the admin account password if you forgot it
$ gulp #run default gulp task

8. Optionally, if you plan to use the webring and want to make requests with a proxy to mask your origin server IP:

EITHER:

  • Install docker and run torproxy in a container: https://github.com/dperson/torproxy (of course, audit the docker image yourself). This is the easiest, free way to get a proxy setup and means you can also follow .onions in your webring list since requests will go through tor.
  • Use your own socks proxy

Edit configs/webring.json with your proxy address and set enabled: true

Updating

#pull the latest changes
$ git pull
#install dependencies again in case any have updated or changed
$ npm install
#diff the config files to see if anything changed and edit accordingly. OR backup your config, replace it with the fresh example, and update it with whatever settings you want to keep from your backup.
$ diff configs/main.js configs/main.js.example
#run the migrate task to update your database
$ gulp migrate
#reload jschan backend
$ pm2 reload all
#run the default gulp task, updates scripts, css, icons, images and deletes old html
$ gulp
#if something breaks, check and read the logs, they will help figure out what went wrong.
$ pm2 logs

For generous people

BTC address: bc1q4elrlz5puak4m9xy3hfvmpempnpqpu95v8s9m6