bisync: default to fail-closed safety flags
New Bisync jobs and scheduled RC bodies start with checkAccess, deltaList, recover, resilient, slowHashSyncOnly, conflictResolve=none, maxDelete=50, and checksum compare. Explicit outer values still win.
This commit is contained in:
@@ -1,3 +1,22 @@
|
||||
// Fail-closed bisync RC defaults (forked rclone). Explicit outer values override.
|
||||
export const BISYNC_SAFETY_DEFAULTS = {
|
||||
checkAccess: true,
|
||||
deltaList: true,
|
||||
recover: true,
|
||||
resilient: true,
|
||||
slowHashSyncOnly: true,
|
||||
conflictResolve: 'none',
|
||||
maxDelete: 50,
|
||||
compare: 'size,modtime,checksum',
|
||||
} as const
|
||||
|
||||
export const BISYNC_SAFETY_SWITCH_DEFAULTS: Record<string, boolean> = {
|
||||
checkAccess: true,
|
||||
deltaList: true,
|
||||
recover: true,
|
||||
resilient: true,
|
||||
}
|
||||
|
||||
export const RCLONE_CONFIG_DEFAULTS = {
|
||||
copy: {
|
||||
'multi_thread_cutoff': '64M',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { FlagValue } from '../../types/rclone'
|
||||
import { BISYNC_SAFETY_DEFAULTS } from './constants'
|
||||
import { getFsInfo } from '../format'
|
||||
|
||||
// Pure serialization of operation args into ready-to-POST rclone RC requests. This is the
|
||||
@@ -492,7 +493,10 @@ export function buildBisyncRequests(args: BisyncArgs): RcRequest[] {
|
||||
const { fullDirPath: srcFullDirPath, remoteName: srcRemoteName } = getFsInfo(source)
|
||||
const { fullDirPath: dstFullDirPath, remoteName: dstRemoteName } = getFsInfo(destination)
|
||||
|
||||
const outer = { ...(options.outer || {}) }
|
||||
const outer: Record<string, FlagValue> = {
|
||||
...BISYNC_SAFETY_DEFAULTS,
|
||||
...(options.outer || {}),
|
||||
}
|
||||
// Forked rclone: --delta-list refuses to run without --check-access unless --force.
|
||||
if (outer.deltaList && !outer.force) {
|
||||
outer.checkAccess = true
|
||||
|
||||
Reference in New Issue
Block a user