The current version of this build is optimized for Ubuntu 18.04, please visit the Discord support server for additional support of ansible-playbooks setup/installation of Titan Embeds.
[Local-Notice] If you are running Titan Embeds from a local connection with Ubuntu please add --connection=local after hosts in ansible-playbook -i hosts Example: ansible-playbook -i hosts --connection=local playbooks/titansetup.yml
-
Create a bot user from https://discordapp.com/developers/applications/me. Insert the following redirect uris:
https://DOMAIN.TLD/user/callbackandhttps://DOMAIN.TLD/user/dashboard. -
Escalate to the root user:
sudo su -
Run
sudo apt-get upgradeafter that finishes runsudo apt-get update -
Run
sudo apt-get install postgresql postgresql-contribfollowing that runupdate-rc.d postgresql enableand then following that runsudo service postgresql start -
Run
sudo -u postgres createuser titanthensudo -u postgres createdb titanembedsfollowing thatsudo -u postgres psqlafter a window pops up runalter user titan with encrypted password '<password>;'then lastly rungrant all privileges on database titanembeds to titan ;to exit postgresql run\q. -
Install a few prerequisites:
sudo apt install ansible git python3-psycopg2. -
Git clone this repository into the home directory of root.
-
cd /root/ansible-playbooks/roles/setup/filesand create your configuration files, replacing all the.example.with their counterparts. For example,config.example.pybecomesconfig.pyin the same directory. Ansible will move those files to the correct directory during installation. -
Modify the following files to your likings:
authorized_keys- Adding any keys you would like to add to work for thetitanuserconfig.py- This is the configuration for the Titan discordbot. Add in your bot token. Keepdatabase-urias is for now.config.webapp.py- This is the configuation for the flask webapp. Enter the information for the Discord's appclient-id,client-secret, andbot-token. Enter your paypalclient-idandclient-secretif you have one. Type something random forapp-secret.alembic.ini- This is the database setup file. We will modify this file later.titan_nginx- Modify theserver_nameto the domain and tld of yours and modifyssl_certificate_key /etc/letsencrypt/live/change_me/privkey.pem;field change_me to your domain including the publickey./playbooks/titan.yml- Modifyletsencrypt_emailto your e-mail andletsencrypt_cert_domainsto your domain./ansible-playbooksand modifyhostsfile with your domain, replacingchange_me.
-
Enable the letsencrypt task by changing the directory to
ansible-playbooks/roles/ansible-letsencryptand rungit submodule initandgit submodule update --recursive --remote -
Now you may let ansible setup the server. Run
ansible-playbook -i hosts playbooks/titansetup.ymlin the directoryansible-playbooks. (Please see section Local-Notice above if this is relevant) -
Start the redis server
sudo systemctl start redis -
Make sure the Titan directory is owned by the
titanuser.sudo chown -R titan:www-data /home/titan/Titan/ -
Switch user to titan
sudo su titanand edit your database connections in the config files inside/home/titan/Titan:webapp/alembic.ini,webapp/config.py,discordbot/config.pytopostgresql+psycopg2://titan:DatabasePASSWORDHere@localhost:5432/titanembeds?client_encoding=utf8. -
Exit titan user
exitand run the upgrade taskscd /root/ansible-playbooks; ansible-playbook -i hosts playbooks/titan.yml --tags "web,bot";. (Please see section Local-Notice above if this is relevant) -
Done!
