安卓搭建webdav服务器

404 阅读1分钟

webdav

webdav安装

环境要求

  • termux
  • node.js 环境安装
apt upgrade && apt update

nodejs安装

apt install nodejs
// 安装后换源,方便后续的安装快慢
npm config set registry https://registry.npm.taobao.org

安装

npm install --prefix ./ -g webdav-cli

快速开始

webdav-cli --path ./webdav --username hajimi --password 123456 --autoIndex true --port 6666

运行

参考webdav-cli文档:github.com/svtslv/webd…

    'usage: webdav-cli [options]',
    '',
    'options:',
    '  --path       Path to folder [process.cwd()]',
    '  --host       Host to use [127.0.0.1]',
    '  --port       Port to use [1900]',
    '  --digest     Enable digest authentication [basic]',
    '  --username   Username for basic/digest authentication [random]',
    '  --password   Password for basic/digest authentication [random]',
    '  --directory  Show directory listings [false]',
    '  --autoIndex  Display autoIndex [false]',
    '  --ssl        Enable https [false]',
    '  --sslKey     Path to ssl key file [self-signed]',
    '  --sslCert    Path to ssl cert file [self-signed]',
    '  --help       Print this list and exit',
    '  --version    Print the version and exit.',
    '  --rights     Comma separated values without spaces [all]', `
        'all', 'canCreate', 'canDelete', 'canMove', 'canRename', 
        'canAppend', 'canWrite', 'canRead', 'canSource', 
        'canGetMimeType', 'canGetSize', 'canListLocks', 
        'canSetLock', 'canRemoveLock', 'canGetAvailableLocks', 
        'canGetLock', 'canAddChild', 'canRemoveChild', 
        'canGetChildren', 'canSetProperty', 'canGetProperty', 
        'canGetProperties', 'canRemoveProperty', 'canGetCreationDate', 
        'canGetLastModifiedDate', 'canGetWebName', 'canGetType'`,
    'env:',
    '  WEBDAV_CLI_PATH, WEBDAV_CLI_HOST, WEBDAV_CLI_PORT,',
    '  WEBDAV_CLI_USERNAME, WEBDAV_CLI_PASSWORD, WEBDAV_CLI_DIGEST,',
    '  WEBDAV_CLI_SSL, WEBDAV_CLI_SSL_KEY, WEBDAV_CLI_SSL_CERT,',
    '  WEBDAV_CLI_DIRECTORY, WEBDAV_CLI_AUTO_INDEX, WEBDAV_CLI_RIGHTS',
    '  WEBDAV_CLI_DISABLE_AUTHENTICATION',