Skip to main content

Personal DropBox for Private Network

Project description

pyrobox 🔥

Note : DEFAULT UPLOAD PASSWORD: SECret

  • you can change it by editing the code (see config class at top)
  • to set password from command line, use -k or --password flag

Status

Downloads

Requesting for more suggesions and ideas

Feel Free to Support Me

Buy Me A Coffee

Basic FEATURES

  • File Hosting system (Serve files from local Storage system)
  • Access Shared File System from Multiple Devices
  • Has optional account system (Admin can add users or allow signup) (Check Advanced Account System section)
  • Set Server Permission (Check Customization Options section)

Extra FEATURES

  • 🔽 DOWNLOAD AND VIDEO STREAM WITH PAUSE AND RESUME
  • 🔼 UPLOAD WITH PASSWORD (User password or server-wide password)
  • 👌 HTML5 drag and drop uploader
  • 📈 MULTIPLE FILE UPLOAD
  • 📝 RENAME
  • 📁 FOLDER DOWNLOAD as ZIP (uses temp folder)
  • ⏯ Built-in VIDEO PLAYER
  • 🔁 DELETE FILE (MOVE TO RECYCLE BIN)
  • 🔥 PERMANENTLY DELETE
  • File manager like NAVIGATION BAR
  • 📑 Right click Context menu (Tap n hold on touch device)
  • 🧨 RELOAD SERVER FROM REMOTE [DEBUG PURPOSE]
  • 🆕 FOLDER CREATION
  • 💬 Pop-up messages UI(from my Web leach repo)
  • 🌐 (If you are using REAL IP AND ALLOW PYTHON TO USE PUBLIC NETWORK, YOUR SERVER CAN BE VISIBLE AROUND THE GLOBE. (you must use port forwarding from Router)
  • 🧬 Clone entire directory from Host to Client with least changes (last modified preserved)
  • 🔜 More comming soon
  • All of these without the need of any internet connection (having connection will provide better experience)

Server side requirement

  • Python 3.7 or higher. Older support available.[^1]
  • Basic knowledge about Python
  • send2trash, natsort python modules

[^1]: [<=3.4 compatibility] is on the way.

Installation

  1. Install Python 3.7 or higher
  2. Close older pyrobox process if already running
  3. Install using PIP

On Windows

  1. Open CMD or PowerShell
  2. Run pip install -U pyrobox
  3. Run pyrobox to launch the server on the Terminal Current Working Directory.

On Linux

  1. Open Terminal
  2. Run pip3 install -U pyrobox
  3. Run pyrobox to launch the server on the Terminal Current Working Directory.

CHECK FAQ FOR FUTURE HELP AND ISSUE FIX

Quick Tutorial

https://github.com/RaSan147/pyrobox/assets/34002411/eb2ac313-f95a-4334-a265-c3feeb333821

Customization

  1. Simply running the code on will create a server on CURRENT WORKING DIRECTORY on Port: 6969

  2. On browser (on device under same router/wifi network), go to deviceIP:port_number to see the output like this: http://192.168.0.101:6969/

    • you must allow python in firewall to access network, check FAQ for more help
  3. To change the server running directory,

    • (i) either edit the code (see config class at top)
    • (ii) or add -d or --directory command line argument when launching the program
      • pyrobox -d . to launch the server in current directory (where the file is)
      • pyrobox -d "D:\Server\Public folder\" (Use Double-Quotation while directory has space)
      • pyrobox -d "D:/Server/Public folder" (Forward or backward slash really doesn't matter, unless your terminal thinks otherwise)
  4. To change port number

    • (i) just edit the code for permanent change (see config class at top)
    • (ii) or add the port number at the end of the command line arg
      • pyrobox 45678 # will run on port 45678
      • pyrobox -d . 45678 # will run on port 45678 in current directory
  5. To specify alternate bind address

    • Add bind add -bind {address} # ie: -bind 127.0.0.2 or -bind 127.0.0.99
  6. To change upload password

    • (i) or add -k or --password command line argument when launching the program
      • pyrobox -k "my new password" to launch the server with new password
      • pyrobox -k "" to launch the server without password
      • pyrobox to launch the server with default password (SECret)
    • (ii) just edit the code for permanent change (see config class at top)
  7. Optional configurations

usage: pyrobox [--password PASSWORD] [--no-upload] [--no-zip] [--no-update] [--no-delete] [--no-download] [--read-only] [--view-only] [--bind ADDRESS] [--directory DIRECTORY] [--version] [-h] [port]

Positional Arguments

arg value Description
port Specify alternate port [default: 6969]

Options

Flags/Arg value Description
--password PASSWORD, -k PASSWORD Upload Password (GUESTS users and Nameless server users must use it to upload files)(default: SECret)
--directory DIRECTORY, -d DIRECTORY Specify alternative directory [default: current directory]
--bind ADDRESS, -b ADDRESS Specify alternate bind address [default: all interfaces (0.0.0.0)]
--version, -v show program's version number and exit
-h, --help show this help message and exit
--no-extra-log Disable file path and [= + - #] based logs (default: False)
--zip-limit, -zl ZIP_LIMIT Set the limit of zip file size in bytes/KB/MB/GB/TB (default: 6GB)

Customization Options

Flags Description
--no-upload, -nu Files can't be uploaded (default: False)
--no-zip, -nz Disable Folder->Zip downloading (default: False)
--no-modify, -nm Disable File Modification (ie: renaming, overwriting existing files) (On upload, if file exists, will add a number at the end) (default: False)
--no-delete, -nd Disable File Deletion (default: False)
--no-download, -ndw Disable File Downloading [videos won't play either] (default: False)
--read-only, -ro Read Only Mode disables upload and any modifications ie: rename, delete (default: False)
--view-only, -vo Only allowed to see file list, nothing else (default: False)

Advanced Account System

You must give a --name [Name] and --admin-id [USER Name], --admin-pass [PASSWORD] to create an admin account. If guest not allowed --no-guest-allowed User must login to access the server. You can also disable signing up --no-signup (Only admin can add user from admin page). Admin can also update user permission from admin page.

Flags/Arg value Description
--name NAME, -n NAME Name of the user (default: None)
--admin-id ADMIN_ID, -aid ADMIN_ID Admin ID (default: None)
--admin-pass ADMIN_PASS, -ak ADMIN_PASS Admin Password (default: None)
--no-signup, -ns Disable Signing up (Only admin can add user from admin page)(default: False)
--no-guest-allowed, -ng Disable Guest Access (default: False)

Account Example

  1. pyrobox -n "My Server1" -aid "admin" -ak "admin123" -k "Guest_pass" # will allow anyone to access the server, but they must use Guest_pass to upload files
  2. pyrobox -n "My Server2" -aid "admin" -ak "admin123" -ng # If someone wants to access the server they must sign up via signup page first. No guest allowed
  3. pyrobox -n "My Server3" -aid "admin" -ak "admin123" -ng -ns # Only admin can access the server. No guest allowed, no signup allowed. Admin can add user from admin page

Clone Directory

  1. Make a python file with the following code
from pyrobox import clone
clone.main()
  1. Run the file. Follow the instructions.
  2. For advanced use, check the source code of clone.py in the pyrobox module.

TODO

Support for more features

Context menu

Right click on any file link

FAQ

Using WSL, "PIP not found"

Run this to install pip3 and add pip to path

sudo apt -y purge python3-pip
sudo python3 -m pip uninstall pip
sudo apt -y install python3-pip
pip3 install --upgrade pip
echo "export PATH=\"${HOME}/.local/bin:$PATH\"" >>"${HOME}"/.bashrc

Re-running the file should work.

Using Linux, "PIP not found"

Run this to install pip3

sudo apt -y purge python3-pip
sudo python3 -m pip uninstall pip
sudo apt -y install python3-pip
pip3 install --upgrade pip

Re-running the file should work.

Deleted (Move to Recycle), But WHERE ARE THEY?? [on LINUX & WSL]

Actually the feature is working fine, unfortunately NO-GUI mode linux and WSL don't recycle bin, so you can't find it! And to make things worse, you need to manually clear the recyle bin from ~/.local/share/Trash SO I'D RECOMMAND USING DELETE PARMANENTLY

Running on WINDOWS, but can't access with other device [FIREWALL]

You probably have FireWall ON and not configured. For your safety, I'd recommend you to allow Python on private network and run the server when your network is Private. IN SHORT: ALLOW PYTHON ON FIREWALL, RUN THE SERVER

note: allowed on private but using public network on firewall will cause similar issue, you gotta make both same or allow python both on public and private

Thanks to

  1. https://github.com/bones7456/bones7456/blob/master/SimpleHTTPServerWithUpload.py (the guy who made upload possible)
  2. https://gist.github.com/UniIsland/3346170 (the guy who made multiple file upload possible)
  3. https://github.com/SethMMorton/natsort (sorting titles)
  4. https://github.com/sandes/zipfly (modified lets you see the zip progress)
  5. https://github.com/sampotts/plyr (improved video player)
  6. https://github.com/transiscodev (added accunt system base Branch)

Disclaimer: the owner or the programmers or any content of this repository hold no responsibility for any kind of data loss or modification on your system and do not warrenty for such actions. I tried my best to prevent all sorts of ways (that I am currently aware of) to prevent data loss or unwanted data modification. See Data Safety Measures taken on this projects to prevent unwanted data loss.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrobox-0.9.9.tar.gz (116.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrobox-0.9.9-py3-none-any.whl (121.1 kB view details)

Uploaded Python 3

File details

Details for the file pyrobox-0.9.9.tar.gz.

File metadata

  • Download URL: pyrobox-0.9.9.tar.gz
  • Upload date:
  • Size: 116.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pyrobox-0.9.9.tar.gz
Algorithm Hash digest
SHA256 59f1392f4d5481f4497ff0e1b13b9469ba84f7a0da2ca6837de64475a252bf5b
MD5 c732db716a375a6ab800ad26bf1b5d38
BLAKE2b-256 bc6791075e0886c98d27497749cdb8e0c65c0dd8ac9c42511eff16457c38c514

See more details on using hashes here.

File details

Details for the file pyrobox-0.9.9-py3-none-any.whl.

File metadata

  • Download URL: pyrobox-0.9.9-py3-none-any.whl
  • Upload date:
  • Size: 121.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pyrobox-0.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c7d4706cd2b0fa7bf7d47c4567d0c382594bcac27aed59be238af6691a62d49d
MD5 bd1ce268920ecab984374bf76878e9c0
BLAKE2b-256 8818f422522c905eab5c0d3cbe4246dfb2dfebb684a1e477a92a04fcc535a5c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page