Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance motion startup logging and update "safety" workflow #2983

Merged
merged 3 commits into from
May 28, 2024
Merged

Conversation

MichaIng
Copy link
Member

@MichaIng MichaIng commented May 14, 2024

I would actually like to append the motion/ffmpeg command's output to the error message, when obtaining the version fails. If these commands fail, either the binary is broken, or a linked library, or the CLI has changed. In every case, it would be helpful to have that error in motionEye logs.

The exception does not include the command's STDERR. utils.call_subprocess redirects SDTERR to /dev/null by default. So we could pass stderr=subprocess.PIPE and append output to the error message. But better would be probably to store/access STDERR separately, to append only that one to the error message, while parsing only STDOUT for the actual version string.

While this can be merged, I'll run some more tests regarding this, and am open for suggestions, of course.

Print motion path and version in debug log when detection and when starting motion.

Print error code when motion failed to start.

Align variable names and avoid unused variables.

Signed-off-by: MichaIng <micha@dietpi.com>
Safety "check" has been superseded by "scan": https://docs.safetycli.com/safety-docs/safety-cli-3/migrating-from-safety-cli-2.x-to-safety-cli-3.x#switching-to-the-new-scan-command
But it requires to create an account and authenticate. Until we decide whether we want to create a motionEye account for this, and when we know how to authenticate non-interactively, we stick with "check": pyupio/safety#525

Ignore disputed CVE-2018-20225. pip (intentioanlly) pulls the latest version of a module from PyPI, if an older version is available in "extra" indexes added via "extra-index-url" config/arg. If the module does not exist on PyPI at all, an attacker could upload one with the same name, injecting an unintended module into the user's project. This is of course naturally true when installing one module with multiple indexes, same as when installing an APT package with multiple APT repositories present. "extra"-index-url is not meant to override, but extend the indexes. To enforce a different index, and mitigate this potential risk for modules not uploaded to PyPI, use "index-url" arg/config instead.

Remove obsolete workaround.

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng MichaIng added this to the v0.43.1 milestone May 14, 2024
@MichaIng MichaIng self-assigned this May 14, 2024
Fix error log when ffmpeg executable could NOT print version.

Add executable path to debug log.

Quote motion executable path, which is not assured to work in shell without quotation.

Align variable and structuring code comments.

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng MichaIng merged commit 91a491b into dev May 28, 2024
16 checks passed
@MichaIng MichaIng deleted the motionctl branch May 28, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant