DangerOnTheRanger / maniwani

Imageboard software for the 21st century
MIT License
75 stars 11 forks source link
docker flask flask-restful flask-sqlalchemy imageboard imageboard-engine python python3

Maniwani - an anonymous imageboard for the 21st century

Maniwani is a work-in-progress imageboard implementation using Flask. Come visit the project IRC channel #maniwani on rizon.net.

Where does the name come from? I could tell you, but by that point you'd have been torn to pieces.

Sponsors

@samip5

Features

Planned

Installation

NOTE: If you build Maniwani with Docker, then it is recommended to use docker-slim on the resulting container image, which can net approximately a 3x decrease in image size. The build-slim.sh script included in the repository contains the flags needed to successfuly run a slimmed-down container; invoke it instead of using docker-slim directly.

With Docker - standalone development image

In this directory, run the following to build a development Docker image:

docker build -t maniwani-dev --target dev .

To run your new instance, then type:

docker run -p 5000:5000 maniwani-dev

Point your web browser at http://127.0.0.1:5000 to view your new installation. Note that running Maniwani in this way will not save any data after the container is closed. This Docker method is intended to easily see what Maniwani is capable of, as well as serve as a quick and easily-replicated testbed.

With Docker - production image and environment

It is also possible through docker-compose to spin up an environment very similar to what one might use in production for Maniwani (uWSGI in addition to Postgres, Redis, Minio, and captchouli), though for the time being this setup is Linux-only and requires docker-compose. In this directory, type:

docker-compose build
docker-compose run captchouli bootstrap
docker-compose up -d
docker-compose run maniwani bootstrap

The last command will only need to be run once per clean installation of the production environment. If you ever want to remove all database and storage data, remove the compose-minio, compose-postgres, and compose-captchouli volumes. At this point, you can use the normal docker-compose start and docker-compose stop to start and stop the production environment, navigating to http://127.0.0.1:5000 as per usual to view Maniwani. If you want additional info on deploying Maniwani in production, see doc/deploying.md for more.

As a final sidenote, this method will run all of your computer's traffic through a local DNS proxy while active, as otherwise it would not be possible to view attachments, since the local S3 server would be unreachable via hostname. If you want to audit the DNS proxy code (which is an open-source 3rd-party container), feel free to do so at https://github.com/mageddo/dns-proxy-server .

Without Docker

Note that building without Docker takes a lot less time but is less straightforward and does not simulate a production environment. If you're interested in working on Maniwani, this is a good setup option, but otherwise you're probably better off using Docker to test or deploy a Maniwani instance.

Python 3.4+ in addition to Pipenv and npm are required for installation, but I currently use 3.6 for developing Maniwani; if you're having problems with 3.4, file a bug report, but also try 3.6 if you can. To install everything save for ffmpeg (see the following "Notes on ffmpeg" section for more), run the following commands in this directory:

pipenv install
npm install
npm run gulp

You'll also want to initialize a database with some initial options; so run:

pipenv run python bootstrap.py

Next, to run the development server, type pipenv run python storestub.py & followed by pipenv run flask run, and point your web browser at http://127.0.0.1:5000 to view your new Maniwani installation. If you ever want to wipe the database clean, that's currently handled by removing test.db (and the uploads directory if you uploaded anything) and re-running the bootstrap.py script.

Notes on ffmpeg

Installing ffmpeg can either be done with your system's package manager if you do not already have it installed, or you can use the ffmpeg_bootstrap.py script to grab a static build of ffmpeg like so, assuming you are in the same directory as the script itself:

python3 ffmpeg_bootstrap.py
cp ffmpeg-stub-config.cfg ../maniwani.cfg
echo MANIWANI_CFG=maniwani.cfg > ../.env

Screenshots

Front page aggregating all boards:

Front page

Viewing a thread:

Thread view

Board index (images are pulled from the most recent OP in each board):

Board index

Thread gallery mode:

Gallery mode

Board catalog view, also showing off responsive mode:

Board catalog