Fix authenticated writes behind fnOS gateway and record completed backup

这个提交包含在:
mac 于 2026-11-11 23:22:22 +08:00 提交
1 父节点 12df14ebf0
当前提交 1827628a93
8 个文件已更改
+80 -11

没有与搜索条件相匹配的文件

+4 -3
查看文件
@@ -13,10 +13,11 @@ import sys
def main():
config = json.loads(Path(sys.argv[1]).read_text())
uid, gid = config.get('uid', 1000), config.get('gid', 1001)
source = Path(config['mount']) / config['source_root']
destination = Path(sys.argv[2])
destination.mkdir(mode=0o700)
os.chown(destination, 1000, 1001)
os.chown(destination, uid, gid)
count = collections.Counter()
entries = 0
output = destination / 'extended-attributes.jsonl'
@@ -40,7 +41,7 @@ def main():
entries += 1
stream.flush()
os.fsync(stream.fileno())
os.chown(output, 1000, 1001)
os.chown(output, uid, gid)
summary = {'entries': entries, 'attribute_names': dict(count), 'bytes': output.stat().st_size,
'resource_fork_attributes': count['com.apple.ResourceFork']}
(destination / 'README.txt').write_text(
@@ -48,7 +49,7 @@ def main():
'extended-attributes.jsonl 每行记录相对路径与 Base64 编码的原始属性。\n'
'包含用户标签、Finder 信息和机器相关安全元数据,请随剪辑备份私下保管,不上传源码仓库。\n'
'普通文件已由 rsync 复制;还原至 Mac 时应按需使用这些属性,不要盲目重放机器相关属性。\n')
os.chown(destination / 'README.txt', 1000, 1001)
os.chown(destination / 'README.txt', uid, gid)
print(json.dumps(summary, ensure_ascii=False))