forked from exceptionless/Exceptionless.UI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·60 lines (53 loc) · 1.82 KB
/
bootstrap
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
#!/bin/bash
ApiUrl="${EX_ApiUrl:-http://ex-api.localtest.me:5000}"
Html5Mode="${EX_Html5Mode:-false}"
EnableSsl="${EX_EnableSsl:-false}"
EnableAccountCreation="${EX_EnableAccountCreation:-true}"
OAuth="${EX_ConnectionStrings__OAuth:-}"
IFS=';' read -a oauthParts <<< "$OAuth"
for part in ${oauthParts[@]}
do
key="$( cut -d '=' -f 1 <<< $part )"; echo "key: $key"
value="$( cut -d '=' -f 2- <<< $part )"; echo "value: $value"
if [ "$key" == "FacebookId" ]; then
FacebookAppId=$value
fi
if [ "$key" == "GitHubId" ]; then
GitHubAppId=$value
fi
if [ "$key" == "GoogleId" ]; then
GoogleAppId=$value
fi
if [ "$key" == "IntercomId" ]; then
IntercomAppId=$value
fi
if [ "$key" == "MicrosoftId" ]; then
MicrosoftAppId=$value
fi
if [ "$key" == "SlackId" ]; then
SlackAppId=$value
fi
done
config="(function () {
'use strict';
angular.module('app.config', [])
.constant('BASE_URL', '$ApiUrl')
.constant('EXCEPTIONLESS_API_KEY', '$EX_ExceptionlessApiKey')
.constant('EXCEPTIONLESS_SERVER_URL', '$EX_ExceptionlessServerUrl')
.constant('FACEBOOK_APPID', '$FacebookAppId')
.constant('GITHUB_APPID', '$GitHubAppId')
.constant('GOOGLE_APPID', '$GoogleAppId')
.constant('INTERCOM_APPID', '$IntercomAppId')
.constant('LIVE_APPID', '$MicrosoftAppId')
.constant('SLACK_APPID', '$SlackAppId')
.constant('STRIPE_PUBLISHABLE_KEY', '$EX_StripePublishableApiKey')
.constant('SYSTEM_NOTIFICATION_MESSAGE', '$EX_NotificationMessage')
.constant('USE_HTML5_MODE', $Html5Mode)
.constant('USE_SSL', $EnableSsl)
.constant('ENABLE_ACCOUNT_CREATION', $EnableAccountCreation);
}());"
checksum=`echo -n $config | md5sum | cut -c 1-32`
echo $config > "/app/app.config.$checksum.js"
sed -i -E "s/app\.config\..+\.js/app.config.$checksum.js/" /app/index.html
echo "Running NGINX"
nginx