Add AGPLv3 compliance

This commit is contained in:
Iliana Weller 2018-04-03 18:31:14 -07:00
parent d67276a316
commit 4048b31187
No known key found for this signature in database
GPG Key ID: DCE341C8E949BC81
6 changed files with 41 additions and 2 deletions

View File

@ -13,6 +13,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import botocore.session
import operator
import requests
import urllib.parse
@ -41,6 +42,17 @@ def no_content():
return ('', 204)
@app.route('/code')
def code():
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)
@app.route('/', methods=('GET', 'POST'))
def index():
if request.method == 'POST':

View File

@ -1,3 +1,4 @@
Flask
botocore
requests
zappa

View File

@ -43,3 +43,7 @@ dl.emojo dd {
dl.emojo dd.success {
color: rgb(202, 143, 4);
}
footer {
font-size: smaller;
}

View File

@ -8,5 +8,18 @@
<body>
{% block body %}
{% endblock body %}
<footer>
<p>
emojos.in by <a href="https://cybre.space/@iliana">@iliana@cybre.space</a>
&middot;
AGPLv3
&middot;
<a href="{{ url_for('code') }}">source code download</a>
&middot;
<a href="https://github.com/ilianaw/emojos.in">github</a>
</p>
</footer>
{% block script %}
{% endblock script %}
</body>
</html>

View File

@ -13,5 +13,7 @@
</div>
{% endfor %}
</dl>
<script src="{{ url_for('static', filename='copy.js') }}"></script>
{% endblock body %}
{% block script %}
<script src="{{ url_for('static', filename='copy.js') }}"></script>
{% endblock script %}

View File

@ -7,6 +7,13 @@
"runtime": "python3.6",
"s3_bucket": "zappa-ha6nqt04p",
"domain": "emojos.in",
"certificate_arn": "arn:aws:acm:us-east-1:672373865878:certificate/b82eba06-6091-460e-af21-4f265e1206e9"
"certificate_arn": "arn:aws:acm:us-east-1:672373865878:certificate/b82eba06-6091-460e-af21-4f265e1206e9",
"extra_permissions": [
{
"Effect": "Allow",
"Action": "lambda:GetFunction",
"Resource": "*"
}
]
}
}