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 a04d62d29e Minor nginx config changes, fix the routes snippet and add a complete advanced example 4 years ago
configs Minor nginx config changes, fix the routes snippet and add a complete advanced example 4 years ago
controllers fix issue posting bypass for non tor 4 years ago
db fix deleting cache for users when add/removing as mod to a board 4 years ago
gulp/res Make name field 2-way syncing by default, so using or changing name for a post will set the default 4 years ago
helpers Remove test 4 years ago
migrations Migration, and a change that will make it not get completely destroyed by ddos over TOR 4 years ago
models Capcode input changes reference #222 4 years ago
schedules use `redirect: false` in express.static 4 years ago
views Capcode input changes reference #222 4 years ago
.gitignore Captcha appearance and layout changes 4 years ago
LICENSE Create LICENSE 5 years ago
README.md Update README.md 4 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
gulpfile.js Move the settings for frontend scripts into the config file, and small change of some naming 4 years ago
package-lock.json Update some deps 4 years ago
package.json Update some deps 4 years ago
queue.js Dev auto reset triggers (#152) 4 years ago
redis.js use `redirect: false` in express.static 4 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 improve remarkup tool to uspport multiple posts 4 years ago
server.js More configuration and bit less ugly config layout for captcha 4 years ago
socketio.js Get session in websocket 4 years ago
worker.js Exit if migrateVersion outdated close #163 4 years ago

README.md

jschan

Anonymous imageboard software.

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 (demo)

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 - 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 and video

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.

$ 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 example configs and edit accordingly
$ sudo cp configs/nginx/nginx.example /etc/nginx/sites-available/YOURDOMAIN.COM
$ sudo editor /etc/nginx/sites-available/YOURDOMAIN.COM #edit to your domain and desired settings
$ sudo ln -s /etc/nginx/sites-available/YOURDOMAIN.COM /etc/nginx/sites-enabled/YOURDOMAIN.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.

A snippets folder is also included for advanced users to better organise and more easily customise the nginx configuration.

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, creates admin account admin:changeme
$ gulp reset 
# NOTE: dont run gulp reset again unless you want to completely irreversibly wipe everything

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 #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:

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