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.
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/callback
andhttps://DOMAIN.TLD/user/dashboard
. - Escalate to the root user:
sudo su
- Install a few prerequisites:
apt install ansible git python-psycopg2
. - Git clone this repository into the home directory of root.
cd /root/ansible-playbooks/roles/setup/files
and create your configuration files, replacing all the.example.
with their counterparts. For example,config.example.py
becomesconfig.py
in 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 thetitan
userconfig.py
- This is the configuration for the Titan discordbot. Add in your bot token. Keepdatabase-uri
as 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-id
andclient-secret
if you have one. Type something random forapp-secret
.titan_nginx
- Modify theserver_name
to the domain and tld of yours./tasks/main.yml
- Modify the password field for your database./playbooks/titan.yml
- Modifyletsencrypt_email
to your e-mail andletsencrypt_cert_domains
to your domain.
cd /root/ansible-playbooks
and modifyhosts
file with your domain, replacingtitanembeds.com
.- Enable the letsencrypt task by changing the directory to
ansible-playbooks/roles/ansible-letsencrypt
and rungit submodule init
andgit submodule update --recursive --remote
- Now you may let ansible setup the server. Run
ansible-playbook -i hosts playbooks/titansetup.yml
in the directoryansible-playbooks
. - Start the redis server
sudo systemctl start redis
- Make sure the Titan directory is owned by the titan user.
sudo chown -R titan:www-data /home/titan/Titan/
- Switch user to titan
sudo su titan
and edit your database connections in the config files inside/home/titan/Titan
:webapp/alembic.ini
,webapp/config.py
,discordbot/config.py
topostgresql+psycopg2://titan:DatabasePASSWORDHere@localhost:5432/titanembeds?client_encoding=utf8
. - Exit titan user
exit
and run the upgrade taskscd /root/ansible-playbooks; ansible-playbook -i hosts playbooks/titan.yml --tags "web,bot";
. - Congratulations, if everything went well, you have successfully setup Titan Embeds on your own server! A couple of notes for this repository, this is more meant for the project itself to automate and document changes to how we configure our server, but anyone who wants to host this bot on their own is welcome to use this playbook with the proper configuration changes to host this project on your own hardware!