Commit Graph
35 Commits
Author SHA1 Message Date
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 cb4c5f5314 feat: ask for a new password when an account logs in with the default one refs #5287
db/zm_create.sql seeds the admin account with the password the user
guide documents (admin), so with authentication on a new install is
still open to anyone who reads the guide.

Refuse that password as a credential and have the web login replace it:

- validateUser() returns false with "This account uses the password
  admin, which ZoneMinder does not accept. Log in to the web interface
  to set a new one." when the password is right but is admin. The API (login.json and
  user=/pass= on any request) answers 401 with that message; the
  user=/pass= web parameters are refused the same way.
- On the login page (action=login) the same login shows a form that
  asks for the current password again and a new one, with a nonce kept
  in the session so another site can't submit it for the user. The new
  password must be set, confirmed and not the default. The account is
  logged in only once it has been replaced; the change is audited.
  That POST skips reCAPTCHA when it carries the form's nonce: the form
  follows a login that passed it, and doesn't render the widget.
  With ZM_AUTH_RELAY=plain the session keeps the new password.
- zmLoadUser() refuses the default password, so zms, zmu and the RTSP
  server don't accept it in user/password parameters either.

The check is on the password typed, so it needs no schema change, covers
existing installs whose admin still has the default password, and
follows the account if it is renamed. A password set to the default
again later is caught the same way. Sessions, tokens and auth hashes
issued before the upgrade keep working until they expire; with
ZM_AUTH_TYPE=remote the web server's login is not affected.

The FAQ now says to force authentication on in conf.d: since 4d7609d36
the daemons apply zm.conf and conf.d values over the database too.

Tests: tests/php/test_default_password.php (the helpers, and that the
seeded hash is the documented default), tests/zm_user_default_password.cpp.
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
efranzwa 7208f746f2 Rework Getting Started doc section 2023-10-28 17:39:10 -07:00
Alejandro Criado-Pérez a5d83e61b4 Corrections on rst files 2023-08-13 01:20:29 +02:00
Håvard Flaget Aasen f2281d1017 Typos in documentation
This is typos noticed by lintian.
2021-10-17 13:29:00 +02:00
Frederick Robinson e256d4f5f1 Update gettingstarted.rst 2020-09-19 18:18:53 -07:00
Pliable Pixels 7109bff6a7 mention other values for GPU 2020-02-24 12:44:36 -05:00
Patrick c5b419976f fix spelling 2020-01-28 20:22:18 -07:00
Pliable Pixels b830cacf98 replaced login window with new look 2019-10-26 08:22:24 -04:00
Pliable Pixels 020f809e8a added config section in userguide, make note that options->path is gone 2019-10-26 08:11:23 -04:00
Pliable Pixels 4313de016b replaced first screen with the new one 2019-10-25 15:28:47 -04:00
Pliable Pixels 28326f6061 we need a clean 1.34 image 2019-10-25 14:55:09 -04:00
Pliable Pixels f5d0039ce7 reference detailed monitor options in getting started 2019-10-24 16:45:51 -04:00
Pliable Pixels d8a47d436e remove extra verbose docs 2019-10-24 14:06:36 -04:00
Pliable Pixels 5443d4482a put theme change at end 2019-10-24 14:00:01 -04:00
Pliable Pixels 30730c80d3 understanding console should be above themes 2019-10-24 13:59:37 -04:00
Pliable Pixels 9837c72bc6 path to TZ setting 2019-10-24 13:58:32 -04:00
Pliable Pixels 363474f613 fix up getting started screen 2019-10-24 13:57:09 -04:00
Pliable Pixels a30902e3d3 fixme 2019-10-24 13:21:04 -04:00
Pliable Pixels f97ea0a2a0 change audit report description based on what isaac said 2019-10-24 13:14:52 -04:00
Pliable Pixels 2ba8bb2737 updated documents for "understanding console" 2019-10-24 12:01:04 -04:00
Pliable Pixels b90bff475d add mention of timezone 2019-10-24 11:10:04 -04:00
Pliable Pixels e1e6fa3bb1 fix authentication doc 2019-10-24 11:00:31 -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
Don Law 28b18066a9 Fix name of OPT_USE_AUTH option in getting started guide. 2016-08-29 20:34:54 -04:00
Pliable Pixels 859a55e1ef updated documentation to include runstates 2016-04-13 12:54:22 -04:00
Andrew Bauer c138914edd Merge pull request #1251 from tikismoke/patch-1
Update gettingstarted.rst
2016-02-26 07:03:36 -06:00
Dmitry Smirnov 5bcc414038 codespell: misc. spelling corrections
Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2016-02-08 20:41:36 +11:00
tikismoke f7bc8c7f0d Update gettingstarted.rst
Correct MODECT by NODECT if using zmTrigger
2016-01-26 20:14:49 +01:00
PliablePixels 71e19f48e8 Content update 2015-08-16 05:34:00 -04:00
PliablePixels 199795a67d new content 2015-08-15 16:05:02 -04:00
PliablePixels f77d0eda22 content updates 2015-08-15 11:56:08 -04:00
SteveGilvarry 9795967298 Initial attempt to migrate wiki to readthedocs 2014-07-13 22:25:30 +10:00