Skip to content

Windows-style personal cloud-drive with supporting online editing.

License

Notifications You must be signed in to change notification settings

leeyoshinari/OneDrive

Repository files navigation

OneDrive

Windows-style personal cloud-drive with supporting online editing.

中文文档

更多内容详见博客

Function

  • Create, Delete, Rename, Move, and Export folders
  • Upload, Download, Create, Delete, Move, Rename, and Share files
  • Supports OnlyOffice (Word, Excel, PowerPoint) online editing and multi-user collaborative editing
  • Supports online editing functions of txt, markdown, xmind, sheet, and document
  • Support online editing and running of python scripts
  • Support add desktop shortcuts for files
  • Support remote connection to Linux server
  • Music player, supports playing music from this cloud-drive (Server) and local (Client)
  • Karaoke, supports building your own song library
  • Integrate aria2, and support multiple download protocols such as HTTP, FTP, BitTorrent, etc.
  • Add game center, supports Snake, tetris games (plans to support more games in the future).
  • Supports multiple languages and supports configuration of multiple languages
  • Single sign-on, data of different users is completely isolated
  • Support PWA, it can be installed on the mobile
  • Multiple disks can be mounted arbitrarily

View detailed page style, Please click me.

Technology

  • Framework: FastApi
  • Database: SQLite3 or MySQL
  • Front-end: html + js + css

Deploy

1.Clone git clone https://github.com/leeyoshinari/OneDrive.git

2.cd OneDrive, and modify config.conf

3.Install third-party packages

pip3 install -r requirements.txt

4.Initialize the database and execute the following commands in sequence

aerich init -t settings.TORTOISE_ORM
aerich init-db

5.Install download tool aria2, running aria2c -v to verify whether the installation is successful.

6.Startup

sh startup.sh

7.Create user
In order to avoid malicious creation of users by others, the page does not open the entrance to create users. So, you can create a user in the API interface documentation, entering the swagger-ui page and finding the createUser interface.

http://IP:Port/配置文件中的prefix/swagger-ui

8.Configure and start nginx, the location configuration is as follows:
(1)Front-end configuration: The front-end file is in web, /OneDrive can be modified to any name you like.

location /OneDrive {
    alias /home/OneDrive/web/;
    index  index.html;
}

(2)Backend request: proxy_pass is the IP and port in config.conf, /mycloud must be the same as prefix in config.conf.

location /mycloud {
     proxy_pass  http://127.0.0.1:15200;
     proxy_set_header Host $proxy_host;
     proxy_set_header lang $http_lang;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header Upgrade $http_upgrade;
	 proxy_set_header Connection $proxy_connection;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

(3) In the http module, a mapping need to be add.

map $http_upgrade $proxy_connection {
    default upgrade;
    "" close;
}

(4)Swagger page

location /api/openapi {
    proxy_pass  http://127.0.0.1:15200;
}

Usually nginx will limit the size of the request body, and you need to add client_max_body_size 4096M; to nginx.conf. There are other configurations, you can search for information and modify them online by yourself.

If you don’t know nginx, please go to nginx official website to download nginx and install it. After the installation is completed, replace the installed nginx.conf with the nginx.conf in this project, and then restart nginx.

9.Page, the url is http://IP:Port/OneDrive (the IP and port are the IP and port set in Nginx. OneDrive is the name of the front-end configuration in step 7)

10.If you want to import existing files on the current server into the system, you can access the background api interface page and find the file/import interface. The request parameters are the absolute path of the folder to be imported and the Id of the target catalog.

11.If you need to configure multiple languages, Please click me.

12.If you want to know more, Please click me.

Others

1.Supports multiple platforms such as Linux, Windows, MacOS, etc. It is recommended to deploy on Linux.

2.Cluster deployment and distributed storage are not supported. If you need cluster deployment and distributed storage, Please click me.

3.The path of the background image of the login page is web/img/pictures/undefined/background.jpg. If you need to modify the login background image, you can directly replace this image. Note: the image name must be background.jpg.

4.The background image of the desktop is the same as the background image of the login page by default. If you need to modify it, you can upload it in Setting->Personalized->Set background image. After the upload is successful, clear the cache and refresh the page. Note: The image format must be jpg.

5.Playing videos online uses streaming playback, which requires that the metadata of the video must be at the front of the video file. So, you need to manually move the metadata of the video to the front of the video file. Using the ffmpeg to move the metadata of the video. The command: ffmpeg -i input_video.mp4 -map_metadata 0 -c:v copy -c:a copy -movflags +faststart output_video.mp4.

6.Whether you are using a PC browser or a mobile browser, setting the browser to display in full screen will provide a better user experience.

Thanks

Thanks to the following projects

About

Windows-style personal cloud-drive with supporting online editing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published