File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 9
9
session = None
10
10
s3_endpoint = None
11
11
12
+ # Try loading creds from the environment.
13
+ try :
14
+ if session is None and config ['AWS_ACCESS_KEY' ] is not None and config ['AWS_SECRET_KEY' ] is not None :
15
+ session = boto3 .Session (
16
+ aws_access_key_id = config ['AWS_ACCESS_KEY' ],
17
+ aws_secret_access_key = config ['AWS_SECRET_KEY' ],
18
+ )
19
+ # XXX: for GCP later:
20
+ # s3_endpoint = creds.get('S3Endpoint')
21
+ except :
22
+ pass
23
+
24
+
25
+ # "Well, the creds were towed outside the environment." "Into another
26
+ # environment?" "No, no, they've been towed beyond the environment. They're
27
+ # not in the environment." "No, but from one environment to another
28
+ # environment." "No, it's beyond the environment. It's not in an
29
+ # environment. It's been towed beyond the environment." "Well, what's out
30
+ # there?" "Nothing's out there!" "Well there must be something out there"
31
+ # "There's nothing out there! All there is sea, and birds, and fish."
32
+ # "And?" "And 20,000 tons of AWS creds." "And what else?" "And a fire."
33
+ #
34
+ # Try loading creds from an on-disk .json.
12
35
try :
13
36
if session is None :
14
37
with open ('session-token.json' , 'r' ) as f :
Original file line number Diff line number Diff line change 21
21
'HONEYCOMB_KEY' : os .environ .get ('HONEYCOMB_KEY' , None ),
22
22
'DISCORD_HOOK_URL' : os .environ .get ('DISCORD_HOOK_URL' , None ),
23
23
'DISCORD_ADMIN_HOOK_URL' : os .environ .get ('DISCORD_ADMIN_HOOK_URL' , None ),
24
- 'ALGOLIA_DISABLE' : os .environ .get ('ALGOLIA_DISABLE' , False )
24
+ 'ALGOLIA_DISABLE' : os .environ .get ('ALGOLIA_DISABLE' , False ),
25
+ 'AWS_ACCESS_KEY' : os .environ .get ('AWS_ACCESS_KEY' , None ),
26
+ 'AWS_SECRET_KEY' : os .environ .get ('AWS_SECRET_KEY' , None ),
25
27
}
You can’t perform that action at this time.
0 commit comments