Coder Social home page Coder Social logo

kawa-kokosowa / bubblebbs Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 3.0 292 KB

Text BBS ๐Ÿ—ฃ๏ธ with authenticated ๐Ÿ”’๐Ÿ†” posts ๐Ÿ—จ๏ธ and no registration ๐Ÿšซโœ๏ธ

Home Page: http://bubblebbs.cafe

License: MIT License

Python 66.75% CSS 13.27% HTML 17.78% Shell 0.59% Dockerfile 1.60%
tripcodes text-bbs docker flask flask-sqlalchemy textboard

bubblebbs's Introduction

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:

  • Cookie manager allows users to control name-remembering and custom stylesheets
  • Trip meta pages exist as soon as the tripcode is used when creating a post! You can edit these pages by supplying a string which hashes to that tripcode! Shows posts by that tripcode, as well as post counts!
  • Tripcodes salted by both secret and the poster's name. This prevents identity-jacking (in the event users happened to use the same password).
  • Flags IPs which use a name with a tripcode that doesn't match the original occurence of name's tripcode
  • Prefixes "verified" names with a green checkmark. Verified names are posts which have a tripcode matching the tripcode of the first post with said name.
  • Markdown support, optional headline syntax
  • Google Recaptcha
  • Create pages
  • Word filter lets you not only filter words (also pattern matches on plurals), but "flag" IP addresses that use those words
  • Automatically ban users based on certain phrases
  • Manage site through backend
  • Site blotter
  • Doesn't allow duplicate posts
  • Tripcodes hash to color and emoji
  • Fluid default stylesheet
  • Full text search

You must do this before you begin

  • Make sure you're using latest Docker and docker-compose, install according to Docker community instructions, don't install via your distribution's repo (it's probably way out-of-date!).

  • Docker will look for .env-file unless you provide docker with envvars using -e ENVVAR=value. So you need to do either:

    cp .env-file.debug.example .env-file

    or

    cp .env-file.prod.example .env-file

    And then edit .env-file.

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:

  • Running as many Docker services as you want behind this reverse-proxy, so it's easy to run many different websites on one machine!
  • Pain-free HTTPS!

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 "[email protected]" \
    -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".

bubblebbs's People

Contributors

ace-recliner avatar eiritana avatar kawa-kokosowa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bubblebbs's Issues

css styling boxes

The current issues with the board is if you use custom CSS , it can become difficult to read text if it goes over an image that is in the css style. A certain way to fix this is to to make sure all posts are contained within a box (i.e. 4chan) that overlays the css design.

image
image

Also, there should be a limit to how long something in the box should be otherwise it'll break the page.

Tripcodes are sucky

WRONG moot#faggot --> moot#awzTfia8XAuu0QR64dY7
CORRECT moot#faggot --> moot!Ep8pui8Vw2


import crypt 

def mktripcode(pw): 
    pw = pw[:8] 
    salt = (pw + "H.")[1:3] 
    trip = crypt.crypt(pw, salt) 
    return ("!" + trip[-10:]) 

Show replies

one of my most favorite recent additions to imageboards is how they have backlinking in posts, eg if #3 #4 #5 respond to number #2, post #2 shows that 3 4 5 responded

implement trip meta /trip-meta/sometRIp

implement /trip-meta which would keep track of how many times a tripcode has been used to post also if a user can provide the unhashed tricode they may add meta like twitter, homepage, etc.

board support

ability to run multiple boards/instances similar to 2ch. todo

Click to respond

clicking the post number in a thread (eg, #3) does not insert >>3 into the text box

please fix!

Include static pages

e.g.

  • faq / rules (/faq/)
  • formatting (/faq/#formatting)
  • irc (/irc/)
  • contact moderation (/contact/)
  • other (/other/ or /pages/other)

especially after styleswitcher is implemented

Spam prevention measures

Posts to reject as spam

Coming in:

  • post from bad IP (individual address or wildcard ban)
  • CAPTCHA not completed (if board is public; on by default)
  • Dummy "spamtrap" textbox had text entered

Processing:

  • post is identical to prior post (likely a user error, or a very low IQ spammer)
  • bad name / tripcode (add poster to badip list)
  • bad text in comment body (wordfilter should be regex), add poster to badip list

These are all cases that should automatically reject a post

Feature request: atom/RSS feeds

Feature: every thread has its own .ATOM feed (XML document containing a list of entries composed of name, date, url, post body). Every board has an .ATOM feed for new threads.

Rationale: this makes it easy for users of slower boards (those seeing under 100 posts per week) to see updates as they come in, or to see responses to interesting threads through the use of existing software by the means of a simple and well-documented standard. These are beneficial for moderators as well (they can receive a notification as new threads are made) and for users of larger boards (who can follow their favorite threads more easily).

ATOM entry

<entry>
<title> Reply #num in thread $title </title>
<id> //posturl/thread#postnum</id>
<updated>ISO8601-formatted post date & time</updated>
<author><name>Anonymous / post's author</name></author>
<content type="html">
The post's content, suitable for viewing in an ATOM feed reader
</content>
</entry>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.