this is only here because I'm dumb and will probably forget how to deploy this. no help will be given for selfhosting gl
$ git clone --recurse-submodules https://github.com/reallybadbot/bot
$ cd bot
if you forget the --recurse submodules
then do
$ git submodule init
$ git submodule update
and you should be all good
install python >=3.9.2
$ python3.9 -m venv venv
activate it (windows)
$ ./venv/Scripts/activate
(linux)
$ source ./venv/Scripts/activate
in venv:
$ python3.9 -m pip install -U -r requirements.txt
$ python3.9 -m pip install -U -r ./web/requirements.txt
oh and if yur on linux:
$ python3.9 -m pip install uvloop
speed
yea google how to install postgres and then run this in psql:
$ CREATE ROLE botto WITH LOGIN PASSWORD 'secret;
$ CREATE DATABASE badbot OWNER botto;
make a copy of config.yml.example and fill it out then remove the .example
filename ending
bot is same for dev and prod
make sure to activate venv
$ python3.9 main.py
make sure botto is running first or else the ipc server will not work
all of this assumes you are in the venv we created earlier
$ uvicorn web.app:app --reload
this runs with a uvicorn worker under gunicorn cuz why not
also this only works on linux lol (pain)
you should probably use nginx or some proxy
$ gunicorn -k uvicorn.workers.UvicornWorker -w 4 --forwarded-allow-ips="10.170.3.217,10.170.3.220" web.app:app
then like buy a domain and set a cname record to your vps or smth
have fun
also should probably use docker because idk how to run two scripts at the same time and i dont wanna run bot + webserver in same thread for prod
lmao using docker messes up all these unstructions you can probably use docker-compose.yml file i will make soon and maybe i will add deployment instructions
gl