Merge claude/1
This commit is contained in:
commit
12a9fe48ff
@ -13,7 +13,6 @@ webuiGenerateBackupMigrate()
|
||||
{
|
||||
local output_dir="$containers_dir/libreportal/frontend/data/backup/generated"
|
||||
local output_file="$output_dir/migrate.json"
|
||||
local temp_file="${output_file}.tmp.$$"
|
||||
|
||||
runFileOp mkdir -p "$output_dir"
|
||||
|
||||
@ -122,13 +121,15 @@ webuiGenerateBackupMigrate()
|
||||
locations_json+="]"
|
||||
|
||||
# --- Write atomically ----------------------------------------------------
|
||||
cat > "$temp_file" <<EOF
|
||||
# Pipe through runFileWrite (routes the write via the dockerinstall user
|
||||
# that owns the data/ tree) — the previous `cat > "$temp_file"` redirect
|
||||
# failed because the manager can't open paths under $containers_dir.
|
||||
runFileWrite "$output_file" <<EOF
|
||||
{
|
||||
"generated_at": "$generated_at",
|
||||
"destination": $destination_json,
|
||||
"locations": $locations_json
|
||||
}
|
||||
EOF
|
||||
runFileOp mv "$temp_file" "$output_file"
|
||||
runFileOp chmod 644 "$output_file" 2>/dev/null || true
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ webuiGeneratePeers()
|
||||
{
|
||||
local output_dir="$containers_dir/libreportal/frontend/data/peers/generated"
|
||||
local output_file="$output_dir/peers.json"
|
||||
local temp_file="${output_file}.tmp.$$"
|
||||
|
||||
runFileOp mkdir -p "$output_dir"
|
||||
|
||||
@ -20,12 +19,15 @@ webuiGeneratePeers()
|
||||
peers=$(peerList 2>/dev/null)
|
||||
[[ -z "$peers" ]] && peers='[]'
|
||||
|
||||
cat > "$temp_file" <<EOF
|
||||
# Pipe the JSON straight through runFileWrite — the previous
|
||||
# `cat > "$temp_file"` redirect failed because $temp_file sits in the
|
||||
# dockerinstall-owned data/ tree and the manager can't open it for write.
|
||||
# The mv that followed then errored with "No such file or directory".
|
||||
runFileWrite "$output_file" <<EOF
|
||||
{
|
||||
"generated_at": "$generated_at",
|
||||
"peers": $peers
|
||||
}
|
||||
EOF
|
||||
runFileOp mv "$temp_file" "$output_file"
|
||||
runFileOp chmod 644 "$output_file" 2>/dev/null || true
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user