2023-03-08
The personal life deeply lived always expands into truths beyond itself. — Anaïs Nin
小米路由器3 刷open-wrt
相关链接:
- https://blog.csdn.net/adingge/article/details/125362140
- https://downloads.x-wrt.com/rom/
- https://schaepher.github.io/2019/10/12/xiaomi-router-r3-openwrt/
- https://blog.kidhero.club/p/%E5%B0%8F%E7%B1%B3%E8%B7%AF%E7%94%B1%E5%99%A83%E5%88%B7%E6%9C%BA%E8%AE%B0%E5%BD%95/
- https://openwrt.org/toh/xiaomi/mir3#get_sshdropbear_access
- https://www.awaimai.com/2852.html
路由器文件共享(Webdav)
使用lighttpd的webdav插件,运行在X-wrt上,在局域网内就可以直接启用webdav共享。相关链接:
LuCI on lighttpd
OpenWrt默认使用uhttpd作为luci的webserver,无奈其不支持webdav,因此换成了lighttpd. 如此一来,luci也要跑在lighttpd上,参考wiki.
内网https配置
在配置完webdav之后,原想通过Android APP FolderSync进行手机数据的同步。不成想他竟然不支持http,强制要求server端为https.
于是参考,
- Don’t forget about encryption!
- Secure HTTP
- Setting up a simple SSL configuration with a self-signed certificate 将局域网内的webdav server设为https.
First, go into your SSL Certificates directory and do:
cd /etc/lighttpd/certs
openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes
chmod 400 lighttpd.pem
If lighttpd starts are root — the default in many service configs — then the certificate can be owned by root with permissions 0400, as lighttpd reads the certificates before dropping privileges to www-data (or other account, depending on the distro config).
Then edit /etc/lighttpd/lighttpd.conf and add:
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/certs/lighttpd.pem"
}
After restarting the webserver, you should be able to access your webserver through https.
如何生成自签名证书: https://devopscube.com/create-self-signed-certificates-openssl/ ,仅限局域网使用。
Ksmbd文件共享
增加用户,配置密码的方式:root登陆openwrt,执行
ksmbd.adduser -a <username> -p <password>
see: https://github.com/stupidloud/nanopi-openwrt/issues/479#issuecomment-811889064