2 Commits

Author SHA1 Message Date
  John-Mark Gurney f5107d26de add missing closing ul 3 months ago
  John-Mark Gurney 7a1509d3b1 add script to invalidate cache. 3 months ago
2 changed files with 33 additions and 0 deletions
Split View
  1. +32
    -0
      invalidate.py
  2. +1
    -0
      layout/base.j2

+ 32
- 0
invalidate.py View File

@@ -0,0 +1,32 @@
import boto.cloudfront
import os
import time

if __name__ == '__main__':
key = os.environ['AWS_ACCESS_KEY_ID']
secret = os.environ['AWS_SECRET_ACCESS_KEY']
distid = os.environ['BAYSEC_DISTID']

c = boto.cloudfront.CloudFrontConnection(key, secret)

#help(c)

#print(list(c.get_invalidation_requests(distid)))

iq = c.create_invalidation_request(distid, [ '/*' ])
iqid = iq.id

print('invalidation id:', iqid)

for i in range(20):
if iq.status == 'Completed':
print('Done')
break

print('checking...')
time.sleep(5)
iq = c.invalidation_request_status(distid, iqid)
else:
print('failed, c is connection, iq is last request, iqid is Id of request')
import pdb
pdb.set_trace()

+ 1
- 0
layout/base.j2 View File

@@ -96,6 +96,7 @@
<li><a href="/calendar.ics">Calendar</a></li>
<li><a rel="me" href="https://infosec.exchange/@baysec">Fediverse</a></li>
<li class="copyright">Brought to you by <a href="https://www.funkthat.com/gitea/jmg/baysec">some folks</a>.</li>
</ul>
</div>
</div>
</footer>


Loading…
Cancel
Save