dashboard fixes
This commit is contained in:
parent
e0311f9d8f
commit
771b3f67c3
|
|
@ -218,10 +218,9 @@ func remotePathType(ctx context.Context, site store.Site, path string) (string,
|
|||
|
||||
func pullSQLiteTarget(ctx context.Context, jobID int64, site store.Site, target store.SiteTarget, stageDir string) error {
|
||||
tmpBase := fmt.Sprintf("/tmp/satoru-backup-%d-%s.sqlite3", jobID, shortHash(target.Path))
|
||||
quotedDB := shellQuote(target.Path)
|
||||
quotedTmp := shellQuote(tmpBase)
|
||||
remoteCmd := strings.Join([]string{
|
||||
sqliteBackupCommand(quotedDB, quotedTmp),
|
||||
sqliteBackupCommand(target.Path, quotedTmp),
|
||||
fmt.Sprintf("gzip -f -- %s", quotedTmp),
|
||||
}, " && ")
|
||||
if err := sshCheck(ctx, site, remoteCmd); err != nil {
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ func sqlitePreflightCheck(ctx context.Context, site store.Site, dbPath string) e
|
|||
"sqlite3 --version >/dev/null",
|
||||
"[ -r " + quoted + " ]",
|
||||
"tmp=$(mktemp /tmp/satoru-preflight.XXXXXX)",
|
||||
sqliteBackupCommand(quoted, "$tmp"),
|
||||
sqliteBackupCommand(dbPath, "$tmp"),
|
||||
"rm -f -- \"$tmp\"",
|
||||
}, " && ")
|
||||
return sshCheck(ctx, site, cmd)
|
||||
|
|
|
|||
|
|
@ -7,12 +7,13 @@ const (
|
|||
sqliteBackupTimeoutMS = 5000
|
||||
)
|
||||
|
||||
func sqliteBackupCommand(quotedDBPath, quotedBackupPath string) string {
|
||||
func sqliteBackupCommand(dbPath, quotedBackupPath string) string {
|
||||
readonlyURI := shellQuote("file:" + dbPath + "?mode=ro")
|
||||
return fmt.Sprintf(
|
||||
"ok=0; for i in $(seq 1 %d); do sqlite3 -cmd \".timeout %d\" %s \".backup %s\" && ok=1 && break; sleep 1; done; [ \"$ok\" -eq 1 ]",
|
||||
"ok=0; for i in $(seq 1 %d); do sqlite3 -readonly -cmd \".timeout %d\" %s \".backup %s\" && ok=1 && break; sleep 1; done; [ \"$ok\" -eq 1 ]",
|
||||
sqliteBackupRetryCount,
|
||||
sqliteBackupTimeoutMS,
|
||||
quotedDBPath,
|
||||
readonlyURI,
|
||||
quotedBackupPath,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ func Dashboard(data DashboardData) templ.Component {
|
|||
<div class="row split">
|
||||
<div>
|
||||
<p class="eyebrow">Satoru</p>
|
||||
<h1>Managed Sites Overview</h1>
|
||||
<h1>Manage Backups</h1>
|
||||
<p class="muted">Signed in as <strong>%s</strong> (%s).</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
|||
Loading…
Reference in New Issue