Skip to content

配置

PixelFS 允许你修改一些配置,所有配置信息都存放在 $HOME/.pixelfs/config.toml 文件中。

注意

如果你是首次运行 PixelFS, 则会自动创建一个 config.toml 文件。

参数配置说明

参数名类型默认值说明
endpointstringhttps://www.pixelfs.io服务端地址
tokenstring-用户 TOKEN 信息
pwdstring-使用 pixelfs cd 切换的路径信息
debugboolfalse是否开启调试日志
daemon.listenstring0.0.0.0:15233daemon 服务监听的地址和端口
ffmpeg.cache.expireint86400ffmpeg 缓存时间(秒)
ffmpeg.cache.pathstring$HOME/.pixelfs/cache/ffmpegffmpeg 缓存路径
webdav.listenstring0.0.0.0:5233webdav 服务监听的地址和端口
webdav.cache.expireint86400webdav 缓存时间(秒)
webdav.cache.pathstring$HOME/.pixelfs/cache/webdavwebdav 缓存路径
webdav.cors.credentialsbool-是否支持跨域请求凭据(CORS)
webdav.cors.allow_originstring[]['*']允许的跨域请求来源
webdav.cors.allow_headersstring[]['*']允许的跨域请求头
webdav.cors.allow_methodsstring[]['*']允许的跨域请求方法
webdav.cors.expose_headersstring[]-可被客户端访问的响应头
webdav.cors.max_ageint-预检请求的最大缓存时间(秒)
webdav.users.usernamestring-webdav 服务用户名
webdav.users.passwordstring-webdav 服务密码
webdav.users.permissionsstring-webdav 用户权限,例如:CRUD

示例配置

toml
endpoint = 'https://www.pixelfs.io'
pwd = '/'
token = 'auth-token'

[daemon]
listen = '0.0.0.0:15233'

[ffmpeg]
[ffmpeg.cache]
expire = 86400
path = '$HOME/.pixelfs/cache/ffmpeg'

[webdav]
listen = '0.0.0.0:5233'

[webdav.cache]
expire = 86400
path = '$HOME/.pixelfs/cache/webdav'

[webdav.cors]
allow_headers = ['*']
allow_methods = ['*']
allow_origin = ['*']

[[webdav.users]]
username = 'admin'
password = '123456'
permissions = 'none'

[[webdav.users.rules]]
path = '/0x29e3abdb587207dc4ac9c708670eefde717ef307'
permissions = 'CRUD'

基于 GPL-3.0 许可发布