GithubHelp home page GithubHelp logo

doc22940 / mydrive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from subnub/mydrive

1.0 0.0 0.0 46.35 MB

Node.js and mongoDB Google Drive Clone

License: GNU General Public License v3.0

JavaScript 89.92% HTML 0.08% CSS 10.00%

mydrive's Introduction

MyDrive

MyDrive is an Open Source Cloud Server (Similar To Google Drive), built with Node.JS, Express, React, and MongoDB.

Wiki

For a more detailed list of myDrive features, including examples with images, visit the wiki here: https://github.com/subnub/myDrive/wiki

MyDrive Features:

  • Upload Files
  • Download Files
  • Create Folders
  • Share Files
  • Creates Image Thumbnails
  • Photo-Viewer
  • Stream Video
  • Transcode Video
  • Create One-Time Download links for files
  • Move Files/Folders
  • AES256 Encryption (For file chunks, tokens, and more!)
  • Search For Files/Folders
  • Mobile Friendly (Including Uploading!)
  • Advanced Filter Options

Installation

Required:

  • Node.js (13.9+ Is Recommended)
  • MongoDB

Optional:

  • FFMPEG (For Video Transcoding, Does not work very well because of encryption ATM, But non-transcoded video streams work much better, I do not recommend using transcoding yet.)

Setup:

  • “npm install”, Installs all dependencies.

  • "npm run init", Asks user for some environment variable details, pressing enter on these fields will instead use the default values.

  • "npm run build" or "npm run build:no-ssl", This will look for the HTTPS Certificate, Place this HTTPS certificate at the root of the project, with the naming convention (certificate.ca-bundle, certificate.crt, and certificate.key). Note: If you do not have or want to use a HTTPS certificate, run "npm run build:no-ssl". This will run the server in production mode, without SSL encryption, this is vulnerable to man in the middle attacks!

  • “npm run create-indexes-database”, This will create indexes for mongoDB, this is greatly recommended, it will improve mongoDBs speed in retrieving files.

  • "npm start" or "npm run start:no-ssl". If you do not want SSL Encryption use "npm run start:no-ssl".

  • It will then ask for an encryption key, this can be whatever you would like, this key is later hashed. Do not lose this key, there is NO way to recover data from a lost key!

  • That's It! Now just Create a new account.

Enviroment Variables

The npm run init command will create the needed env variables, but if you would like to create them manually, structure the files like so.

Backend variables: Stored in /config/prod.env

  • MONGODB_URL=
  • PASSWORD=
  • HTTP_PORT=
  • HTTPS_PORT=
  • URL=
  • FULL_URL=
  • ROOT=

Optional:

  • KEY=

The KEY variable is optional, without it the server will prompt you for a password on startup, with a KEY the server will skip prompting for the password, use a KEY if you want to use myDrive with docker, or similar tools.

Frontend variables: Stored on the root of the project .env.production

  • PORT=
  • REMOTE_URL=

Built In Server Tools

MyDrive comes with some built in NPM scripts for server management, this includes:

  • Backup Database: Command “npm run backup-database", creates a temporary backup of the database inside of mongoDB, please note you can only have one backup at a time, for better backups use mongoExport.

  • Restore Database: Command “npm run restore-database”, Restores Database from backup.

  • Clean Database: Command “npm run clean-database”, Cleans database, removing any orphaned chunks that do not have a file associated with them, this command will automatically run backup database, incase anything fails.

  • Change Encryption Password: Command “change-password-database”, Changed the encryption password, that the server first asks for on start up, this requires the old encryption password. This will also create a new backup, incase anything fails.

  • Delete Database: Command “npm run delete-database”, Deletes the main database, does not delete the temporary backup.

  • Delete Temp Database: Command “npm run delete-temp-database”, Deletes the database backup.

  • Create Indexes: Command “npm run create-indexes-database", Creates Indexes for mongoDB, without this mongoDB will need to search through every single file on request, run this before using the server.

  • Run Tests: Command "npm run test", Starts unit testing.

Video

I created a short YouTube video, showing off myDrives design and features: https://youtu.be/0YKU5CZHG4I

Security

MyDrive encrypts all file chunks, tokens, and temp tokens. These items are first encrypted with a randomly generated 32 byte private key, and random 16 byte public key (A different random public key is used for different items).The private key is encrypted with the users salted password, and then the hashed server key (Acquired on server startup). Note: Running the command to change the servers key, will generate new private and public keys for each user, and will have to re-encrypt all chunks.

Using myDrive for personal use?

After you create your account, disable the ability to create a new account by adding the following value to the prod.env file (Located inside on the config folder). BLOCK_CREATE_ACCOUNT=true

Questions? Feature Requests? Hiring? Contact Me!

Contact Email: [email protected]

mydrive's People

Contributors

immaax avatar subnub avatar

Stargazers

 avatar

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.