Various Updates

* Updated Readme
* Added new restrictive DynamoDB Policy document
* Added run.sh from EC2 instance filesystem
This commit is contained in:
Jared Dunbar 2021-09-18 22:21:13 -04:00
parent 3ec29f5ca2
commit 5e2dd89bef
3 changed files with 50 additions and 1 deletions

View File

@ -1,3 +1,33 @@
# eln1-stats # eln1-stats
Electrical Age 1.0 Stats Server Source Code Electrical Age 1.0 Stats Server Source Code
## Project Layout
Filesystem:
* .aws/config - sets us-east-1 as region
* .aws/credentials - uses AWS credentials (`arn:aws:iam::464053648600:user/eln1_stats`)
* main.py - Source Code
* run.sh - Script to run in Screen
* templates/modinfo.json - Modinfo Json (template file)
* /etc/nginx/nginx.conf - nginx configuration (simple proxy to unpriv port)
Also contained in this repository is the dynamodb policy document for put access to the DB
## Starting the script
Log in as the `arch` user (`vadu.pem` key) and then run `sudo su - stat` to become the stats user.
```shell
screen -S stats
```
```shell
./run.sh
```
Exit screen and profit.
## Python Requirements
boto3 and flask are required Python libraries.

15
dynamodb-policy.json Normal file
View File

@ -0,0 +1,15 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Eln1StatsDynamo",
"Effect": "Allow",
"Action": [
"dynamodb:PutItem"
],
"Resource": [
"arn:aws:dynamodb:us-east-1:464053648600:table/eln1_stats"
]
}
]
}

4
run.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cd /home/stat
python3 main.py > /dev/null