Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Local secrets / env
.env
**/.env

# Git / editor / OS
.git
.gitignore
.gitattributes
**/.DS_Store

# IDE / dev containers
.vscode/
.devcontainer/

# Python virtualenvs & caches
.venv/
**/.venv/
**/venv/
**/__pycache__/
**/.mypy_cache/
**/.pytest_cache/
**/.ruff_cache/

# Node caches
**/node_modules/
**/.npm/
**/.vite/

# CI / metadata not needed in image
.github/

# Mock & test data (requested)
romm_mock/
**/romm_mock/
backend/tests/
**/romm_test/

# Local-only docker compose files/examples (not needed in image)
docker-compose.yml
examples/

# Local tools / docs not required for runtime
**/*.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
DEVELOPER_SETUP.md
SECURITY.md

# Note: we intentionally do NOT ignore `docker/` because `docker/Dockerfile`
# copies init scripts and nginx/gunicorn configs from that folder.
9 changes: 9 additions & 0 deletions backend/endpoints/sockets/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ async def _identify_rom(
scan_type: ScanType,
roms_ids: list[int],
metadata_sources: list[str],
launchbox_remote_enabled: bool,
socket_manager: socketio.AsyncRedisManager,
scan_stats: ScanStats,
calculate_hashes: bool = True,
Expand Down Expand Up @@ -319,6 +320,7 @@ async def _identify_rom(
fs_rom=fs_rom,
metadata_sources=metadata_sources,
newly_added=newly_added,
launchbox_remote_enabled=launchbox_remote_enabled,
socket_manager=socket_manager,
)

Expand Down Expand Up @@ -457,6 +459,7 @@ async def _identify_platform(
fs_platforms: list[str],
roms_ids: list[int],
metadata_sources: list[str],
launchbox_remote_enabled: bool,
socket_manager: socketio.AsyncRedisManager,
scan_stats: ScanStats,
calculate_hashes: bool = True,
Expand Down Expand Up @@ -547,6 +550,7 @@ async def scan_rom_with_semaphore(fs_rom: FSRom, rom: Rom | None) -> None:
scan_type=scan_type,
roms_ids=roms_ids,
metadata_sources=metadata_sources,
launchbox_remote_enabled=launchbox_remote_enabled,
socket_manager=socket_manager,
scan_stats=scan_stats,
calculate_hashes=calculate_hashes,
Expand Down Expand Up @@ -597,6 +601,7 @@ async def scan_platforms(
metadata_sources: list[str],
scan_type: ScanType = ScanType.QUICK,
roms_ids: list[int] | None = None,
launchbox_remote_enabled: bool = True,
) -> ScanStats:
"""Scan all the listed platforms and fetch metadata from different sources

Expand Down Expand Up @@ -671,6 +676,7 @@ async def stop_scan():
fs_platforms=fs_platforms,
roms_ids=roms_ids,
metadata_sources=metadata_sources,
launchbox_remote_enabled=launchbox_remote_enabled,
socket_manager=socket_manager,
scan_stats=scan_stats,
calculate_hashes=calculate_hashes,
Expand Down Expand Up @@ -710,13 +716,15 @@ async def scan_handler(_sid: str, options: dict[str, Any]):
scan_type = ScanType[options.get("type", "quick").upper()]
roms_ids = options.get("roms_ids", [])
metadata_sources = options.get("apis", [])
launchbox_remote_enabled = bool(options.get("launchbox_remote_enabled", True))

if DEV_MODE:
return await scan_platforms(
platform_ids=platform_ids,
metadata_sources=metadata_sources,
scan_type=scan_type,
roms_ids=roms_ids,
launchbox_remote_enabled=launchbox_remote_enabled,
)

return high_prio_queue.enqueue(
Expand All @@ -725,6 +733,7 @@ async def scan_handler(_sid: str, options: dict[str, Any]):
metadata_sources=metadata_sources,
scan_type=scan_type,
roms_ids=roms_ids,
launchbox_remote_enabled=launchbox_remote_enabled,
job_timeout=SCAN_TIMEOUT, # Timeout (default of 4 hours)
result_ttl=TASK_RESULT_TTL,
meta={
Expand Down
Loading