mirror of https://gitgud.io/fatchan/jschan.git
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.
|
4 years ago | |
---|---|---|
configs | 4 years ago | |
controllers | 4 years ago | |
db | 4 years ago | |
gulp/res | 4 years ago | |
helpers | 4 years ago | |
migrations | 4 years ago | |
models | 4 years ago | |
schedules | 4 years ago | |
views | 4 years ago | |
.gitignore | 5 years ago | |
LICENSE | 6 years ago | |
README.md | 4 years ago | |
backup.sh.example | 5 years ago | |
ecosystem.config.js | 5 years ago | |
gulpfile.js | 4 years ago | |
package-lock.json | 4 years ago | |
package.json | 4 years ago | |
queue.js | 4 years ago | |
redis.js | 4 years ago | |
redlock.js | 5 years ago | |
remarkup.js | 5 years ago | |
server.js | 4 years ago | |
socketio.js | 4 years ago | |
style.css | 5 years ago | |
worker.js | 4 years ago |
README.md
jschan
Anonymous imageboard software.
Goals
- Oldschool look, newschool feel
- Work with javascript disabled
- Be usable on mobile
- Static file serving
Features
- User created boards ala infinity
- Multiple files per post
- Captcha and antispam
- Read-only JSON api
- Multi-select moderation actions
- Websocket update threads w/o polling
- Webring w/proxy support (lynxchan) (infinity)
Todo
- Support running as a hidden service
- More features
- Mobile app
- Full install script
Setup
Please note:
🚨 The software is not production-ready. There may be bugs and WILL be breaking changes. If you insist on running your own instance, always ensure you have up-to-date configs and run gulp migrate && gulp && pm2 reload all
after pulling. 🚨
- these instructions are not step-by-step or complete
- you should be able to read, be comfortable with a command line and have problem solving skills
Requirements
- Linux (debian used in this example)
- Node.js (to run the app)
- MongoDB (database, duh)
- Redis (sessions, build task queue, locks, caching, websocket data)
- Nginx (handle https, serve static content, GeoIP lookup)
- Certbot/letsencrypt (for https cert)
- Graphicsmagick+Imagemagick (thumbnailing images, generating captchas)
- Ffmpeg (thumbnailing videos)
- Setup server with some basics
- new user to run the nodejs backend
- ssh root login disabled, key login only, etc
- iptables only open http, https and ssh ports on INPUT
- Install dependencies. You may need to add sources depending on your distro.
$ sudo apt-get update
$ sudo apt-get install nginx ffmpeg imagemagick graphicsmagick
-
Install and configure Redis
-
Install nodejs Recommended to 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 also repeat this process in future to update node versions as they are generally backwards compatible.
- Configure nginx
- Use the example config included in
configs/nginx.example
and put it in/etc/nginx/sites-available/YOURDOMAIN.COM
, then symlink it to/etc/nginx/sites-enabled/YOURDOMAIN.com
. - Make sure the sites enabled folder is included by
/etc/nginx/nginx.conf
- Get https certificate from letsencrypt.
- For geo flags, follow this guide to setup the legacy GeoIP db 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;
- 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
# dont run this again unless you want to completely irreversibly wipe everything
$ gulp reset
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
- Optionally, if you plan to use the webring and want to make requests with tor to mask your origin server IP: Install docker and run torproxy in a container: https://github.com/dperson/torproxy Edit configs/webring.json and wer proxy enabled:true