Auto-fix furni asset ownership after import
After each single or batch import, chown the swf/icon/nitro asset directories and the FurnitureData.json folders to www-data:www-data so nginx and the emulator can read newly written files. Best-effort and non-blocking; the API response reports which folders were fixed.
This commit is contained in:
1 parent
c95ad4a37f
commit
18825115a4
3 files changed
+53
-1
No files matched your search
@@ -17,6 +17,7 @@ import {
|
||||
deleteImportedItem,
|
||||
downloadFile,
|
||||
ensureDirectories,
|
||||
ensureFurniOwnership,
|
||||
IMPORTED_PAGE_CAPTION_SAVE,
|
||||
importSingleFurni,
|
||||
reconcileImportedOfferIds,
|
||||
@@ -407,6 +408,9 @@ export const POST = withAdmin(
|
||||
// Reconcile offer_id with the furnidata sprite id across the tree
|
||||
const reconciled = await reconcileImportedOfferIds();
|
||||
|
||||
// Keep asset + furnidata folders readable by the web server
|
||||
const ownership = await ensureFurniOwnership();
|
||||
|
||||
const succeeded = results.filter((r) => r.ok).length;
|
||||
const failed = results.filter((r) => !r.ok).length;
|
||||
|
||||
@@ -416,6 +420,7 @@ export const POST = withAdmin(
|
||||
failed,
|
||||
results,
|
||||
offerIdsFixed: reconciled.fixed,
|
||||
ownershipFixed: ownership.fixed,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -468,6 +473,9 @@ export const POST = withAdmin(
|
||||
// Reconcile offer_id with the furnidata sprite id across the tree
|
||||
const reconciled = await reconcileImportedOfferIds();
|
||||
|
||||
// Keep asset + furnidata folders readable by the web server
|
||||
const ownership = await ensureFurniOwnership();
|
||||
|
||||
logAudit({
|
||||
userId: ctx.session.user.id,
|
||||
action: "furni_import",
|
||||
@@ -489,6 +497,7 @@ export const POST = withAdmin(
|
||||
id: result.itemId,
|
||||
catalogItemId: result.catalogItemId,
|
||||
offerIdsFixed: reconciled.fixed,
|
||||
ownershipFixed: ownership.fixed,
|
||||
spriteCount: result.spriteCount,
|
||||
warnings: result.warnings,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user