Skip to content

Add Dockerfile for Alpine #31

Merged
matteius merged 3 commits intoopensensor:mainfrom
gponick:feature/add-alpine-docker
Mar 25, 2025
Merged

Add Dockerfile for Alpine #31
matteius merged 3 commits intoopensensor:mainfrom
gponick:feature/add-alpine-docker

Conversation

@gponick
Copy link
Copy Markdown
Contributor

@gponick gponick commented Mar 25, 2025

What this PR Does

  • Adds a Dockerfile.alpine that builds an Alpine build
  • Updates install.sh with "2" (really 4) new flags: --without-systemd and --without-ldconfig since Alpine build doesn't need either of these

Testing

Confirmed Live View and Recordings work

Results

$ docker images -a | grep lightnvr
lightnvr                               alpine-latest   d325746afb00   3 hours ago     115MB
lightnvr                               latest          a725290b902a   32 hours ago    506MB

Nice 75% or so reduction in size.

@matteius matteius merged commit 7a38ff4 into opensensor:main Mar 25, 2025
matteius added a commit that referenced this pull request Feb 21, 2026
…printf overflow, TOCTOU, command injection)

Fix #39 (stream_protocol.c:510): remove redundant null check after validated pointer

Fix #16 (sqlite_migrate.c:700): validate migration file path is within configured migrations
directory before executing SQL to prevent SQL injection via crafted migration files

Fix #40-41 (db_query_builder.c:83,88): add snprintf truncation checks with error return
Fix #42-43 (db_zones.c:31,33): add snprintf truncation checks in polygon_to_json()
Fix #44-45 (go2rtc_api.c:376,378): fix buffer size mismatch and add truncation checks

Fix #25 (daemon.c:266): replace chmod(path) with fchmod(fd) to eliminate TOCTOU
Fix #26 (db_backup.c:110): remove stat() check before fopen(); attempt directly
Fix #28 (storage_manager.c:225): remove stat() check before unlink() in delete_recording()
Fix #27 (storage_manager.c:460): use lstat() instead of stat() to prevent symlink following
Fix #29 (ffmpeg_utils.c:416): use lstat() and skip chmod on symlinks
Fix #32,#33 (hls_directory.c:84,96): replace chmod() with fd-based fchmod() via O_DIRECTORY
Fix #30,#31 (hls_directory.c:439,476): use lstat() + S_ISREG check before unlink
Fix #34 (hls_writer.c:457): replace chmod() with fd-based fchmod() via O_DIRECTORY
Fix #38,#35,#37 (api_handlers_recordings_backend_agnostic.c:249,338,474): remove
  stat() checks before unlink(); rely on errno==ENOENT for missing-file detection
Fix #36 (api_handlers_recordings_files_backend_agnostic.c:119): remove stat() before
  unlink(); derive 'existed' from unlink() result and errno

Command injection mitigations (already present, confirmed complete):
- api_handlers_system.c: get_directory_size() replaces all popen("du ...") calls
- api_handlers_settings.c: is_safe_storage_path() validates storage_path inputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants