In no means is this guide optimized or the only way for setup, I just run it this way
sudo apt update && sudo apt upgrade && sudo apt -y install gnupg2 wget vim git gcc python3-dev build-essential python3-venv libpq-dev psycopg2-binary
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt update && sudo apt upgrade && sudo apt -y install npm nodejsnpm install pm2@latest -gIf the above commang gives an error
sudo mkdir /usr/local/lib/node_modules
sudo chown -R $USER /usr/local/lib/node_modulespm2 startupsudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt -y update
sudo apt -y install postgresql-14sudo su - postgres
createuser -P -s -e $PGUSERThen enter a pass when prompted and remeber it
If it shows that the pass starts with SCRAM then do the following
Look for Authentication section then password_encryption and set it to md5 (it was scram-sha-256) and uncomment the line if commented
sudo vim /etc/postgresql/13/master/postgresql.confLook for the scram and replace them by md5
sudo vim /etc/postgresql/13/master/pg_hba.confpsql
ALTER USER $PGUSER WITH PASSWORD 'NEW_PASSWORD_HERE';
ctrl + dcreatedb -O $PGUSER cosmicdatabase url will be postgresql://$PGUSER:$PASS@localhost:5432/cosmic
replace $PASS and $PGUSER with the ones you chose
cd && git clone https://github.com/ItsLuuke/ProjectcosmiclionFork.git && cd ProjectFizilionFork
cp sample_config.env config.envnow edit the config (vim config.env or nano config.env) and add the vars
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txt
deactivatecat > run.sh << EOF
#!/bin/bash
source venv/bin/activate
bash bot.sh
EOF
sudo chmod +x run.sh./run.shIf there is error and the bot didnt start correctly, then fix then before continuing to the next step
Start the bot with pm2
pm2 start run.sh --name cosmicpm2 savepm2 start cosmic
pm2 stop cosmic
pm2 restart cosmic
pm2 logs cosmic --lines 100 #or how many lines to check