Code Monkey home page Code Monkey logo

pyrobox's Issues

Change Project name and Publish to PIP

  1. Change package name to "py_fileserver"
  2. Short name for cmd "py_fs"
  3. Make a development branch to push all dirty changes.
  4. Add Contribution.md and other files like other projects
  5. Maybe ask for donations?
  6. Add "Push to pip" action

[IDEA] on download folder, scan directory for changes

On 1st time zipping, scan the directory and write .json file {"file name hash": "last modified", ....} And keep it side by side with .zip file in temp folder.

On 2nd run, match the folder with .json and if modified, create new zip (will not delete older because might be in use) however will rewrite the .json

On side by side run, keep track on 1st run, then check for 2nd run, if unchanged, return 1st one handler.

NOTE: in future add cache management per user, so after zipping and downloading user can delete his .zip from temp folder... Maybe. Bcz might be in use by other. So don't do it.....

separate android and linux

Both android and linux tells "linux" in platform.system.

From os import environ
is_android = 'ANDROID_STORAGE' in environ

[Feat] [MUST] ADD login with permission & IP ban

Required for extreme level security

  • Need to solve #26 first

Add log in feature.
Heres how:

  1. Create account by asking the admin (offline), the admin will create {"username": ["$salted password hash", permission_level]
  2. Also create a list ["token"+"permission_level]

ie: "dhskdh398wjr9" , the last "9" is the permission level

because same user may use multiple PC with multiple browsers.

So the server will generate a token and store it on Cache (use https://docs.python.org/3/library/http.cookies.html and https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) (use HttpOnly and same-origin?)

Check it with server and on every request, update the hash with new one with a Constant amount of expire days defined in the config

  1. On multiple failure (define in config), put the IP on blocklist
  2. Ask admin to manually remove that...

add 7z linux support

check if 7z installed

  1. sudo apt list --installed | grep 7zip

if you are using zsh

  1. sudo apt search 7zip'*' --installed

if you are using bash

  1. sudo apt search 7zip* --installed

if not

sudo apt-get install 7zip p7zip

make a log file

/?logfile=secRET
Make a log file with password protected system. If possible instead of making link with pass, send password data as post request and get the log

[FEAT] check if port is open or closed

here's how:

import socket

HOST = "localhost"
PORT = 443

# Creates a new socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# Try to connect to the given host and port
if sock.connect_ex((HOST, PORT)) == 0:
    print("Port " + str(PORT) + " is open") # Connected successfully
else:
    print("Port " + str(PORT) + " is closed") # Failed to connect because port is in use (or bad host)

# Close the connection
sock.close()

HIGH CPU after uploading large file >2gb

High CPU usage (on server) after sending a large file to server. File is inaccessible during that time (server has the file open)

Sending zip and force closing the server caused unexpected eof to the

TO TEST:

  • make a file with numbers (size 2 gb)
  • post it to the server
  • Wait till it hits high CPU
  • break the process
  • compare uploaded and original file

To analyze:

  • What is causing this high cpu
  • Why the file is inaccessible after upload
  • is there any unlimited loop

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.