stallmanW
parent
5eefb6fa67
commit
6addaadf41
|
@ -5,7 +5,8 @@
|
||||||
#### imports ####
|
#### imports ####
|
||||||
#################
|
#################
|
||||||
|
|
||||||
from flask import render_template, Blueprint
|
import botocore.session
|
||||||
|
from flask import render_template, Blueprint, request, redirect
|
||||||
#from aaaaaaa import pack_ints, unpack_ints
|
#from aaaaaaa import pack_ints, unpack_ints
|
||||||
from kappa123.server.runs import inject_run_class, fetch_or_cache_runs
|
from kappa123.server.runs import inject_run_class, fetch_or_cache_runs
|
||||||
def pack_ints(s):
|
def pack_ints(s):
|
||||||
|
@ -48,3 +49,13 @@ def returning_user(preferences):
|
||||||
"main/home.html",
|
"main/home.html",
|
||||||
runs=runs
|
runs=runs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@main_blueprint.route("/code")
|
||||||
|
def agplv3_compliance():
|
||||||
|
context = request.environ.get('lambda.context')
|
||||||
|
session = botocore.session.get_session()
|
||||||
|
# region name is detected from lambda environment
|
||||||
|
client = session.create_client('lambda')
|
||||||
|
code = client.get_function(FunctionName=context.function_name,
|
||||||
|
Qualifier=context.function_version)
|
||||||
|
return redirect(code['Code']['Location'], code=303)
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
# zappa needs to come first because it locks to deps :(
|
||||||
|
zappa
|
||||||
|
|
||||||
coverage==4.3.4
|
coverage==4.3.4
|
||||||
Flask==0.12
|
Flask==0.12
|
||||||
Flask-Bootstrap==3.3.7.1
|
Flask-Bootstrap==3.3.7.1
|
||||||
Werkzeug==0.12
|
|
||||||
|
|
||||||
simplejson
|
simplejson
|
||||||
requests
|
requests
|
||||||
arrow
|
arrow
|
||||||
zappa
|
|
||||||
|
|
|
@ -3,6 +3,13 @@
|
||||||
"app_function": "kappa123.server.__init__.app",
|
"app_function": "kappa123.server.__init__.app",
|
||||||
"aws_region": "us-west-2",
|
"aws_region": "us-west-2",
|
||||||
"profile_name": "gdqdotmoe",
|
"profile_name": "gdqdotmoe",
|
||||||
"s3_bucket": "zappa-n2am4xeny"
|
"s3_bucket": "zappa-n2am4xeny",
|
||||||
|
"extra_permissions": [
|
||||||
|
{
|
||||||
|
"Effect": "Allow",
|
||||||
|
"Action": "lambda:GetFunction",
|
||||||
|
"Resource": "*"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue