用内核原生 selector 持久化替代 web_save (cache.db cp 同步)#1298
Open
abcfy2 wants to merge 1 commit into
Open
Conversation
启用 mihomo profile.store-selected 与 singbox cache_file, cache.db 运行于 tmpfs(bbolt 依赖 mmap, 持久分区 jffs2/ubifs 不支持): - mihomo cache.db 路径不可配(-d $BINDIR), bfstart 启动前软链 $BINDIR/cache.db 到 $TMPDIR; 小内存模式($BINDIR=$TMPDIR)守卫跳过防自指 - singbox 直接 cache_file.path 指向 $TMPDIR/cache.db web_save/web_restore 保留原函数名与 hook 位置(向后兼容旧 crontab), 内部改为 cache.db cp 同步: - start.sh stop 调 web_save 备份(kill 前) - bfstart 调 web_restore 启动前恢复(仅 tmpfs 无时恢复, 防覆盖更新) - task 106 web_save_auto 每10分钟定时备份 - 小内存模式 web_save 守卫跳过(与软链守卫一致) 解决面板配置丢失类 issue juewuy#1264 juewuy#1276 juewuy#998。 close juewuy#1296
b24c926 to
d33eda9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #1296
启用内核原生选择持久化,替代 web_save 的 API 拉取 + 回推:
profile.store-selectedcache_filecache.db 跑 tmpfs(bbolt 需 mmap,持久分区 jffs2/ubifs 不支持
MAP_SHARED):cache_file.path直指$TMPDIR/cache.db-d $BINDIR),bfstart启动前软链$BINDIR/cache.db→ tmpfs;小内存模式($BINDIR=$TMPDIR)守卫跳过防自指备份/恢复用 cache.db cp 同步,保留
web_save/web_restore函数名与 hook(向后兼容旧 crontab):stop →web_save备份,bfstart→web_restore启动前恢复,task 106 每10分钟定时备份。选择持久化交给内核自己存(bbolt),不再依赖外部脚本拉 API 解析回推——根除 web_save 解析比对 bug(#1264 / #1276 / #998 配置丢失的根因)。
已知问题
configs/web_save被废弃,更新之后会造成上一次配置丢失,未来改为内核自己的配置保存方案。所以更新之后第一次需要重新保存一次面板配置