Add AGPLv3 compliance
This commit is contained in:
parent
d67276a316
commit
4048b31187
12
emojos.py
12
emojos.py
|
@ -13,6 +13,7 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import botocore.session
|
||||||
import operator
|
import operator
|
||||||
import requests
|
import requests
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
@ -41,6 +42,17 @@ def no_content():
|
||||||
return ('', 204)
|
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'))
|
@app.route('/', methods=('GET', 'POST'))
|
||||||
def index():
|
def index():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
Flask
|
Flask
|
||||||
|
botocore
|
||||||
requests
|
requests
|
||||||
zappa
|
zappa
|
||||||
|
|
|
@ -43,3 +43,7 @@ dl.emojo dd {
|
||||||
dl.emojo dd.success {
|
dl.emojo dd.success {
|
||||||
color: rgb(202, 143, 4);
|
color: rgb(202, 143, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
|
|
@ -8,5 +8,18 @@
|
||||||
<body>
|
<body>
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
<footer>
|
||||||
|
<p>
|
||||||
|
emojos.in by <a href="https://cybre.space/@iliana">@iliana@cybre.space</a>
|
||||||
|
·
|
||||||
|
AGPLv3
|
||||||
|
·
|
||||||
|
<a href="{{ url_for('code') }}">source code download</a>
|
||||||
|
·
|
||||||
|
<a href="https://github.com/ilianaw/emojos.in">github</a>
|
||||||
|
</p>
|
||||||
|
</footer>
|
||||||
|
{% block script %}
|
||||||
|
{% endblock script %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -13,5 +13,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</dl>
|
</dl>
|
||||||
<script src="{{ url_for('static', filename='copy.js') }}"></script>
|
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
{% block script %}
|
||||||
|
<script src="{{ url_for('static', filename='copy.js') }}"></script>
|
||||||
|
{% endblock script %}
|
||||||
|
|
|
@ -7,6 +7,13 @@
|
||||||
"runtime": "python3.6",
|
"runtime": "python3.6",
|
||||||
"s3_bucket": "zappa-ha6nqt04p",
|
"s3_bucket": "zappa-ha6nqt04p",
|
||||||
"domain": "emojos.in",
|
"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": "*"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue