Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

zaourzag
Copy link

No description provided.

@zaourzag zaourzag changed the title update update, make a favicon and make the storage_dir visable Mar 18, 2021
zaourzag and others added 11 commits March 18, 2021 23:13
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
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
Copy link
Member

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')
Copy link
Member

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>')
Copy link
Member

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

Copy link
Author

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']
Copy link
Member

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>
Copy link
Member

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/')
Copy link
Member

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>
Copy link
Member

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>
Copy link
Member

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>
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

irrelevant dependency?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants