culhatsker / fileshelter Goto Github PK
View Code? Open in Web Editor NEWSimple file storage app made with flask
License: GNU General Public License v3.0
Simple file storage app made with flask
License: GNU General Public License v3.0
The app is about to grow bigger, but flask app module will not be able to fit all the changes without damaging readability. We may consider using a Flask feature called blueprints. They allow the programmer to split views into groups by their purpose and then combine them in the main module. This will allow us to meaningfully split the growing app.py
into user_views.py
and api_views.py
.
But first we need to understand how to do it in idiomatic way.
Please start digging some info about "how to build idiomatic flask app" and about blueprints
Here's a wiki page to start: http://flask.pocoo.org/docs/1.0/blueprints
We should add them.
I suggest using pytest for tests and drone for ci.
You can't delete the file after #15 was merged. Need to add a good way to delete achive a file - a context menu.
I think we should not implement file deletion, because it's not what important files are made for.
We should insted implement file archiving - moving them into special directory.
You only can see the current directory in the browser's url bar. It is not convenient.
Why not add a label that says what the current directory is.
If I add a bunch of files and create a directory, it's lost in betweed all the files in the directory.
We should sort the files by their type (file or directory, not extention) and then by their names.
If i try to create directory inside another one it creates in root directory.
If I try to access a non-existing directory or file, WSGI debugger shows up and spits out all the app's guts. Need to make prettier errors.
There's a mechanism in Flask that enables one to define custom error handlers for specific HTTP codes or Python exceptions:
http://flask.pocoo.org/docs/1.0/patterns/errorpages/
http://flask.pocoo.org/docs/1.0/api/#flask.Flask.errorhandler
There's alot of copy-paste code that checks if path is valid like that:
fileshelter/fileshelter/app.py
Lines 46 to 47 in 7421de6
It can be moved to a function.
Need to implement multiple file upload, it's tedious to upload many files one by one.
Docker pulls .pytest_cache and pycache directories into container and it interfere with the pytest inside the container causing it to fail.
Can we add a .dockerignore file with rules as per documentation that will prevent these directories from appearing in the container?
There's no readme in this project. How can one figure out how to build and run it?
The app is supposed to keep all files in safety, but how can we achieve this without backing up these files on different/remote storages?
What about implementing an automatic backing up of all uploaded files? App may upload it into some Amazon services like S3 or BackBlaze B2 cloud or we can just secure copy (scp
) files to another machine.
Ideally it should be configurable on settings page. Also the progress and status of this process must be visible and controlled by the user. To achieve this, we need to view this backing up process as a list of tasks with statuses etc. A specific page can be created to display the tasks.
The app was supposed to encrypt/decrypt all uploaded/downloaded files on the go, but now it's just keeping them as is in the directory nearby. Can we fix this?
This code sample may show how we can achieve this:
from Crypto.Hash import SHA256
from Crypto.Cipher import AES
from Crypto import Random
def get_key_for_password(password):
hashobj = SHA256.new()
hashobj.update(password)
return hashobj.digest()
def encode_document(password, data):
key = get_key_for_password(password)
iv = Random.new().read(AES.block_size)
cipher = AES.new(key, AES.MODE_CFB, iv)
return b'AES' + iv + cipher.encrypt(data)
def decode_document(password, data):
assert(data.startswith(b'AES'))
data = data[3:]
key = get_key_for_password(password)
iv = data[:AES.block_size]
cipher = AES.new(key, AES.MODE_CFB, iv)
return cipher.decrypt(data[AES.block_size:])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.