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/callback
andhttps://DOMAIN.TLD/user/dashboard
. -
Escalate to the root user:
sudo su
-
Run
sudo apt-get upgrade
after that finishes runsudo apt-get update
-
Run
sudo apt-get install postgresql postgresql-contrib
following that runupdate-rc.d postgresql enable
and then following that runsudo service postgresql start
-
Run
sudo -u postgres createuser titan
thensudo -u postgres createdb titanembeds
following thatsudo -u postgres psql
after 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/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
.alembic.ini
- This is the database setup file. We will modify this file later.titan_nginx
- Modify theserver_name
to 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_email
to your e-mail andletsencrypt_cert_domains
to your domain./ansible-playbooks
and modifyhosts
file with your domain, replacingchange_me
.
-
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
. (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
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";
. (Please see section Local-Notice above if this is relevant) -
Done!