-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscwadd-ec2-launch-user-data.txt
65 lines (33 loc) · 1.41 KB
/
scwadd-ec2-launch-user-data.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
yum update -y
yum install docker git -y
service docker start
usermod -a -G docker ec2-user
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
git clone https://github.com/kdrag/prod-scwadd
cd prod-scwadd
git checkout master
# These URL values can be modified for different environments
echo "
SMD_AUTH_BASE_URL=https://sharemydata.pge.com/myAuthorization
REDIRECT_BASE_URL=$(/opt/aws/bin/ec2-metadata -p | sed 's/public-hostname: /http:\/\//g')
PGE_API_BASE_URL=https://api.pge.com
PGE_API_BASE_AUTHORIZE_URL=https://api.pge.com/datacustodian/oauth/v2/authorize
PGE_API_BASE_TOKEN_URL=https://api.pge.com/datacustodian/oauth/v2/token
# CLIENT_ID value from ShareMyData portal
CLIENT_ID=
# CLIENT_SECRET value from ShareMyData portal
CLIENT_SECRET=
" >> /prod-scwadd/.env
# CERTIFICATE value from SSL
echo "
" >> /prod-scwadd/ssl/certs/certificate.crt
# PRIVATE KEY value from SSL
echo "
" >> /prod-scwadd/ssl/private/private.key
mkdir -p nginx/config/auth
# insert username:{SHA}<encoded value> between the "" below, where username is some string value, and <encoded value> is given by
# using a tool such as from https://hostingcanada.org/htpasswd-generator/ to help create the encoding.
echo "" >> prod-scwadd/nginx/config/auth/htpasswd
docker-compose up --build -d