release: v1.3.0 — 整站备份恢复、跨后端同步与任务中心
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
This commit is contained in:
1 parent
b05d572221
commit
f17d79b236
72 files changed
+4312
-559
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { join } from 'node:path'
|
||||
import { getDataDir } from '../data-dir'
|
||||
|
||||
export const BACKUP_ARCHIVE_EXT = '.phost.tar.gz'
|
||||
|
||||
export function getBackupsDir(): string {
|
||||
return join(getDataDir(), 'backups')
|
||||
}
|
||||
|
||||
export function getBackupStagingDir(jobId: string): string {
|
||||
return join(getBackupsDir(), 'staging', jobId)
|
||||
}
|
||||
|
||||
export function isSafeBackupFilename(name: string): boolean {
|
||||
if (!name || name.includes('..') || name.includes('/') || name.includes('\\')) {
|
||||
return false
|
||||
}
|
||||
return name.endsWith(BACKUP_ARCHIVE_EXT)
|
||||
}
|
||||
Reference in new issue
Block a user