feat: add --enable-assets flag, disable assets by default, expose to frontend

Replace --disable-assets-autoscan with --enable-assets so the assets
system (API routes, database sync, background scanning) is off by
default and must be explicitly opted into. Expose the flag as an
"assets" entry in SERVER_FEATURE_FLAGS so the frontend can read it
from GET /features.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Luke Mino-Altherr
2026-02-26 20:55:50 -08:00
parent 13277d2658
commit 3232f48a41
6 changed files with 10 additions and 23 deletions

View File

@@ -359,10 +359,9 @@ def setup_database():
from app.database.db import init_db, dependencies_available
if dependencies_available():
init_db()
if args.disable_assets_autoscan:
asset_seeder.disable()
elif asset_seeder.start(roots=("models", "input", "output"), prune_first=True, compute_hashes=True):
logging.info("Background asset scan initiated for models, input, output")
if args.enable_assets:
if asset_seeder.start(roots=("models", "input", "output"), prune_first=True, compute_hashes=True):
logging.info("Background asset scan initiated for models, input, output")
except Exception as e:
logging.error(f"Failed to initialize database. Please ensure you have installed the latest requirements. If the error persists, please report this as in future the database will be required: {e}")