Code Monkey home page Code Monkey logo

aliyundrive-webdav-router-install's Introduction

aliyundrive-webdav-router-install 一键自动安装脚本

One-click setup Aliyun-drive webdav service on your wireless router that have installed Padavan or other firmware based on linux kernel.

Optional setup: Mount webdav as filesytem and sharing with SAMBA (linux kernel module fuse is required and setup fusermount, webdavfs - recommended or davfs2

在路由器上一键安装阿里云盘webdav服务(路由器需要刷Padavan或OpenWRT等基于linux内核的固件)

可选安装:阿里云盘挂载和SAMBA共享 (需要linux内核集成fuse,并安装fusermount, webdavfs - 推荐davfs2

Aliyun drive

Quick setup webdav serivce [快速安装]

以Pdavan路由为例:下载aliyundrive_install.sh 到路径/etc/storage/

在ssh控制台运行下面命令:

cd /etc/storage && chmod +x aliyundrive_install.sh && ./aliyundrive_install.sh [refresh token]

点我获取refresh token

Please copy ./aliyundrive_install.sh to /etc/storage/ or anywhere you like then copy / run the following command as follows to finish the installation.

chmod +x /etc/storage/aliyundrive_install.sh &&
/etc/storage/aliyundrive_install.sh [refresh_token] [platform]

[refresh_token] is required that you extracted from web browser on aliyundrive.com

[platform] is optional by default is mipsel (联发科soc), the valid platform can be in [aarch64, arm, arm5te, armv7, mips, mipsel, x86_64] 如果你的路由器是 Intel soc, 选x86_64; 如果你的路由器是 ARM soc, 选arm | arm5te | armv7

Now, the main script aliyundrive_install.sh will launch aliyundrive-webdav with specific parameters, the webdav service works on http://admin:[email protected]:8080

For Padavan, you would like to run the following extra command to permanently save the script, you will be able to rerun the script once you encounter any throuble~

/sbin/mtd_storage.sh save

How to fetch refresh token

点我查看获取refresh token

Optional setup (only support MIPS little endian arch.)

Please copy ./mount_aliyun.sh' to the same directory with ./aliyundrive_install.shthen changemount_aliyun.sh' with executable permission:

chmod +x ./mount_aliyun.sh

When running the following command, it will auto-install and mount the webdav service http://admin:[email protected]:8080 into local directory /mnt/aliyun

/etc/storage/aliyundrive_install.sh [refresh_token] [platform]

Now, you can access AliCloud storage more easily at local disk. Furthermore, you can share the directory /mnt/aliyun with other network devices in same sub-network, this can be finished by SAMBA , you simply copy smb.conf start_samba.sh to somewhere, then change start_samba.conf with executable permission and execute it to setup SAMBA share service.

chmod +x ./start_samba.sh && ./start_samba.sh

Uninstall [卸载]

/etc/storage/aliyundrive_install.sh uninstall

Performance [性能]

There are two special parameters that you would like to tweak in the script, please find the codes as follows:

--read-buffer-size 1048576 --upload-buffer-size 1048576

if your router owns plenty of memory more than 256MB , you should remove the two parameters or increase the buffer size in bytes. otherwise, please keep it at the fixed buffer size at 1MB, this will avoid crashing with error memory allocation failed.

Development story

k2p is a router branding by phicomm (this company has bankrapted for years for some reasons ), the router is able to flash custom firmware that will increases a great performance on wireless connection. I was going to deploy the AliyunDrive on it using 'WebDav' protocol , but the router has lower memory at 128M RAM, and 16M flash memory only! due to the low flash memory, I couldn't put the binary in the flash memory then launch it, But it's able to run the binary from the 128M RAM!! Finally, I've created the main script aliyundrive_install.sh that successfully setup / run aliyundrive-webdav from RAM .

Reference

aliyundrive-webdav https://github.com/messense/aliyundrive-webdav

webdavfs https://github.com/simonchen/webdavfs

libfuse https://github.com/simonchen/libfuse

davfs2 https://github.com/simonchen/davfs2

aliyundrive-webdav-router-install's People

Contributors

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