Skip to content

Commit e9d629b

Browse files
authored
Merge pull request #3134 from motioneye-project/dev
Beta 0.43.1b3
2 parents e096193 + c813b74 commit e9d629b

File tree

128 files changed

+6047
-2003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+6047
-2003
lines changed

.github/workflows/docker.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ permissions:
1212
jobs:
1313
docker:
1414
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
15-
# ToDo: Switch to Ubuntu Noble once runner host end cancellations are fixed: https://github.com/actions/runner-images/issues/9848#issuecomment-2137140734
16-
runs-on: ubuntu-22.04
15+
runs-on: ubuntu-24.04
1716

1817
permissions:
1918
packages: write
@@ -39,7 +38,8 @@ jobs:
3938
- name: Cache Docker layers
4039
uses: actions/cache@v4
4140
with:
42-
path: /tmp/.buildx-cache
41+
path: |
42+
${{ runner.temp }}/.buildx-cache
4343
key: ${{ runner.os }}-buildx-${{ github.sha }}
4444
restore-keys: |
4545
${{ runner.os }}-buildx-
@@ -60,21 +60,21 @@ jobs:
6060
password: ${{ github.token }}
6161

6262
- name: Build
63-
uses: docker/build-push-action@v5
63+
uses: docker/build-push-action@v6
6464
with:
6565
context: .
6666
file: ./docker/Dockerfile
67-
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
67+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/riscv64
6868
push: ${{ github.event_name == 'push' && github.repository == 'motioneye-project/motioneye' && steps.meta.outputs.tags != null }}
6969
tags: ${{ steps.meta.outputs.tags }}
7070
labels: ${{ steps.meta.outputs.labels }}
7171
#build-args: |
7272
# KEY1=Value1
7373
# KEY2=Value2
74-
cache-from: type=local,src=/tmp/.buildx-cache
75-
cache-to: type=local,dest=/tmp/.buildx-cache-new
74+
cache-from: type=local,src=${{ runner.temp }}/.buildx-cache
75+
cache-to: type=local,dest=${{ runner.temp }}/.buildx-cache-new
7676

7777
- name: Move cache
7878
run: |
79-
rm -rf /tmp/.buildx-cache
80-
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
79+
rm -rf ${{ runner.temp }}/.buildx-cache
80+
mv ${{ runner.temp }}/.buildx-cache-new ${{ runner.temp }}/.buildx-cache

.github/workflows/python_safety.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ jobs:
1414
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
1515
runs-on: ubuntu-24.04
1616
steps:
17-
- run: sudo apt-get -q update
18-
- run: sudo apt-get autopurge needrestart # https://github.com/actions/runner-images/pull/9956
1917
- run: echo -e '[global]\nbreak-system-packages=true' | sudo tee /etc/pip.conf # error: externally-managed-environment
20-
- run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends install
21-
gcc libcurl4-openssl-dev libssl-dev
2218
- uses: actions/checkout@v4
2319
- uses: actions/setup-python@v5
2420
with:
@@ -29,4 +25,5 @@ jobs:
2925
# Ignore CVE-2018-20225, which is IMO reasonably disputed: https://data.safetycli.com/v/67599/97c/
3026
# "extra"-index-url means an index to "additionally" look for newer versions, pre-compiled wheels, or similar, not to force this index being used.
3127
# There is "index-url" to enforce a different index: https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-i
32-
- run: safety check --ignore 67599
28+
# Ignore CVE-2019-8341 as well: https://github.com/pyupio/safety/issues/527
29+
- run: safety check --ignore 67599,70612

.github/workflows/test_python.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ jobs:
1616
matrix:
1717
include:
1818
# https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=python3
19-
- { dist: 'ubuntu-20.04', python: '3.8.2' }
2019
- { dist: 'ubuntu-22.04', python: '3.10.6' }
2120
- { dist: 'ubuntu-24.04', python: '3.12.3' }
21+
- { dist: 'ubuntu-22.04-arm', python: '3.10.6' }
22+
- { dist: 'ubuntu-24.04-arm', python: '3.12.3' }
2223
fail-fast: false
2324
runs-on: ${{ matrix.dist }}
2425
name: "Test on ${{ matrix.dist }}"
@@ -27,9 +28,10 @@ jobs:
2728
- uses: actions/setup-python@v5
2829
with:
2930
python-version: ${{ matrix.python }}
30-
- run: sudo apt-mark hold grub-efi-amd64-signed # GRUB does not always find the drive it was configured for
31+
- if: matrix.dist == 'ubuntu-22.04' || matrix.dist == 'ubuntu-24.04'
32+
run: sudo apt-mark hold grub-efi-amd64-signed # GRUB does not always find the drive it was configured for
3133
- name: Ubuntu Noble workarounds
32-
if: matrix.dist == 'ubuntu-24.04'
34+
if: matrix.dist == 'ubuntu-24.04' || matrix.dist == 'ubuntu-24.04-arm'
3335
run: |
3436
# https://github.com/actions/runner-images/pull/9956
3537
sudo apt-get autopurge needrestart

.github/workflows/ubuntu_build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,26 @@ jobs:
1313
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
1414
strategy:
1515
matrix:
16-
dist: ['ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04']
16+
dist: ['ubuntu-22.04', 'ubuntu-24.04', 'ubuntu-22.04-arm', 'ubuntu-24.04-arm']
1717
fail-fast: false
1818
runs-on: ${{ matrix.dist }}
1919
name: "Test on ${{ matrix.dist }}"
2020
steps:
21-
- run: sudo apt-mark hold grub-efi-amd64-signed # GRUB does not always find the drive it was configured for
21+
- if: matrix.dist == 'ubuntu-22.04' || matrix.dist == 'ubuntu-24.04'
22+
run: sudo apt-mark hold grub-efi-amd64-signed # GRUB does not always find the drive it was configured for
2223
- name: Ubuntu Noble workarounds
23-
if: matrix.dist == 'ubuntu-24.04'
24+
if: matrix.dist == 'ubuntu-24.04' || matrix.dist == 'ubuntu-24.04-arm'
2425
run: |
2526
# https://github.com/actions/runner-images/pull/9956
2627
# ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian.
27-
sudo apt-get autopurge needrestart python3-pip python3-setuptools python3-wheel
28+
# new firefox package pre-installation script subprocess returned error exit status 1
29+
sudo apt-get autopurge needrestart python3-pip python3-setuptools python3-wheel firefox
2830
# error: externally-managed-environment
2931
echo -e '[global]\nbreak-system-packages=true' | sudo tee /etc/pip.conf
3032
- run: sudo apt-get -q update
3133
- run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qq --no-install-recommends dist-upgrade
3234
- run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qq --no-install-recommends install
33-
ca-certificates curl gcc libcurl4-openssl-dev libssl-dev python3-dev
35+
ca-certificates curl python3-dev
3436
- run: curl -sSfO 'https://bootstrap.pypa.io/get-pip.py'
3537
- run: sudo python3 get-pip.py
3638
- run: sudo python3 -m pip install --upgrade pip setuptools wheel

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
repos:
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.6.0
12+
rev: v5.0.0
1313
hooks:
1414
- id: check-builtin-literals
1515
- id: check-executables-have-shebangs
@@ -20,23 +20,23 @@ repos:
2020
- id: mixed-line-ending
2121
- id: trailing-whitespace
2222
- repo: https://github.com/PyCQA/bandit
23-
rev: 1.7.8
23+
rev: 1.8.3
2424
hooks:
2525
- id: bandit
2626
args:
2727
- --skip=B104,B105,B108,B110,B301,B310,B321,B324,B402,B403,B404,B602,B603,B604,B605,B607,B701
2828
- repo: https://github.com/python/black
29-
rev: 24.4.2
29+
rev: 25.1.0
3030
hooks:
3131
- id: black
3232
args: [--skip-string-normalization]
3333
- repo: https://github.com/codespell-project/codespell
34-
rev: v2.3.0
34+
rev: v2.4.1
3535
hooks:
3636
- id: codespell
3737
# See args in setup.cfg
3838
- repo: https://github.com/PyCQA/flake8
39-
rev: 7.0.0
39+
rev: 7.2.0
4040
hooks:
4141
- id: flake8
4242
additional_dependencies: [flake8-2020, flake8-bugbear, flake8-comprehensions, flake8-return]
@@ -49,12 +49,12 @@ repos:
4949
- --show-source
5050
- --statistics
5151
- repo: https://github.com/timothycrosley/isort
52-
rev: 5.13.2
52+
rev: 6.0.1
5353
hooks:
5454
- id: isort
5555
args: ["--profile", "black", "--filter-files"]
5656
- repo: https://github.com/asottile/pyupgrade
57-
rev: v3.15.2
57+
rev: v3.19.1
5858
hooks:
5959
- id: pyupgrade
6060
args: [--py37-plus]

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ These install instructions are constantly tested via CI/CD pipeline on Debian Bu
1919

2020
_Here the commands for APT-based Linux distributions are given._
2121

22-
On **32-bit ARMv6 and ARMv7** systems, thanks to [piwheels](https://piwheels.org/), no development headers are required:
22+
Thanks to pre-compiled wheels from PyPI, installing motionEye usually does not require anything but Python 3 and cURL with the ability to do HTTPS network requests:
2323
```sh
2424
sudo apt update
25-
sudo apt --no-install-recommends install ca-certificates curl python3 python3-distutils
25+
sudo apt --no-install-recommends install ca-certificates curl python3
2626
```
2727

28-
On **all other architectures** additional development headers are required:
28+
On **ARMv6 and ARMv7 (32-bit), RISC-V and other rare CPU architectures** additional build dependencies may be required to compile the [Pillow](https://pypi.org/project/pillow/) and [PycURL](https://pypi.org/project/pycurl/) modules:
2929
```sh
3030
sudo apt update
31-
sudo apt --no-install-recommends install ca-certificates curl python3 python3-dev libcurl4-openssl-dev gcc libssl-dev
31+
sudo apt --no-install-recommends install ca-certificates curl python3 python3-dev gcc libjpeg62-turbo-dev libcurl4-openssl-dev libssl-dev
3232
```
3333

3434
2. Install the Python package manager `pip`
@@ -45,12 +45,6 @@ These install instructions are constantly tested via CI/CD pipeline on Debian Bu
4545
sudo sed -i '/^\[global\]/a\break-system-packages=true' /etc/pip.conf
4646
```
4747

48-
On **32-bit ARMv6 and ARMv7** systems, additionally configure `pip` to use pre-compiled wheels from [piwheels](https://piwheels.org/):
49-
```sh
50-
grep -q '\[global\]' /etc/pip.conf 2> /dev/null || printf '%b' '[global]\n' | sudo tee -a /etc/pip.conf > /dev/null
51-
sudo sed -i '/^\[global\]/a\extra-index-url=https://www.piwheels.org/simple/' /etc/pip.conf
52-
```
53-
5448
3. Install and setup **motionEye**
5549
```sh
5650
sudo python3 -m pip install --pre motioneye

docker/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bookworm-slim
1+
FROM debian:trixie-slim
22
LABEL maintainer="Marcus Klein <himself@kleini.org>"
33

44
# By default, run as root
@@ -9,12 +9,11 @@ COPY . /tmp/motioneye
99
COPY docker/entrypoint.sh /entrypoint.sh
1010

1111
# Build deps:
12-
# - armhf: Python headers, C compiler and libjpeg for Pillow, until piwheels provides the latest version: https://piwheels.org/project/pillow/
13-
# - other: Python headers, C compiler, libcurl and libssl for pycurl: https://pypi.org/project/pycurl/#files
12+
# - armhf/riscv64: Python headers, C compiler and libjpeg for Pillow: https://pypi.org/project/pillow/#files, libcurl and libssl for pycurl: https://pypi.org/project/pycurl/#files
1413
RUN printf '%b' '[global]\nbreak-system-packages=true\n' > /etc/pip.conf && \
1514
case "$(dpkg --print-architecture)" in \
16-
'armhf') PACKAGES='python3-dev gcc libjpeg62-turbo-dev'; printf '%b' 'extra-index-url=https://www.piwheels.org/simple/\n' >> /etc/pip.conf;; \
17-
*) PACKAGES='python3-dev gcc libcurl4-openssl-dev libssl-dev';; \
15+
'armhf'|'riscv64') PACKAGES='python3-dev gcc libjpeg62-turbo-dev libcurl4-openssl-dev libssl-dev';; \
16+
*) PACKAGES='';; \
1817
esac && \
1918
apt-get -q update && \
2019
DEBIAN_FRONTEND="noninteractive" apt-get -qq --option Dpkg::Options::="--force-confnew" --no-install-recommends install \

motioneye/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.43.1b2"
1+
VERSION = "0.43.1b3"

motioneye/config.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ def motion_camera_ui_to_dict(ui, prev_config=None):
915915
'threshold_maximum': ui['max_frame_change_threshold'],
916916
'threshold_tune': ui['auto_threshold_tuning'],
917917
'noise_tune': ui['auto_noise_detect'],
918-
'noise_level': max(1, int(round(int(ui['noise_level']) * 2.55))),
918+
'noise_level': max(1, round(int(ui['noise_level']) * 2.55)),
919919
'lightswitch_percent': ui['light_switch_detect'],
920920
'event_gap': int(ui['event_gap']),
921921
'pre_capture': int(ui['pre_capture']),
@@ -1384,7 +1384,7 @@ def motion_camera_dict_to_ui(data):
13841384
'auto_noise_detect': data['noise_tune'],
13851385
'max_frame_change_threshold': data['threshold_maximum'],
13861386
'auto_threshold_tuning': data['threshold_tune'],
1387-
'noise_level': int(int(data['noise_level']) / 2.55),
1387+
'noise_level': round(int(data['noise_level']) / 2.55),
13881388
'light_switch_detect': data['lightswitch_percent'],
13891389
'despeckle_filter': data['despeckle_filter'],
13901390
'event_gap': int(data['event_gap']),
@@ -1938,11 +1938,6 @@ def backup():
19381938

19391939

19401940
def restore(content):
1941-
global _main_config_cache
1942-
global _camera_config_cache
1943-
global _camera_ids_cache
1944-
global _additional_structure_cache
1945-
19461941
logging.info('restoring config from backup file')
19471942

19481943
cmd = ['tar', 'zxC', settings.CONF_PATH]

motioneye/controls/v4l2ctl.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ def list_devices():
7979
def list_resolutions(device):
8080
from motioneye import motionctl
8181

82-
global _resolutions_cache
83-
8482
device = utils.make_str(device)
8583

8684
if device in _resolutions_cache:
@@ -165,8 +163,6 @@ def find_persistent_device(device):
165163

166164

167165
def list_ctrls(device):
168-
global _ctrls_cache
169-
170166
device = utils.make_str(device)
171167

172168
if device in _ctrls_cache:

0 commit comments

Comments
 (0)