-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update, make a favicon and make the storage_dir visable #1
base: master
Are you sure you want to change the base?
Conversation
This commit implements a fully-automated development setup using Gitpod.io, an online IDE for GitLab, GitHub, and Bitbucket that enables Dev-Environments-As-Code. This makes it easy for anyone to get a ready-to-code workspace for any branch, issue or pull request almost instantly with a single click.
Fully automate dev setup with Gitpod
Zaourzag/gitpod setup
the add-user endpoint didnt work and it had a different get methodd then other so i tested it with the other and it works; pushing to repo now
implements it just so it works :)
import secrets | ||
import traceback | ||
from os.path import splitext | ||
import datetime import hashlib import os import secrets import traceback from os.path import splitext from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Against PEP8
@@ -86,6 +82,12 @@ def create_new_user(uid: int, name: str): | |||
def datefromunix(s): | |||
return datetime.datetime.fromtimestamp(int(s) / 1000).strftime("%Y-%m-%d %H:%M") | |||
|
|||
@app.route('/favicon.ico') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that should be done with nginx
@@ -121,7 +123,11 @@ def my_portal(): | |||
activity = _db.images.find({"user_uid": session.get("logged_in")}).sort('created', pymongo.DESCENDING).limit(5) | |||
activity = [x for x in activity] | |||
return render_template("my_portal.html", domains=allowed_domains, total=total, images=activity) | |||
|
|||
@app.route('/i/<filename>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that should be done with nginx or storage provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example?
@@ -234,7 +330,7 @@ def upload(): | |||
|
|||
@app.route('/add-user', methods=['POST']) | |||
def add_user(): | |||
token = request.headers.get("Authorization", "unknown") | |||
token = request.form['Authorization'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an admin token, should be used in headers
@@ -0,0 +1,53 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should look into flask-babel
@@ -193,6 +199,96 @@ def print_stats(): | |||
"files": _db.images.count(), | |||
"domains": len(allowed_domains) | |||
}) | |||
@app.route('/nl/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should look into flask-babel
@@ -0,0 +1,96 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should look into flask-babel
@@ -0,0 +1,257 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should look into flask-babel
@@ -0,0 +1,61 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should look into flask-babel
Pillow | ||
pycrypto | ||
asn1crypto==0.24.0 | ||
certifi==2018.4.16 | ||
cffi==1.11.5 | ||
dnspython |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
irrelevant dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so
No description provided.