Commit Graph
68 Commits
Author SHA1 Message Date
Isaac Connor b7405c58c5 Merge pull request #5288 from nabbi/hard/auth-default
Ask at first run whether to require a login, and refuse the password admin
2026-10-16 19:03:06 -04:00
Nic Boet b631d2efc9 feat: add a minimum length for new passwords refs #5287
Add ZM_PASSWORD_MIN_LENGTH (Options, System; default 8, 0 turns it off).
passwordProblem() refuses a shorter password, so the user page, the API
and both login-page forms apply it alike. Existing passwords keep
working; only a password being set is checked. The length counts
characters, not bytes.

There is no setting for character classes: they push people to
predictable variations (Password1!) and add less than length does.

A database whose Config table doesn't have the option yet (an upgrade
not run with zmupdate.pl -f) gets no minimum. The password inputs carry
minlength so the browser says so before the form is sent; the server
check is the one that counts. The API answers with the English text, as
for the other reasons.

Tests: tests/php/test_default_password.php.
2026-10-16 10:13:53 -05:00
Nic Boet ebbe1e59e2 feat: ask on the first page whether to require a login refs #5287
A new install starts with authentication on and the admin password admin,
which is refused everywhere. Asking for that password just to replace it is
an extra step, and some installs don't want a login at all. Ask instead.

While the first run is pending (authentication on, the privacy page not
answered yet, builtin auth, and admin still has the password admin), the
login page shows "Set up ZoneMinder" instead of the login form:

- Require a login: choose the admin password; the account is then logged
  in and the privacy page follows, as before.
- Don't require a login: ZM_OPT_USE_AUTH is set to 0 in the database.
  Not offered when ZM_OPT_USE_AUTH is set in zm.conf or conf.d: the owner
  of the box has decided then, and only the password is asked for.

Until one is chosen the web interface, API and streams can't be used: the
password admin is still refused. Whoever opens the page first makes the
choice; before this, whoever typed admin/admin did. The form carries a
nonce kept in the session, like the default-password form, and is exempt
from csrf-magic as action=login is (the login regenerates the session id).
Both choices are audited. Upgrades are not affected: ZM_SHOW_PRIVACY is 0
once the privacy page was answered, and zmupdate.pl doesn't reset it.

Docs: a First Run section in the getting-started guide, and the FAQ and
system options updated to match.

Tests: tests/php/test_first_run.php.
2026-10-16 10:10:25 -05:00
Nic Boet 9ee0e91819 feat: turn authentication on by default for new installs refs #5287
ZM_OPT_USE_AUTH shipped as 0, so a new install accepted every request as
the default user with System=Edit. That includes requests a browser sends
on behalf of any web page a user on the same network opens, so a server
that is never exposed to the internet could still be driven from it.

Default it to 1. zm_create.sql (generated from ConfigData) gives new
installs authentication on. Existing installs keep their value:
zmupdate.pl -f loads Value from the database and writes it back, and only
DefaultValue changes. zm_update-1.39.41.sql also sets DefaultValue to 1
for the row, so that an upgrade run without -f doesn't leave
Value = DefaultValue = 0, which the C++ config loader would skip in favour
of its compiled-in default (on) while the web UI read off.

Update the option help and the user guide (getting started, FAQ, system
options) to say authentication is on for new installs and kept on
upgrade. tests/perl/test_auth_default.pl checks the default, the stored
value and that no update script sets the row's Value; tests/zm_config.cpp
now expects the compiled-in default (opt_use_auth) to be on.
2026-10-16 09:40:37 -05:00
Nic Boet 8ea28cf909 docs: say how to turn reCAPTCHA off without the web UI
With reCAPTCHA on, a wrong site key, a blocked reCAPTCHA script or a
server that can't reach www.google.com refuses every login on the login
page. Document the two ways back in: a conf.d override, which the web UI
reads before the database, or an UPDATE of the Config row.
2026-10-15 19:01:19 -05:00
Isaac ConnorandClaude Opus 5 5c060bb6e6 chore: drop the libvlc build dependency from packaging, CI and docs
Nothing links or dlopens libvlc any more, so the dev package is no
longer a build requirement anywhere: the debian, beowulf, ubuntu and
split-package control files, the podman Containerfile, the redhat and
opensuse specs, the centos CI image, and the five workflows that
installed libvlc-dev. The redhat spec also required vlc-core at
runtime, which was the dlopen target.

Documentation follows: the libVLC source tab section, the macos note
about libVLC not being found, and the WEB_FILTER_SOURCE source-type
list.

Two stale statements nearby are corrected while the files are open. The
Remote source tab still said its RTSP method "may be removed in the
future"; it was removed earlier on this branch. AGENTS.md still listed
RemoteCameraRTSP and LibVLCCamera among the camera classes, both of
which are now gone.

All workflow yaml parses, the three edited rst files render, and the
debian control field structure is unchanged apart from the removed
entries.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Y6FieTwEXuLhhR4e2yiax
2026-10-10 09:32:17 -04:00
Isaac Connor 9f3f6c6770 fix: only trust X-Forwarded-For from configured proxies for auth hash IPs
With ZM_AUTH_HASH_IPS on, the client address bound into the auth hash was
taken from the left-most X-Forwarded-For value whenever the header was
present, both when PHP generated the hash (getRemoteAddr()) and when PHP or
zms validated it (getAuthUser(), zmLoadAuthUser()). The header is client
controlled, so anyone holding a leaked hash could replay it from anywhere by
sending the address it was bound to.

Add ZM_AUTH_TRUSTED_PROXIES, a list of exact reverse proxy addresses.
X-Forwarded-For is now used only when REMOTE_ADDR is one of them, and is read
from the right, skipping hops that are themselves listed proxies, so values a
client prepends are never chosen. With the option empty, the default, the
header is ignored and REMOTE_ADDR is used.

PHP (web/includes/Network.php getRemoteAddr()) and C++ (ClientAddress() in
zm_utils, used by zmLoadAuthUser()) implement the same rule so generation and
validation continue to agree. Every PHP caller already routes through
getRemoteAddr(), so session.php and auth.php need no change.

Reverse proxy users who enable ZM_AUTH_HASH_IPS must list their proxy in the
new option; until they do, hashes bind to the proxy address, which still
validates but no longer distinguishes clients. This is the behaviour change
that the #4921 work avoided by trusting the header.

The option is added through ConfigData only, like other recent options;
zmupdate.pl --freshen inserts it, zms falls back to the compiled-in default and
PHP treats an undefined constant as empty, so no schema migration is needed.

Tests: ClientAddress Catch2 case; tests/php/test_remote_addr.php updated for
the trusted-proxy rule.

refs GHSA-72rf-54rm-798c

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit acea5889dec0826f595cb736147a5fdc9c94a2a9)
2026-09-24 19:51:27 -04:00
Alejandro Criado-Pérez a5d83e61b4 Corrections on rst files 2023-08-13 01:20:29 +02:00
megasaturnv 9d8e32b28c Modified description for ZM_CASE_INSENSITIVE_USERNAMES 2022-09-05 15:49:26 +01:00
megasaturnv 6c0f40f570 Renamed ZM_AUTH_CASE_INSENSITIVE_USERNAMES to ZM_CASE_INSENSITIVE_USERNAMES as name was too long ZoneMinder/zoneminder#3516 2022-09-02 12:03:47 +01:00
megasaturnv 63e5b63eec Added option ZM_AUTH_CASE_INSENSITIVE_USERNAMES to match mixed case usernames to lower case usernames in database ZoneMinder/zoneminder#3516 2022-09-02 11:58:02 +01:00
Håvard Flaget Aasen f2281d1017 Typos in documentation
This is typos noticed by lintian.
2021-10-17 13:29:00 +02:00
criadoperez 4a717820b1 Fixed broken wiki links 2021-09-08 15:18:52 +02:00
gmanproxtreme 84ccf10e65 Updated WEB_TITLE section from ToDo.
The Web_Title's use was unknown. I have seen the changed title appear on the login screen. Documentation updated to reflect this.
2021-08-27 20:21:02 +10:00
Isaac Connor 726f1f616d Merge branch 'update_docs_1_34' 2021-05-10 14:53:14 -04:00
Isaac Connor f0abcdf585 Merge branch 'release-1.34' into update_docs_1_34 2021-05-10 14:48:50 -04:00
Andrew Bauer dcab218a2e remove global config item CREATE_ANALYSIS_IMAGES 2020-07-06 12:22:41 -05:00
Isaac Connor 04b78ac7e6 typo and punctuation fixes. 2020-02-27 17:56:56 -05:00
Isaac Connor c3250dea00 fix typos and add some more text 2019-11-15 15:20:07 -05:00
Martin Kask 98a1cb8c29 Add storage docs 2019-11-14 08:00:52 +02:00
Pliable Pixels a171c2116c recommend you keep FAST_DELETE off unless the system is old 2019-10-27 16:15:09 -04:00
Pliable Pixels b3943e0c49 consistent naming of ES -> Event Notification Server 2019-10-27 10:47:09 -04:00
Pliable Pixels 05b06cd888 add FIFO animated gif and explanation tweaks 2019-10-27 09:40:55 -04:00
Pliable Pixels 4236d74a02 added FIFO, image pending 2019-10-27 08:16:26 -04:00
Pliable Pixels 343c939080 added todo - server needs to be refreshed 2019-10-25 11:59:28 -04:00
Pliable Pixels 309571afbb update display 2019-10-25 11:59:14 -04:00
Pliable Pixels d3906a0835 updated options->config 2019-10-25 11:56:25 -04:00
Pliable Pixels b939f22c17 nits 2019-10-25 11:50:29 -04:00
Pliable Pixels 555a94b776 fixup options->systems 2019-10-25 11:49:07 -04:00
Pliable Pixels 254456b038 remove eyeZM option image 2019-10-25 11:24:16 -04:00
Pliable Pixels 207643d53f updated users documentation with new options and an example 2019-10-25 11:16:20 -04:00
Pliable Pixels a2e1c4300c some text arrangement in options->bw 2019-10-25 09:57:14 -04:00
Pliable Pixels d3336fb96c update options->BW, remove phone BW as it no longer exist 2019-10-25 09:55:21 -04:00
Pliable Pixels 55d56f46df options X10 updated 2019-10-25 09:52:43 -04:00
Pliable Pixels 3bec14c651 options upload updated 2019-10-25 09:51:42 -04:00
Pliable Pixels b8819b540e updated options email, added EIMOD 2019-10-25 09:48:51 -04:00
Pliable Pixels b550db2418 options -> network updated 2019-10-25 09:40:07 -04:00
Pliable Pixels 9b614bebb4 options images upto date 2019-10-25 09:30:44 -04:00
Pliable Pixels 6bb031bac6 update options_web 2019-10-25 09:19:51 -04:00
Pliable Pixels 157bfa7409 remove options path image too 2019-10-25 09:07:31 -04:00
Pliable Pixels 795f380817 options API doc 2019-10-25 09:04:53 -04:00
Pliable Pixels d8bd0a04db path option no longer exists 2019-10-25 09:04:47 -04:00
Pliable Pixels ab7e4b9a7b sync options with current options, remove path 2019-10-25 08:54:51 -04:00
Pliable Pixels 958cedbbab fifo typo 2019-10-24 15:07:04 -04:00
Pliable Pixels f116adb50f fifo note 2019-10-24 15:06:03 -04:00
Pliable Pixels 2c3d72935b reworked logging 2019-10-24 15:05:45 -04:00
Isaac Connor b6c22139d6 update links in docs. Remove build examples using configure as it has been deprecated for a long time. 2019-10-18 18:16:59 -04:00
Isaac Connor 14381cc4da rough in storage documentation 2019-09-24 10:12:28 -04:00
Isaac Connor f557df9fc9 remove extra affect 2019-02-17 17:34:38 -05:00
j-marz bd7ce6ba13 fixed more more typo in options_logging userguide (#2526) 2019-02-17 11:32:10 -05:00