MCPcopy
hub / github.com/subnub/myDrive

github.com/subnub/myDrive @v4.0.2 sqlite

repository ↗ · DeepWiki ↗ · release v4.0.2 ↗
550 symbols 1,242 edges 258 files 0 documented · 0%
README

MyDrive Homepage

☁️ MyDrive

MyDrive is an Open Source cloud file storage server (Similar To Google Drive). Host myDrive on your own server or trusted platform and then access myDrive through your web browser. MyDrive uses mongoDB to store file/folder metadata, and supports multiple databases to store the file chunks, such as Amazon S3, or the Filesystem.

Main myDrive website

Live demo

🔍 Index

⭐️ Features

  • Upload Files
  • Download Files
  • Upload Folders
  • Download Folders (Automatically converts to zip)
  • Multiple DB Support (Amazon S3, Filesystem)
  • Photo, Video Viewer and Media Gallery
  • Generated Photo And Video Thumbnails
  • File Sharing
  • PWA Support
  • AES256 Encryption
  • Service Worker
  • Mobile Support
  • Docker
  • Email Verification
  • JWT (Access and Refresh Tokens)

👨‍🔬 Tech Stack

  • React
  • Typescript
  • Node.js
  • Express
  • MongoDB
  • Vite
  • Jest

🐳 Docker image

Required:

  • Docker
  • MongoDB (Unless using a service like Atlas)

Run the following command to download the latest docker image:

docker pull kylehoell/mydrive:latest

You must provide enviroment variables for the docker image to work. You can supply these during the docker run command instead of creating the env file.

backend/config -> Backend Enviroment Variables

You must also provide a volume for the image if you are using a filesystem database or if you want to use the generate video thumbnails feature. Volumes should be mounted to /data/ and /temp/ For example:

-v /path/example/mydrive/data/:/data/ -v /path/example/mydrive/temp/:/temp/

/data/: This is where the encrypted files will be stored.
/temp/: Where files will temporary be stored to generate video thumbnails as a fallback.

The docker image will by default run on port 3000.

Here is an example of the full docker command:

docker run -d \
  -p 3000:3000 \
  -e MONGODB_URL=mongodb://127.0.0.1:27017/mydrive \
  -e DB_TYPE=fs \
  -e PASSWORD_ACCESS=secretaccesspassword \
  -e PASSWORD_REFRESH=secretrefreshpassword \
  -e PASSWORD_COOKIE=secretcookiepassword \
  -e KEY=encryptionkey \
  -e VIDEO_THUMBNAILS_ENABLED=true \
  -e TEMP_VIDEO_THUMBNAIL_LIMIT=5000000000 \
  -v /path/example/mydrive/data/:/data/ \
  -v /path/example/mydrive/temp/:/temp/ \
  --name mydrive \
  kylehoell/mydrive:latest

💻 Manual Installation

Required:

  • Node.js (20 Recommended)
  • MongoDB (Unless using a service like Atlas)
  • FFMPEG (Optional, used for video thumbnails)
  • build-essential package (If using linux)

Setup (Non Docker Method):

Install Node Modules

npm install

Create Environment Variables:

You can find enviroment variable examples under:

backend/config -> Backend Enviroment Variables
src/config -> Frontend Enviroment Variables

Simply remove the .example from the end of the filename, and fill in the values.
Note: In most cases you will only have to change FE enviroment variables for development purposes.

Run the build command

npm run build

Start the server

npm run start

Possible installation issues

Make issue

npm error gyp ERR! stack Error: not found: make

This is because you do not have the build essentials installed which is required for Linux. You can install them by running the following command:

sudo apt-get install build-essential

Memory issue

Aborted (core dumped)

When running the npm run build command it may take more memory than node allows by default. You will get the above error in such a case. To fix this, you can run the following command instead when building:

NODE_OPTIONS="--max-old-space-size=4096" npm run build

You can read more about this issue here.

📸 Screenshots

Modern and colorful design MyDrive Design

Upload Files MyDrive Upload

Download Files MyDrive Upload

Image Viewer Image Viewer

Video Viewer Video Viewer

Media Gallery Search

Share Files Share

Search For Files/Folders Search

Move File/Folders Move

Multi-select Multi-select

Custom context menu Context menu

Trash Trash

🎥 Video

I created a short YouTube video, showing off myDrives design and features:

myDrive 4 (open source Google Drive alternative) - UI and feature overview

🕹️ Live demo

Demo

Note: Creating, deleting and other features are disabled in the demo. Also the service worker is not enabled in the demo, images thumbnails are not cached because of this.

Also this is just a 512mb RAM droplet go easy on her.

👾 Bug reports and feature requests

Please only open issues for actual bugs, feature requests or discussions should happen in Discussions or via my email.

Contact Email: kyle.hoell@gmail.com

⬆️ Updating from a previous version of myDrive

If you are upgrading from myDrive 3 there is some data migration and scripts you must run for myDrive 4 to work properly.

Run the migration script

Note: Make sure you have env variables set

npm run migrate-to-mydrive4

Also, if you are updating from myDrive 3, or if you did not have video thumbnails enabled and would like to enable them now you can do so by running the following command:

Note: Make sure you have video thumbnails enabled in your env variables and FFMPEG installed.

npm run create-video-thumbnails

🔮 Known issues and future improvments

Issues

  • The docker compose command is currently setup incorrectly since it requires npm to be installed, I am working on a fix for this. (Top priority)
  • Video streaming does not always work, especially on Safari.
  • PWA downloads does not work on iOS (This may be a current iOS limitation and not a myDrive issue).
  • Upload folder will sometimes fail on complex folder structures.
  • Generating video thumbnails with the default method will often fail, requiring the whole file to be downloaded to temporary storage and then the thumbnail generated from that.

Future improvments

  • Docker image (Top priority)
  • OIDC Support (Top priority)
  • Option to disable encryption
  • File sync from a local device
  • An alternative to using mongoDB
  • Dark mode
  • Enhance service worker, currently only caches thumbnails. This includes potentially adding offline support.
  • Typescript type cleanup
  • Better error handling
  • Logging
  • More test coverage (currently only basic backend tests)
  • Some tailwind classes still need some slight tweaking

Extension points exported contracts — how you extend this code

IStorageActions (Interface)
(no doc) [4 implementers]
backend/services/chunk-service/store-types.ts
RequestTypeRefresh (Interface)
(no doc)
backend/controllers/user-controller.ts
FolderListQueryType (Interface)
(no doc)
backend/types/folder-types.ts
SortBy (Interface)
(no doc)
backend/utils/sortBySwitchFolder.ts
RequestType (Interface)
(no doc)
backend/middleware/authRefresh.ts
UserInterface (Interface)
(no doc)
backend/models/user-model.ts
UserType (Interface)
(no doc)
src/types/user.ts
UserStateType (Interface)
(no doc)
src/reducers/user.ts

Core symbols most depended-on inside this repo

createReadStream
called by 16
backend/services/chunk-service/store-types.ts
createGenericParams
called by 15
backend/services/chunk-service/utils/storageHelper.ts
useUtils
called by 15
src/hooks/utils.ts
getBackendURL
called by 11
src/utils/getBackendURL.ts
getFileExtension
called by 10
src/utils/files.ts
getEnvVariables
called by 9
serverUtils/getEnvVaribables.js
getFSStoragePath
called by 9
backend/utils/getFSStoragePath.ts
getStorageActions
called by 9
backend/services/chunk-service/actions/helper-actions.ts

Shape

Function 415
Interface 49
Class 48
Method 38

Languages

TypeScript100%

Modules by API surface

src/api/filesAPI.ts22 symbols
src/api/userAPI.ts13 symbols
src/api/foldersAPI.ts12 symbols
src/hooks/actions.ts10 symbols
src/popups/file.ts9 symbols
src/components/SharePopup/SharePopup.tsx8 symbols
src/components/PhotoViewerPopup/PhotoViewerPopup.tsx8 symbols
src/components/MoverPopup/MoverPopup.tsx8 symbols
src/components/AddNewDropdown/AddNewDropdown.tsx8 symbols
serverUtils/changeEncryptionPassword.js8 symbols
src/hooks/contextMenu.ts7 symbols
serverUtils/removeOldSubscriptionData.js7 symbols

Dependencies from manifests, versioned

@babel/core7.8.4 · 1×
@babel/parser7.9.4 · 1×
@babel/plugin-proposal-class-properties7.8.3 · 1×
@babel/plugin-proposal-object-rest-spread7.8.3 · 1×
@babel/polyfill7.12.1 · 1×
@babel/preset-env7.8.4 · 1×
@babel/preset-react7.8.3 · 1×
@babel/types7.9.5 · 1×
@eslint/js9.6.0 · 1×
@reduxjs/toolkit2.2.5 · 1×
@types/archiver6.0.3 · 1×
@types/async3.2.24 · 1×

Datastores touched

fs.filesCollection · 1 repos
FolderCollection · 1 repos
UserCollection · 1 repos
FileSystemCollection · 1 repos
ThumbnailCollection · 1 repos
(mongodb)Database · 1 repos
mydriveDatabase · 1 repos
personal-driveDatabase · 1 repos

For agents

$ claude mcp add myDrive \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact