Compare commits

..

2 Commits

Author SHA1 Message Date
MickLesk
112f3cc4eb romm: make the library paths follow ROMM_BASE_PATH
Upstream derives everything from one setting:

  ROMM_BASE_PATH = _get_env("ROMM_BASE_PATH", "/romm")
  LIBRARY_BASE_PATH = f"{ROMM_BASE_PATH}/library"

There is no separate library setting; config.yml's roms_folder is only
a folder name inside the library. So ROMM_BASE_PATH in /opt/romm/.env
is the single lever, and everything that names a path has to follow it.

Two places did not. The watcher unit had /var/lib/romm/library written
into ExecStart, so a moved library was still watched at the default and
rescans never fired. It now uses ${ROMM_BASE_PATH}/library, which
systemd expands from the EnvironmentFile the unit already loads.

The Angie alias was derived from the env file, but only while the
install or an update ran. Editing ROMM_BASE_PATH afterwards left the
internal /library/ location pointing at the old path, and since the
backend serves content through X-Accel-Redirect, every download and
every play returned 404 while scanning and metadata kept working.
Re-sync it from an ExecStartPre on angie, so a restart is enough.

Update installs both for existing containers and rewrites the watcher
unit in place.

Reported in #17263. The suggested fix there was to template the alias,
which the scripts already did; the gap was that nothing re-applied it.
2026-09-15 10:19:50 +02:00
community-scripts-pr-app[bot]
05dc593f99 Update CHANGELOG.md (#17274)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-15 07:53:02 +00:00
5 changed files with 80 additions and 39 deletions

View File

@@ -556,6 +556,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- tracearr: copy packages/emails into the deploy tree [@connorgallopo](https://github.com/connorgallopo) ([#17268](https://github.com/community-scripts/ProxmoxVE/pull/17268))
- Immich: Pin to v3.2.1 [@vhsdream](https://github.com/vhsdream) ([#17264](https://github.com/community-scripts/ProxmoxVE/pull/17264))
### 💾 Core
- Releases: rank releases on their numbers, not on sort -V over the raw tag [@MickLesk](https://github.com/MickLesk) ([core#39](https://github.com/community-scripts/core/pull/39))
### 🧰 Tools
- #### 🔧 Refactor

View File

@@ -10,8 +10,8 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
APP="Frigate"
var_tags="${var_tags:-nvr}"
var_cpu="${var_cpu:-8}"
var_ram="${var_ram:-6144}"
var_disk="${var_disk:-25}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-20}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_arm64="${var_arm64:-no}"

View File

@@ -191,11 +191,30 @@ EOF
sed -i -e "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" \
-e "s|alias .*/cache/;|alias ${ROMM_BASE}/cache/;|" /etc/angie/http.d/romm.conf
fi
cat <<'SYNCEOF' >/usr/local/bin/romm-sync-angie-paths
#!/usr/bin/env bash
base="$(grep -m1 '^ROMM_BASE_PATH=' /opt/romm/.env 2>/dev/null | cut -d= -f2)"
base="${base:-/var/lib/romm}"
[[ -f /etc/angie/http.d/romm.conf ]] || exit 0
sed -i -e "s|alias .*/library/;|alias ${base}/library/;|" \
-e "s|alias .*/cache/;|alias ${base}/cache/;|" /etc/angie/http.d/romm.conf
SYNCEOF
chmod +x /usr/local/bin/romm-sync-angie-paths
mkdir -p /etc/systemd/system/angie.service.d
cat <<'DROPEOF' >/etc/systemd/system/angie.service.d/romm-paths.conf
[Service]
ExecStartPre=/usr/local/bin/romm-sync-angie-paths
DROPEOF
systemctl daemon-reload
systemctl reload angie
elif [[ -f /etc/nginx/sites-available/romm ]]; then
sed -i "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" /etc/nginx/sites-available/romm
nginx_enable_site romm
fi
if [[ -f /etc/systemd/system/romm-watcher.service ]]; then
sed -i "s|\(watcher\.py' \).*|\1\${ROMM_BASE_PATH}/library|" /etc/systemd/system/romm-watcher.service
systemctl daemon-reload
fi
msg_ok "Updated ROMM"
msg_info "Starting Services"

View File

@@ -110,7 +110,7 @@ export AUTOGRAPH_VERBOSITY=0
export GLOG_minloglevel=3
export GLOG_logtostderr=0
fetch_and_deploy_gh_release "frigate" "blakeblackshear/frigate" "tarball" "v0.18.0" "/opt/frigate"
fetch_and_deploy_gh_release "frigate" "blakeblackshear/frigate" "tarball" "v0.17.2" "/opt/frigate"
msg_info "Building Nginx"
$STD bash /opt/frigate/docker/main/build_nginx.sh
@@ -122,18 +122,7 @@ msg_info "Building SQLite Extensions"
$STD bash /opt/frigate/docker/main/build_sqlite_vec.sh
msg_ok "Built SQLite Extensions"
if [[ "$(arch_resolve)" == "amd64" ]]; then
msg_info "Building Intel Media Driver (Patience)"
$STD bash /opt/frigate/docker/main/build_intel_media_driver.sh
cp -a /rootfs/. /
rm -rf /rootfs
rm -f /etc/apt/sources.list.d/intel-gpu-jammy.list /usr/share/keyrings/intel-graphics.gpg
$STD apt update
ldconfig
msg_ok "Built Intel Media Driver"
fi
fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "v1.9.14" "/usr/local/go2rtc/bin" "go2rtc_linux_$(arch_resolve)"
fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "latest" "/usr/local/go2rtc/bin" "go2rtc_linux_$(arch_resolve)"
msg_info "Installing Tempio"
sed -i 's|/rootfs/usr/local|/usr/local|g' /opt/frigate/docker/main/install_tempio.sh
@@ -205,7 +194,17 @@ if python3 /opt/frigate/docker/main/build_ov_model.py &>/dev/null; then
mkdir -p /openvino-model
cp /models/ssdlite_mobilenet_v2.xml /openvino-model/
cp /models/ssdlite_mobilenet_v2.bin /openvino-model/
curl_with_retry "https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/data/dataset_classes/coco_91cl_bkgr.txt" "/openvino-model/coco_91cl_bkgr.txt"
OV_LABELS=$(python3 -c "import omz_tools; import os; print(os.path.join(omz_tools.__path__[0], 'data/dataset_classes/coco_91cl_bkgr.txt'))" 2>/dev/null)
if [[ -n "$OV_LABELS" && -f "$OV_LABELS" ]]; then
ln -sf "$OV_LABELS" /openvino-model/coco_91cl_bkgr.txt
else
OV_LABELS=$(find /usr/local/lib -name "coco_91cl_bkgr.txt" 2>/dev/null | head -1)
if [[ -n "$OV_LABELS" ]]; then
ln -sf "$OV_LABELS" /openvino-model/coco_91cl_bkgr.txt
else
curl_with_retry "https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/data/dataset_classes/coco_91cl_bkgr.txt" "/openvino-model/coco_91cl_bkgr.txt"
fi
fi
sed -i 's/truck/car/g' /openvino-model/coco_91cl_bkgr.txt
msg_ok "Built OpenVino Model"
else
@@ -252,8 +251,8 @@ curl_download "/media/frigate/person-bicycle-car-detection.mp4" "https://github.
echo "tmpfs /tmp/cache tmpfs defaults 0 0" >>/etc/fstab
cat <<EOF >/etc/frigate.env
DEFAULT_FFMPEG_VERSION="8.0"
INCLUDED_FFMPEG_VERSIONS="8.0:7.0:5.0"
DEFAULT_FFMPEG_VERSION="7.0"
INCLUDED_FFMPEG_VERSIONS="7.0:5.0"
NVIDIA_VISIBLE_DEVICES=all
NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
TOKENIZERS_PARALLELISM=true
@@ -269,23 +268,6 @@ GLOG_minloglevel=3
GLOG_logtostderr=0
EOF
if grep -q -o -m1 -E 'avx[^ ]*|sse4_2' /proc/cpuinfo && [[ -f /openvino-model/ssdlite_mobilenet_v2.xml ]] && [[ -f /openvino-model/coco_91cl_bkgr.txt ]]; then
DETECTOR_CONFIG="detectors:
detector01:
type: openvino
device: AUTO
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt"
else
DETECTOR_CONFIG="model:
path: /models/cpu_model.tflite"
fi
cat <<EOF >/config/config.yml
mqtt:
enabled: false
@@ -305,10 +287,32 @@ auth:
enabled: false
detect:
enabled: false
EOF
if grep -q -o -m1 -E 'avx[^ ]*|sse4_2' /proc/cpuinfo && [[ -f /openvino-model/ssdlite_mobilenet_v2.xml ]] && [[ -f /openvino-model/coco_91cl_bkgr.txt ]]; then
cat <<EOF >/config/config.yml
ffmpeg:
hwaccel_args: auto
${DETECTOR_CONFIG}
detectors:
detector01:
type: openvino
device: AUTO
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
EOF
else
cat <<EOF >/config/config.yml
ffmpeg:
hwaccel_args: auto
model:
path: /models/cpu_model.tflite
EOF
fi
msg_ok "Configured Frigate"
msg_info "Creating Services"

View File

@@ -327,8 +327,22 @@ server {
}
EOF
sed -i -e "s|alias /var/lib/romm/library/;|alias ${ROMM_BASE}/library/;|" \
-e "s|alias /var/lib/romm/cache/;|alias ${ROMM_BASE}/cache/;|" /etc/angie/http.d/romm.conf
cat <<'SYNCEOF' >/usr/local/bin/romm-sync-angie-paths
#!/usr/bin/env bash
base="$(grep -m1 '^ROMM_BASE_PATH=' /opt/romm/.env 2>/dev/null | cut -d= -f2)"
base="${base:-/var/lib/romm}"
[[ -f /etc/angie/http.d/romm.conf ]] || exit 0
sed -i -e "s|alias .*/library/;|alias ${base}/library/;|" \
-e "s|alias .*/cache/;|alias ${base}/cache/;|" /etc/angie/http.d/romm.conf
SYNCEOF
chmod +x /usr/local/bin/romm-sync-angie-paths
mkdir -p /etc/systemd/system/angie.service.d
cat <<'EOF' >/etc/systemd/system/angie.service.d/romm-paths.conf
[Service]
ExecStartPre=/usr/local/bin/romm-sync-angie-paths
EOF
systemctl daemon-reload
/usr/local/bin/romm-sync-angie-paths
rm -f /etc/angie/http.d/default.conf
systemctl restart angie
systemctl enable -q --now angie
@@ -405,7 +419,7 @@ Type=simple
WorkingDirectory=/opt/romm/backend
EnvironmentFile=/opt/romm/.env
Environment="PYTHONPATH=/opt/romm/backend"
ExecStart=/opt/romm/.venv/bin/watchfiles --target-type command '/opt/romm/.venv/bin/python watcher.py' /var/lib/romm/library
ExecStart=/opt/romm/.venv/bin/watchfiles --target-type command '/opt/romm/.venv/bin/python watcher.py' \${ROMM_BASE_PATH}/library
Restart=on-failure
RestartSec=5