ref: 511ea397b10507eadb4f9e4b8180984ad7d269ae fanboi2/README.md -rw-r--r-- 4.5 KiB
511ea397Kridsada Thanabulpong chore: relicense to AGPLv3 8 months ago


python 3.7 builds.sr.ht status

Board engine behind Fanboi Channel written in Python.


For production environment, Fanboi2 has the following runtime requirements:

Additionally, the following packages are build-time requirements for compiling assets:

#Installing with Vagrant

If you're looking to develop or test Fanboi2, simply install Vagrant and run:

$ vagrant up

Then vagrant ssh and follow the Setting up applications section below.

#Installing on FreeBSD systems

On FreeBSD systems, these packages can be installed with:

$ sudo pkg install ca_root_nss python36 py36-sqlite3 py36-pip postgresql11-server postgresql11-client redis node12 npm-node12
$ pip install --user poetry

Setup PostgreSQL:

$ sudo sysrc postgresql_enable=YES
$ sudo service postgresql initdb
$ sudo service postgresql start
$ sudo -u postgres createuser $USER
$ sudo -u postgres createdb -O $USER fanboi2
$ sudo -u postgres createdb -O $USER fanboi2_dev
$ sudo -u postgres createdb -O $USER fanboi2_test

Setup Redis:

$ sudo sysrc redis_enable=YES
$ sudo service redis start

#Configuring environment variables

For convenient during development, configure these environment variables in .profile:

$ cat <<EOF >> ~/.profile
PATH=\$PATH:\$HOME/.local/bin; export PATH
DATABASE_URL=postgresql://; export DATABASE_URL
REDIS_URL=redis://; export REDIS_URL
SESSION_SECRET=\$(openssl rand -hex 32); export SESSION_SECRET
AUTH_SECRET=\$(openssl rand -hex 32); export AUTH_SECRET

#Setting up application

After all packages are installed, setup the application with:

$ git clone https://git.sr.ht/~sirn/fanboi2 fanboi2
$ cd fanboi2/
$ poetry install --no-dev
$ npm install && npm run gulp

Then configure environment variables and run:

$ poetry run alembic upgrade head
$ poetry run fbctl serve

You also need to run the worker (each in its own terminal window) with:

$ poetry run fbcelery worker
$ poetry run fbcelery beat

And you're done! Please visit http://localhost:6543/admin/ to perform initial configuration.


Fanboi2 uses environment variable to configure the application. You may want to use something like Direnv to manage these environment variables.

  • AUTH_SECRET -- Required. Secret for authentication/authorization cookie.
  • CELERY_BROKER_URL -- Required. Redis URL for Celery broker, e.g. redis://
  • DATABASE_URL -- Required. Database URL, e.g. postgres://
  • REDIS_URL -- Required. Redis URL, e.g. redis://
  • SESSION_SECRET -- Required. Secret for session cookie. Must not reuse AUTH_SECRET.
  • GEOIP_PATH -- Path to GeoIP database, e.g. /usr/share/geoip/GeoLite2-Country.mmdb
  • SERVER_DEV -- Boolean flag whether to enable dev console, default False
  • SERVER_SECURE -- Boolean flag whether to only authenticate via HTTPS, default False.


To setup Fanboi2 in development mode, run the following commands after performing production setup steps:

$ poetry install

And run the server with:

$ poetry run honcho start

#Submitting changes

To submit patches to mailing list:

  1. Clone the repository: git clone https://git.sr.ht/~sirn/fanboi2
  2. Make the necessary changes.
  3. Configure Git sendmail address: git config sendemail.to ~sirn/fanboi2-dev@lists.sr.ht
  4. Create a patch: git format-patch -1 HEAD (refer to git-format-patch(1) for more info)
  5. Send a patch: git send-email -1 (refer to git-send-email(1) for more info)