Git Product home page Git Product logo

embeta-cloud's Introduction

screenshot

eMbeta Cloud

New concept to directly upload files from server to Google Drive. It will give you a proxy and will automatically download files to server, after which you can easily upload it Google Drive or download it to your PC.

Somebody is requested to upload it to a high-speed server so that it's made open to all.

Features

  • Single Page UI (made with semantic-ui and angularJS)
  • Responsive UI
  • Realtime information update
  • Support for torrents
  • Can upload complete folders to Google Drive with click of a button
  • Zip and download torrents
  • Zip and upload torrents to Drive
  • Auto-Upload to GDrive on completion
  • Multiple Cloud Storage support, currently :
    • Google Drive
    • Mega

Usage

First clone the repo and install dependencies:

npm install

You have to make a google developers project and set the following environment variables:

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GOOGLE_REDIRECT_URL (it should be <server address>/oauthCallback by default)

Ensure that you request full google drive access permission and basic G+ info in your google project

To start server, run:

npm start

For Heroku:

Heroku is no longer supported.

For Docker:

`docker run -d -p 3000:3000 -e GOOGLE_CLIENT_ID='***' -e GOOGLE_CLIENT_SECRET='***' -e GOOGLE_REDIRECT_URL='***' mrigank11/embetacloud node server/server.js`

Fill *** with appropriate values.

If you want to debug, add -e DEBUG='eMCloud:*' and remove the -d

Debugging

eMbeta Cloud is debug compatible, to get debug info set environment variable DEBUG=eMCloud:* and start server.

Upcoming Features

  • Incognito mode

How to contribute

  • Add new Cloud Storage
  • Find bugs and report them
  • Suggest new features
  • Fix bugs

How to add Cloud Storage

Adding new clouds is easy, just follow these steps:

  1. Create new folder inside /server/Storages/ (e.g. /server/Storages/DropBox) and add .ts file to it with same name as that of folder (say /server/Storages/DropBox/Dropbox.ts)
  2. Now you've to write your code in that file, the template is
export class CloudName extends EventEmitter{
    constructor(credentials){
        super();
        //store credentials, they can be username/password or OAuth Tokens etc.
    }
    static getURL(){
        //return the url on which the user will be redirected for credentials, can be OAuth Consent Page or a page on server itself.
    }
    static callbackHandler(query,callback){
        //handle the recieved credentials, 'query' contains the GET params. (like for OAuth, authentication code is 'query.code')
        //after successfull authenticaltion, return creds to 'callback' to be stored as session variable
        //if authentication fails, call the callback as: callback(0)
        // when user requests a file upload, credentials from session will be used to initialize this class (the constructor will be called)
    }
    public uploadFile(readStream, totalSize, mime, filename){
        //handle the upload procedure
        //it should emit => progress        : {name,bytesUploaded,size}
        //                  fileUploaded    : {size, name , error} 
    }
    public uploadDir(localFolderPath){          //not necessary
        //upload a local directory
        //should emit    => addSize    : size      size in bytes to be added to total upload size
        //may emit       => mkdir      : name      name of cloud directory created
    }
}

For example, see /server/Storages/GDrive/GDrive.ts

  1. Add new storage to /server/Storages/Storages.ts (import it and add in storages object)
  2. Compile typescript

When user clicks login, url is generated by calling getURL(), it may be OAuth Consent Page or a custom one. After redirection from OAuth Page(maybe other also), user is redirected to /oauthcallback/ with credentials as GET paramaters, callbackHandler(query) is called with these params. After Successfull login, credentials passed to callback are stored as session variables which are used to initialize this class i.e. constructor will be called with these creds.

getURL() may redirect url to custom page. For Example: returning /login/mega will open /server/Storages/mega/login.html

embeta-cloud's People

Contributors

mrigank11 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.