Skip to content

Commit

Permalink
motionEye beta v0.43.1b2 (#2995)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaIng committed May 29, 2024
2 parents 2862efe + 0986d30 commit e096193
Show file tree
Hide file tree
Showing 117 changed files with 6,479 additions and 5,253 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
docker:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
# ToDo: Switch to Ubuntu Noble once runner host end cancellations are fixed: https://github.com/actions/runner-images/issues/9848#issuecomment-2137140734
runs-on: ubuntu-22.04

permissions:
Expand All @@ -36,7 +37,7 @@ jobs:
- uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
pre-commit-autoupdate:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -28,14 +28,27 @@ jobs:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout -b pre-commit-autoupdate
branch_exists=0
git fetch origin pre-commit-autoupdate && branch_exists=1
if (( branch_exists ))
then
git switch pre-commit-autoupdate
else
git checkout -b pre-commit-autoupdate
fi
pip install pre-commit
pre-commit --version
pre-commit autoupdate
git diff --exit-code && exit 0
git add -A
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m '[CI/CD] pre-commit autoupdate'
git push -f origin pre-commit-autoupdate
gh pr create -B dev -H pre-commit-autoupdate -f -l 'CI/CD'
if (( branch_exists ))
then
git commit --amend --no-edit
git push -f origin pre-commit-autoupdate
else
git commit -m '[CI/CD] pre-commit autoupdate'
git push origin pre-commit-autoupdate
gh pr create -B dev -H pre-commit-autoupdate -f -l 'CI/CD'
fi
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
jobs:
pre-commit:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:

jobs:
release:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/python_safety.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ permissions:
jobs:
python_safety:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- run: sudo apt-get -q update
- run: sudo apt-get autopurge needrestart # https://github.com/actions/runner-images/pull/9956
- run: echo -e '[global]\nbreak-system-packages=true' | sudo tee /etc/pip.conf # error: externally-managed-environment
- run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends install
gcc libcurl4-openssl-dev libssl-dev
- uses: actions/checkout@v4
Expand All @@ -24,5 +26,7 @@ jobs:
check-latest: true
- run: pip install --upgrade pip setuptools
- run: pip install safety .
- run: rm -Rfv /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pip-23.2.1.dist-info # Workaround: https://github.com/motioneye-project/motioneye/pull/2883
- run: safety check
# Ignore CVE-2018-20225, which is IMO reasonably disputed: https://data.safetycli.com/v/67599/97c/
# "extra"-index-url means an index to "additionally" look for newer versions, pre-compiled wheels, or similar, not to force this index being used.
# There is "index-url" to enforce a different index: https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-i
- run: safety check --ignore 67599
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
shellcheck:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Install xz-utils
run: |
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,27 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
strategy:
matrix:
dist: ['ubuntu-20.04', 'ubuntu-22.04']
include:
# https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=python3
- { dist: 'ubuntu-20.04', python: '3.8.2' }
- { dist: 'ubuntu-22.04', python: '3.10.6' }
- { dist: 'ubuntu-24.04', python: '3.12.3' }
fail-fast: false
runs-on: ${{ matrix.dist }}
name: "Test on ${{ matrix.dist }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: sudo apt-mark hold grub-efi-amd64-signed # GRUB does not always find the drive it was configured for
- name: Ubuntu Noble workarounds
if: matrix.dist == 'ubuntu-24.04'
run: |
# https://github.com/actions/runner-images/pull/9956
sudo apt-get autopurge needrestart
# error: externally-managed-environment
echo -e '[global]\nbreak-system-packages=true' | sudo tee /etc/pip.conf
- run: sudo apt-get -q update
- run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends dist-upgrade
- run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends install
Expand All @@ -32,7 +46,7 @@ jobs:
- run: mkdir --parents --verbose .mypy_cache
- run: mypy --ignore-missing-imports --install-types --non-interactive --exclude build/ . || true
- run: pytest --ignore=tests/test_utils/test_mjpeg.py
--ignore=tests/test_utils/test_rtmp.py .
--ignore=tests/test_utils/test_rtmp.py . || true
- run: pytest --fixtures tests/test_utils/test_mjpeg.py || true
- run: pytest --fixtures tests/test_utils/test_rtmp.py || true
- run: pytest . || pytest --doctest-modules . || true
11 changes: 10 additions & 1 deletion .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
strategy:
matrix:
dist: ['ubuntu-20.04', 'ubuntu-22.04']
dist: ['ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04']
fail-fast: false
runs-on: ${{ matrix.dist }}
name: "Test on ${{ matrix.dist }}"
steps:
- run: sudo apt-mark hold grub-efi-amd64-signed # GRUB does not always find the drive it was configured for
- name: Ubuntu Noble workarounds
if: matrix.dist == 'ubuntu-24.04'
run: |
# https://github.com/actions/runner-images/pull/9956
# ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian.
sudo apt-get autopurge needrestart python3-pip python3-setuptools python3-wheel
# error: externally-managed-environment
echo -e '[global]\nbreak-system-packages=true' | sudo tee /etc/pip.conf
- run: sudo apt-get -q update
- run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qq --no-install-recommends dist-upgrade
- run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qq --no-install-recommends install
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update_locales.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
update_locales:
# Skip for forks and dependabot which have no access to secrets (PAT)
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:

- uses: actions/setup-python@v5
Expand Down Expand Up @@ -59,6 +59,7 @@ jobs:
- name: Commit changes
run: |
git add -NA
git diff -I '^"POT-Creation-Date: ' --exit-code && exit 0
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ dist
dropbox.keys
.venv
_traduko.jar
.DS_Store
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-builtin-literals
- id: check-executables-have-shebangs
Expand All @@ -20,23 +20,23 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
rev: 1.7.8
hooks:
- id: bandit
args:
- --skip=B104,B105,B108,B110,B301,B310,B321,B324,B402,B403,B404,B602,B603,B604,B605,B607,B701
- repo: https://github.com/python/black
rev: 23.12.1
rev: 24.4.2
hooks:
- id: black
args: [--skip-string-normalization]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
# See args in setup.cfg
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-2020, flake8-bugbear, flake8-comprehensions, flake8-return]
Expand All @@ -54,7 +54,7 @@ repos:
- id: isort
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py37-plus]
2 changes: 1 addition & 1 deletion motioneye/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.43.1b1"
VERSION = "0.43.1b2"
7 changes: 1 addition & 6 deletions motioneye/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,12 +789,7 @@ def call_hook(u, p):
call_hook(ui['admin_username'], ui['admin_password'])

if ui.get('normal_password') is not None:
if ui['normal_password']:
data['@normal_password'] = hashlib.sha1(
ui['normal_password'].encode('utf-8')
).hexdigest()
else:
data['@normal_password'] = ''
data['@normal_password'] = ui['normal_password']

call_hook(ui['normal_username'], ui['normal_password'])

Expand Down
5 changes: 5 additions & 0 deletions motioneye/extra/linux_init
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ else
motion v4l-utils ffmpeg curl'
fi

# Stop and disable conflicting motion.service
if systemctl -q is-active motion 2> /dev/null || systemctl -q is-enabled motion 2> /dev/null; then
systemctl disable --now motion
fi

# Pre-create config and data dirs and install configuration files
if [[ -f '/etc/motioneye/motioneye.conf' ]]
then
Expand Down
Loading

0 comments on commit e096193

Please sign in to comment.