kawa-kokosowa / bubblebbs

Text BBS 🗣️ with authenticated 🔒🆔 posts 🗨️ and no registration 🚫✍️
http://bubblebbs.cafe
MIT License
17 stars 3 forks source link
docker flask flask-sqlalchemy text-bbs textboard tripcodes

BubbleBBS

Build
Status

Text BBS/message board which runs bubblebbs.cafe.

This project is in alpha. It is currently unversioned and very messy.

Some of BubbleBBS' features:

You must do this before you begin

General technical notes

Admins login at /admin with the default username admin and default password admin. Make sure to change this!

Running tests

docker build . -t bubblebbs
docker run -v "$(pwd):/app" bubblebbs pytest

You only need to run docker build once, but you need to run it again when/if Dockerfile changes.

Debugging

To make a debugging server which reloads on changes run on http://localhost:8080/ do something like this:

docker build . -t bubblebbs
docker run -it \
    -p 8080:8080 \
    -v "$(pwd):/app" \
    --env-file .env-file \
    bubblebbs debug

You only need to run docker build once, but you need to run it again when/if Dockerfile changes.

Debugging, running tests without Docker

You can still fiddle around with bubblebbs like you would any ol' Python code:

  1. Create and activate a virtual environment
  2. pip install -r requirements.txt
  3. In Ubuntu I needed to sudo apt install libssl-dev (this is for scrypt)
  4. python3 -m bubblebbs.runserver
  5. http://localhost:8080/

You can run tests with pytest in the project root.

Running production with HTTPS

Using this reverse proxy setup is really nice, it takes care of:

You will need a .letsencrypt directory to hold HTTPS stuff. It'll get mounted to various places in a couple containers.

Start the reverse proxy, you can copy and paste the following:

docker run -d -p 80:80 -p 443:443 \
    --name nginx-proxy \
    -v "$(pwd)/.letsencrypt/certs:/etc/nginx/certs:ro" \
    -v "$(pwd)/.letsencrypt/vhosts:/etc/nginx/vhost.d" \
    -v "$(pwd)/.letsencrypt/challenge_files:/usr/share/nginx/html" \
    -v /var/run/docker.sock:/tmp/docker.sock:ro \
    --label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy \
    jwilder/nginx-proxy

Once you've started nginx-proxy you can bring it back up with docker start nginx-proxy if it ever goes down.

Now start the reverse proxy HTTPS "companion," you can simply copy and paste this:

docker run -d \
    -v "$(pwd)/.letsencrypt/certs:/etc/nginx/certs:rw" \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    --volumes-from nginx-proxy \
    jrcs/letsencrypt-nginx-proxy-companion

Build the BubbleBBS container, you can copy and paste this:

docker build . -t bubblebbs

Finally launch the BubbleBBS container, but please take special care to use your information (don't just paste this!):

docker run \
    -e "BBBS_BEHIND_REVERSE_PROXY=1" \
    -e "VIRTUAL_HOST=bubblebbs.cafe" \
    -e "LETSENCRYPT_HOST=bubblebbs.cafe" \
    -e "LETSENCRYPT_EMAIL=kawa.kokosowa@gmail.com" \
    -e "VIRTUAL_PORT=8081" \
    --publish 8081:80 \
    -d \
    -v "$(pwd)/bubblebbs/bubblebbs.db:/app/bubblebbs/bubblebbs.db" \
    --env-file .env-file \
    --name bbbsd \
    bubblebbs

You can relaunch with docker up bbbsd. You don't need an env-file you can just use -e for all the envvars instead (especially useful if you're using AWS ECS!). Also if you're not using sqlite3 you can remove -v "$(pwd)/bubblebbs/bubblebbs.db:bubblebbs/bubblebbs.db".