WARNING! AVOID REMOVING INFRASTRUCTURE USING GOOGLE CLOUD CONSOLE, BECAUSE IT WILL CORRUPT TERRAFORM STATE
In order to remove existing deployed infrastructure you can simply run the following command
kite t destroy
This will result in a similar looking screen:
This command will attempt to remove all the existing infra. It won't be applied unless you type yes
Please note there's also a possibility to destroy a separate module instead of destroying the whole infrastructure. To be able to achieve this you need to run the following command:
kite t destroy -target module.*module_you_want_to_destroy*
List of available modules for a destroy can be found by running the command:
kite t show
WARNING! ANY OF THIS OPERATIONS ARE PERFORMED AT YOUR OWN RISK AND CAN LEAD TO PLATFORM'S DOWNTIME!
The process of applying a certain infrastructure module is similar to destroying a separate module In order to do so run the following command:
kite t apply -target module.*module_to_apply*
This will only create the module you've specified and any required dependencies for the module.
For example: kite t apply -target module.mysql-db
will create a CloudSQL instance and any
required dependencies.
Email templates are defined in postmaster container. The default templates can be found here: https://github.com/openware/postmaster/blob/master/config/postmaster.yml
In order to modify them you just need to mount the modified file to your container. In docker-compose file this would look like this:
In order to trigger emails on different emails you need to change postmaster configuration and add templates for those emails to postmaster: https://github.com/openware/postmaster/blob/master/config/postmaster.yml Using this example:
You can create your own email template and trigger mail sending on any of the events available on the links down below.
https://github.com/rubykube/barong/blob/master/docs/event_api.md https://github.com/rubykube/peatio/blob/master/docs/api/event_api.md
The simpliest way to send authorized requests is using HTTPie.
Here is an example on how to use HTTPie in few steps:
First of all you need to login:
http --session test_session POST https://www.example.com/api/v2/barong/identity/sessions email=*YOUR_EMAIL* password=*YOUR_PASSWORD*
After that your session will be stored in test_session
.
You can do any request to your Peatio/Barong APIs:
http --session test_session https://www.example.com/api/v2/peatio/account/balances
http --session test_session https://www.example.com/api/v2/barong/resource/users/me
cURL can also be used.
Here is an example on how to use cURL in few steps:
First of all you need to get _session_id
and _barong_session
, by running the following command:
curl -i 'https://www.example.com/api/v2/barong/identity/sessions' -H 'Origin: https://www.example.com' -H 'Content-Type: application/json' --data-binary '{"email":"*YOUR_EMAIL*","password":"*YOUR_PASSWORD*"}'
Find the headers set-cookie
in the output and put values from those headers to your request as follows:
-H 'Cookie: _session_id=*YOUR_SESSION_ID*;_barong_session=*YOUR_BARONG_SESSION*'
You can do any request to your Peatio/Barong APIs:
curl -i 'https://www.example.com/api/v2/peatio/account/balances' -H 'Origin: https://www.example.com' -H 'Cookie: _session_id=*YOUR_SESSION_ID*;_barong_session=*YOUR_BARONG_SESSION*' -H 'Content-Type: application/json'
If the deployment is made on Kubernetes and it's a production like environment, you can't really clean certain data in Redis, but you can reinstall it from scratch to purge all the data. To reinstall from scratch, please follow these steps:
helm ls
helm delete --purge *release_name*
kubectl get pv -n *backend_namespace*
bin/opex deps install redis