By default, MindLogger response data are end-to-end encrypted and stored on the non-profit Child Mind Institute’s AWS account. We provide instructions below for owners of MindLogger applets who need to have all response data from their applets stored on their own AWS account’s server. If this situation applies to you, please contact matter[email protected] before continuing with the instructions below.
Routing encrypted data collected from the MindLogger app to your AWS server requires initial setup assistance from MindLogger developers. If you follow the instructions in this guide, you will be able to provide them with the following required information to connect your server:
This section will guide you to create a new AWS s3 bucket for (optional) media files collected by your MindLogger applets.
Enter “s3” in the search box at top and select “Buckets” under “S3”:
In the Buckets page, tap the orange “Create bucket” button:
Enter “my-mindlogger-bucket” into the Bucket name field and make it unique: append your company name or the project name.
Select the closest to you AWS Region
Tap the orange “Create bucket” button at the bottom (not visible in the screenshot):
You can now see the my-mindlogger-bucket in the list of S3 buckets:
You do not want to share information about a user with root access to your AWS account to MindLogger developers or anyone else! The following instructions will guide you to set up a new AWS user with restricted access to a new s3 bucket for (optional) media files collected by your MindLogger applets.
Sign in to https://aws.amazon.com/:
Enter “IAM” in the search box at top and select “Users” under “IAM”:
In the IAM > Users screen, tap the blue “Add users” button:
In the “Add user” screen #1:
Enter “mindlogger-user” as the User name
Select Access key credential type
Tap the blue “Next: Permissions” button at the bottom
In the “Add user” screen #2, tap the blue “Next: Tags” button:
In the “Add user” screen #3, tap the blue “Next: Review” button:
In the “Add user” screen #4, tap the blue “Create user” button:
In the “Add user” screen #5 (screenshot below), download the .csv table
*** SHARE THIS INFORMATION ONLY WITH MINDLOGGER ADMINISTRATORS ***[see top]
The file contains:
the Access key ID for the new user
the Secret access key for the new user
Tap the “Close” button
You will then be taken to the IAM > Users screen with the new mindlogger-user
Tap “mindlogger-user”
Tap the “Add inline policy” link on the right:
Copy/paste the text below into the “Create policy” page “JSON” tab (ref [1] and [2])
Tap the blue “Review policy” button:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-mindlogger-bucket"
]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::my-mindlogger-bucket/*"
]
}
]
}
Please change my-mindlogger-bucket according to your bucket name.
Enter “mindlogger-user-policy” in the Name field
Tap the blue “Create policy” button:
You will then be taken to the IAM > Users screen with the new mindlogger-user and mindlogger-user-policy:
Start typing RDS in the search box at top and select RDS:
Click create database:
Choose DB type PostgreSQL:
Choose Production and Single DB instance:
Specify DB instance (mindlogger-server) and DB user (mindlogger-root-user)
Note: Share the database instance name and user with MindLogger administrators
Specify the DB password. Use safe and complex one.
Note: Share the database password with MindLogger administrators
Select instance configuration: db.m6g.large
Specify storage and its size:
Allow public access:
Create new security group and call it “mindlogger-security-group”:
Click Create database.
Enter “ec2” in the search box at top and select “Instances” under “EC2”:
Click security groups in the left sidebar:
Select “mindlogger-security-group” and click inbound rules at the bottom:
Click Edit inbound rules:
Click Add rule:
5432
. In the source enter 3.227.120.88/32
.50.16.133.36/32
, 18.210.53.226/32
, 54.145.72.213/32
Click Save rules.
Start typing RDS in the search box at top and select RDS:
Find mindlogger-server in the list and click on it:
Copy the database endpoint and port and share with MindLogger administrators:
Your MindLogger database needs to be set up somewhere to store the response data collected by your MindLogger applets. This section will guide you to create a new AWS Linux 2 instance.
Enter “ec2” in the search box at top and select “Instances” under “EC2”:
In the Instances page, tap the orange “Launch instances” button:
Enter “mindlogger-instance” in the Name field
If you tap the orange “Launch instance” button…
…it will alert you that you need a Key pair name
Tap on the “Create new key pair” link:
Enter “mindlogger-key-pair” in the Name field
Tap the orange “Create key pair” button:
Tap the orange “Launch instance” button:
It should then confirm you have successfully initiated launch of the new instance
Tap the orange “View all instances” button:
You should see mindlogger-instance in the list of EC2 instances (you might need to wait and refresh the Instances page):
Tap the right mouse button and click “Connect”:
In order to get access to PostgreSQL instance from the internet you will need to open external port.
5432
. In the source enter 3.227.120.88/32
.50.16.133.36/32
, 18.210.53.226/32
, 54.145.72.213/32
This section will guide you to create an empty MindLogger postgres database.
Run the following command in terminal:
sudo yum update -y
Install the PostgreSQL amazon extras repository:
sudo amazon-linux-extras enable postgresql14
Install the PostgreSQL server:
sudo yum install postgresql-server -y
Initialize the DB:
sudo postgresql-setup initdb
Start PostgreSQL
sudo systemctl start postgresql
Check its status
sudo systemctl status postgresql
Enable service autostart
sudo systemctl enable postgresql
su postgres
createdb mindlogger
Note: Share the database name with MindLogger administrators [see top]
Get into PostgreSQL console by running psql mindlogger
in terminal
CREATE USER mindlogger WITH ENCRYPTED PASSWORD 'new_password';
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO mindlogger;
GRANT ALL PRIVILEGES ON DATABASE mindlogger TO mindlogger;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO mindlogger;
GRANT ALL ON DATABASE mindlogger TO mindlogger;
GRANT USAGE, CREATE ON SCHEMA public TO mindlogger;
Note: replace new_password
with a new safe and complex password.
Note: Share the database username and password with MindLogger administrators [see top]
Exit from PostgreSQL console by typing exit
exit
Let’s configure the Postgres Listening IP. Edit the postgres settings file
sudo nano /var/lib/pgsql/data/postgresql.conf
Find the #listen_addresses = 'localhost'
line and replace it with this line:
listen_addresses = '*'
Save and exit the editor. You need to press Ctrl+O, hit enter and then press Ctrl+X
Let’s configure the Postgres Allowed IPs. Edit the postgres settings file
sudo nano /var/lib/pgsql/data/pg_hba.conf
Paste the following content at the end of this file:
host all all 3.227.120.88/32 md5
host all all 50.16.133.36/32 md5
host all all 18.210.53.226/32 md5
host all all 54.145.72.213/32 md5
Save and exit the editor. You need to press Ctrl+O, hit enter and then press Ctrl+X
Restart the service
sudo service postgresql restart