forked from coderanger/slackin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secrets-entrypoint.sh
executable file
·67 lines (53 loc) · 1.64 KB
/
secrets-entrypoint.sh
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
66
67
#!/bin/bash
# Load the secrets from SSM parameter store into the environment variables
# using https://github.com/Droplr/aws-env/
eval $(aws-env)
printenv
# Check that the environment variables have been set correctly
if [ -z "$AWS_REGION" ]; then
echo >&2 'error: missing AWS_REGION environment variable'
exit 1
fi
if [ -z "$BLOCKDOMAINS_SLACK_LIST" ]; then
echo >&2 'error: missing BLOCKDOMAINS_SLACK_LIST environment variable'
exit 1
fi
if [ -z "$CUSTOM_CSS" ]; then
echo >&2 'error: missing CUSTOM_CSS environment variable'
exit 1
fi
if [ -z "$GOOGLE_CAPTCHA_SECRET" ]; then
echo >&2 'error: missing GOOGLE_CAPTCHA_SECRET environment variable'
exit 1
fi
if [ -z "$GOOGLE_CAPTCHA_SITEKEY" ]; then
echo >&2 'error: missing GOOGLE_CAPTCHA_SITEKEY environment variable'
exit 1
fi
if [ -z "$INTERVAL" ]; then
echo >&2 'error: missing INTERVAL environment variable'
exit 1
fi
if [ -z "$PORT" ]; then
echo >&2 'error: missing PORT environment variable'
exit 1
fi
if [ -z "$SLACK_API_TOKEN" ]; then
echo >&2 'error: missing SLACK_API_TOKEN environment variable'
exit 1
fi
if [ -z "$SLACK_CHANNELS" ]; then
echo >&2 'error: missing SLACK_CHANNELS environment variable'
exit 1
fi
if [ -z "$SLACK_COC" ]; then
echo >&2 'error: missing SLACK_COC environment variable'
exit 1
fi
if [ -z "$SLACK_SUBDOMAIN" ]; then
echo >&2 'error: missing SLACK_SUBDOMAIN environment variable'
exit 1
fi
echo "All env vars were set correctly"
printenv
./bin/slackin --coc "$SLACK_COC" --channels "$SLACK_CHANNELS" --port $PORT --interval $INTERVAL --css $CUSTOM_CSS $SLACK_SUBDOMAIN $SLACK_API_TOKEN $GOOGLE_CAPTCHA_SECRET $GOOGLE_CAPTCHA_SITEKEY 2>&1