Adriaan de Groot
900deb5dc8
[users] Move the configuration of password checks to Config
...
- the Widget (Page) does not need to know the password checks,
that's business logic that belongs to Config.
2020-08-05 13:03:18 +02:00
Adriaan de Groot
7b87242107
[users] PW checking does not need widgets
2020-08-05 12:56:09 +02:00
Adriaan de Groot
0ecf1e1cc1
[users] Drop default parameter for badness
2020-08-05 12:24:39 +02:00
Adriaan de Groot
fcafe5db8f
[users] Test the moved setHostname Config
...
- document that the default for writeHostsFile is *true*
2020-08-05 10:50:38 +02:00
Adriaan de Groot
2efce1ac7a
[users] Move the hostname-setting config
...
- The configuration for writing the hostname (to /etc/hostname,
to /etc/hosts and possibly to systemd-hostname) is read-only,
because it comes from the config file and won't change after.
2020-08-05 10:29:13 +02:00
Adriaan de Groot
35dff4d12c
[users] Migrate reuse-password and password-strength to Config
...
- add the "reuse user password for root" setting to Config,
make the UI page follow that setting.
- add the require-strong-password default and toggle settings to
Config; this is not well-checked yet.
On the widget / UI side, connect checkboxes only if they are
visible; refactor reuse-user-password-for-root settings.
2020-08-04 22:40:27 +02:00
Adriaan de Groot
44bc61d4be
[users] set up Config object before widget
2020-08-04 22:37:27 +02:00
Adriaan de Groot
42889b5d7f
[users] Perhaps triggers the build failure
...
- This is the only use of STATICTEST together with , and is the only
one failing to link.
2020-07-31 09:52:06 +02:00
Adriaan de Groot
892e9798f4
[users] Sanitize tests
...
- move the testing of config-object methods to its own tests
- simplify file structure for the password job tests
2020-07-29 13:31:39 +02:00
Adriaan de Groot
cc1136fb0e
[users] Untangle tests
...
- name sources for tests consistently Test<something>
- chase some required source changes with the renaming
- name test targets consistently too
2020-07-29 13:23:41 +02:00
Adriaan de Groot
f75839340a
[users] Drop QRegExpValidator
...
- QREValidator is a GUI part, so to avoid a dependency on GUI for the
(non-GUI) Config object, port to the simpler QRE (which we had
available anyway)
2020-07-29 12:27:56 +02:00
Adriaan de Groot
b9372ba432
[users] Move default groups setting to Config
...
- drop groups from the viewstep
- note that the Config object should also be in charge of creating
Jobs (but then the de-tangling needs to be completed)
- add tests of default groups loading
Doesn't compile because QRegExpValidator is a gui thing.
2020-07-29 12:18:25 +02:00
Adriaan de Groot
cc2e3f79ff
[users] Move job creation from widget to viewstep
...
- This is a half-step: the ViewStep shouldn't do job creation either,
eventually it needs to be the Config object, but this is better
than asking the widget (UI) to create some jobs.
- When updating login- or host-name, or the autologin setting,
set it in GS as well. This is a minor improvement over doing
it only when leaving the page.
- Since the Config object isn't complete, there are leftovers in
the widget, which has a fillGlobalStorage() for the not-jobs-related
bits previously in createJobs().
2020-07-28 12:16:03 +02:00
Adriaan de Groot
6a03bcb25e
[users] Move setRootPassword to Config
...
- this really controls whether a root password is written during installtion,
so rename to writeRootPassword in the code.
2020-07-28 11:59:53 +02:00
Adriaan de Groot
45b71c24e7
[users] Move autologin setting to Config
2020-07-28 11:41:52 +02:00
Adriaan de Groot
6c930af5cb
[users] Use convenience method for labeling Full Name
2020-07-28 11:18:07 +02:00
Adriaan de Groot
0813ec3327
[users] Misc cleanups
...
- unused includes
- avoid "my--pc" .. the dash is inserted by makeHostnameSuggestion()
2020-07-28 10:49:12 +02:00
Adriaan de Groot
9018913af5
[users] Move hostname validation to Config
2020-07-28 10:45:38 +02:00
Adriaan de Groot
40d7d1baac
[users] Move login validation to Config object
...
- add a loginNameStatus which is a QString (empty if things are ok)
stating what's wrong with the loginName, if anything.
2020-07-28 10:21:23 +02:00
Adriaan de Groot
a564d7a753
[users] Fix build on Linux
2020-07-28 09:42:32 +02:00
Adriaan de Groot
d4a784f521
[users] Hook up full name to Config
2020-07-27 17:52:46 +02:00
Adriaan de Groot
630a508049
[users] Hack - create the widget anyway
...
- since the configuration is in the UI parts, we need the widget still
to load the whole configuration (until the config object is complete).
Create the widget before doing configuration; this is wrong. But now
we don't hit nullptr derefs all over.
2020-07-27 17:29:46 +02:00
Adriaan de Groot
8a14cc7ffc
[users] Move some configuration from Page to Config object
...
- make the HostName textbox just a view on the Config's HostName
- make the username and login textboxes view onto Config
- query the Config rather than the UI for job data
2020-07-27 17:26:46 +02:00
Adriaan de Groot
5ffa09000a
[users] Add hostname guessing to Config
2020-07-27 17:26:46 +02:00
Adriaan de Groot
411a202ba5
[users] Do some login-name guessing
2020-07-27 17:26:46 +02:00
Adriaan de Groot
66ae1823a5
[users] Give Config object a user and login name
...
- This is incomplete, because the business logic of guessing
a login from the username is not here.
2020-07-27 17:26:46 +02:00
Adriaan de Groot
35916eb20f
[users] Move autologin and sudoers groups to Config
2020-07-27 17:26:46 +02:00
Adriaan de Groot
2f786079f3
[users] Move shell settings to the Config object
...
- this is a set-only property (as far as the current ViewStep is
concerned) and is passed around in GS for non-obvious reasons.
2020-07-27 17:26:46 +02:00
Adriaan de Groot
8497aad7a1
[users] Apply coding style
2020-07-27 17:26:46 +02:00
Adriaan de Groot
f9b114a67a
[users] Pass the Config object to the Page
...
- delay construction of the Page (widget) until it's needed
- hand the Config object to the Page on construction
This is prep-work for putting the configuration information into the
Config object, rather than in the UI elements.
2020-07-27 17:26:46 +02:00
Adriaan de Groot
dab831b2ff
[users] Introduce a (stub) Config object
2020-07-27 15:55:04 +02:00
Adriaan de Groot
1e08ee084f
[users] Actually add the test file
2020-07-27 15:35:24 +02:00
Adriaan de Groot
92938f63f8
Merge branch 'move-permissions' into calamares
2020-07-27 15:05:46 +02:00
Adriaan de Groot
8ce7457023
[users] Add test for create-users code
...
- just one test for groups-file loading
- while here fix bug that blank and comment lines were being
kept as valid group names
2020-07-27 15:00:14 +02:00
Adriaan de Groot
8a6e4af511
[users] FreeBSD support creating user
...
- call pw useradd and pw usermod as needed; the code paths are basically
the same in invoking a program in the target system to do the work.
2020-07-27 13:45:00 +02:00
Adriaan de Groot
26b8c82630
[users] Refactor user-creation and user-group-setting into methods
...
- This is prep-work for handling other tools for user- and group-
creation as well.
2020-07-27 13:29:51 +02:00
Adriaan de Groot
1fddf723fe
[users] FreeBSD support creating groups
2020-07-27 13:18:09 +02:00
Adriaan de Groot
b99b87f787
[users] Explain some weird internals
2020-07-27 12:37:04 +02:00
Adriaan de Groot
90a0605f38
[preservefiles] [users] Use the Permissions methods
...
- don't call out to tools (executables) when we have an API for it
(which might call out to those tools, but that's abstracted)
2020-07-27 12:27:45 +02:00
apt-ghetto
01b22d27a8
Do not allow 'root' as username
...
On the "Users" tab, the user can choose a username. It was possible to
use 'root' as username, which led to an installation error, because
'root' exists already.
Added a new check to the username validation.
Fixes #1462 .
2020-07-25 16:17:57 +02:00
Adriaan de Groot
409ab6ee86
[users] Refactor writing sudoers file
...
- use existing convenience methods
2020-07-24 14:27:42 +02:00
Adriaan de Groot
bc484ae5da
[users] Refactor /etc/group file handing
2020-07-24 14:27:42 +02:00
Adriaan de Groot
bff0bed07e
[users] Apply coding style (only CreateUserJob.cpp though)
...
- use ci/calamaresstyle
- SPDX licensing
2020-06-22 13:17:39 +02:00
Adriaan de Groot
5da2012465
[users] Expand schema to support the keys documented in users.conf
...
- Now the documentation in the file and the source is leading
to update the schema, but in future those should go hand-in-hand
2020-06-18 16:23:32 +02:00
Adriaan de Groot
463545290e
[users] Fix up schema syntax
...
- Remove schema items *availableShells* and *avatarFilePath* because
those have no implementation.
2020-06-18 16:12:40 +02:00
Adriaan de Groot
4a07bd4ae3
CI: import all the rest of the YAML schema
...
- These have **not** been fixed for validation, so the schema's themselves
will fail to load. This is a consequence of variations in JSON-Schema
representations through various drafts. Fixing the schemata is
fairly straightforward.
This gives us 19 new tests, all of which fail.
2020-06-16 16:06:56 +02:00
Adriaan de Groot
d20a621e93
[users] Apply coding style
2020-04-15 11:55:09 +02:00
Adriaan de Groot
ab5d5fb772
[users] Log pwquality error message as well (better than just "-14")
2020-04-15 11:49:43 +02:00
Adriaan de Groot
ebb3f319cc
[modules] Be more consistent in include punctuation
...
- Use <> for Qt, system, externals
- Use double-quotes for Calamares headers
2020-03-09 21:05:15 -05:00
Adriaan de Groot
c20ac0836e
[users] Take setRootPassword into account when hiding fields
2020-02-24 16:11:14 +01:00
Adriaan de Groot
7752cf31b3
[users] Improve documentation of setRootPassword
2020-02-24 15:59:52 +01:00
Adriaan de Groot
8c527ab592
[users] Overwrite host(s|name) files in target
2020-02-24 12:48:01 +01:00
Adriaan de Groot
4621937477
[users] Use right check on writing hostname
...
- !failed() also means "didn't write the file because it already
exists", which is sometimes acceptable -- but not here.
Use the more-strict bool() conversion, which is only when
the file was actually written.
2020-02-24 12:44:50 +01:00
Adriaan de Groot
7c2a196568
[users] Document new knobs
...
- while here, update copyright notice
FIXES #1140
2020-02-18 10:38:31 +01:00
Adriaan de Groot
f7e8488edf
[users] Correct DBus return from hostnamed calls
2020-02-18 10:35:47 +01:00
Adriaan de Groot
094c213baa
[users] Also test hostname-setting via hostnamed
...
SEE #1140
2020-02-18 10:16:19 +01:00
Adriaan de Groot
f1435452ea
[users] Polish up tests
...
- Don't remove test artifacts on failure
- Coding style
2020-02-17 18:21:44 +01:00
Adriaan de Groot
c5b45c37fc
[users] Add tests of the file-writing components
2020-02-17 18:10:46 +01:00
Adriaan de Groot
371fe267b1
Merge branch 'better-hostname'
2020-02-17 17:10:21 +01:00
Adriaan de Groot
49eb8212e3
[users] Imporove enum-naming
2020-02-17 16:46:06 +01:00
Adriaan de Groot
e74831fcb4
[users] Add .conf entries for hostname settings
...
- Set hostname not-at-all, or via one of two mechanisms
- Write /etc/hosts or not
2020-02-17 16:40:09 +01:00
Adriaan de Groot
61d096c9ec
[users] Prep-work for configurable actions
...
- tidy include style
- add setting to UsersViewStep for hostname action
2020-02-17 16:27:53 +01:00
Adriaan de Groot
33b3321698
[users] Simplify reading configuration
2020-02-17 16:05:55 +01:00
Adriaan de Groot
dbba0c9b03
[users] Move Job creation from the widget to the ViewStep
...
- Having the widget do creation ties the step heavily to that UI;
start moving towards a state where we have a Config object (not
here yet; it still queries the UI part) that moves data around
between UI and ViewStep.
2020-02-17 15:56:41 +01:00
Adriaan de Groot
2471e74aab
[users] Provide some accessors to the UI-page data
2020-02-17 15:50:22 +01:00
Adriaan de Groot
ef4bb5e13b
[users] Make SetHostName job actions configurable
2020-02-17 15:24:44 +01:00
Adriaan de Groot
4495a4c739
CMake: Allow extra libraries in calamares_add_test
...
- Extra libraries specified via LIBRARIES part of CMake function
- Convert all the other module tests
2020-02-17 14:36:52 +01:00
Adriaan de Groot
b044549013
[libcalamares] Merge PluginDllMacro.h into DllMacro.h
...
- Let's just have one header definining export- and visibility-
macros for Calamares. They are still selected based on the
export flags (*_PRO), just defined in one header instead of two.
2020-02-17 11:37:35 +01:00
Adriaan de Groot
44bf0a5d6d
[users] Add method for using hostnamed
...
SEE #1140
2020-02-17 10:57:41 +01:00
Adriaan de Groot
9a7465bfd5
[users] Refactor writing-hostname and writing-hosts
...
- Move to separate functions, as prep-work for making the actions
configurable (and optional).
2020-02-17 10:42:54 +01:00
Adriaan de Groot
90f79b0692
[users] Restore error-checking to set-hostname code
...
- Use the new CreationResult code for compact results
2020-02-14 13:27:49 +01:00
Adriaan de Groot
695b88b8a7
[users] Tidy up hostname creation
...
- Use the createTargetFile() convenience functions to do the
actual work.
- This probably involves more copying around of buffers, since it's
creating one big QString and sending that off, rather than writing
little chunks to a file, but I feel this is worth the code simplification.
- Drops all the error checking for creation, though, because the API for
createTargetFile() lousy.
2020-02-14 12:31:53 +01:00
Adriaan de Groot
b337a6b3f5
[user] Apply coding style
2020-02-14 11:46:35 +01:00
Adriaan de Groot
2bb4dd8e22
[users] Refactor hostname-guessing
2020-02-14 11:45:45 +01:00
Gabriel Craciunescu
7c323bdcdc
[users] Try to guess suggested hostname from dmi
...
- nothing compicated for now, just try to get something
from /sys/devices/virtual/dmi/id/product_name and fallback
to -pc thingy if we can't
2020-02-14 11:36:53 +01:00
Adriaan de Groot
02e5e0de5e
[users] Use entropy service.
...
FIXES #1254
2020-01-30 10:32:34 +01:00
Adriaan de Groot
7029c427f1
Merge pull request #1275 from bill-auger/patch-createusers-logging
...
housekeeping - logging for CreateUser Job
2019-12-02 11:38:34 +01:00
Adriaan de Groot
c2ebfbf6ae
[users] Remove unused parameter (reduces warnings)
2019-11-29 00:17:02 +01:00
bill-auger
344445b437
housekeeping - logging for CreateUser Job
2019-11-28 14:26:06 -05:00
Adriaan de Groot
1c853f2348
Merge pull request #1266 from bill-auger/patch-8
...
housekeeping - calamares style (those lambdas are always a thing)
2019-11-19 14:59:16 +01:00
Adriaan de Groot
0d7e19d5e9
[users] Do not log the password in plain text
2019-11-08 13:23:24 +01:00
Adriaan de Groot
445d8501a7
[users] Different disambiguation for pwd-empty check
...
- all the other checks use "PWQ" as a tag, so use that here too
2019-11-08 13:22:37 +01:00
Adriaan de Groot
e11c9a049f
[users] Sort the password checks before applying them
2019-11-08 13:21:37 +01:00
Adriaan de Groot
dec0cfb7d3
[users] Give password-checks a weight, to sort them later
2019-11-08 13:16:19 +01:00
bill-auger
6c6dcfe1cd
housekeeping - calamares style
2019-11-08 05:17:40 -05:00
Adriaan de Groot
b3e7c3f294
[users] Run checks more often
...
- check password warnings when the page is entered
- re-check (and translate) on language change
2019-11-02 19:26:40 +01:00
Adriaan de Groot
cc66903678
[users] Allow an explicit check for non-emptiness of passwords
...
- move the explicit checking for non-empty into a specific
(normal) password check
- leave only the-two-fields-are-equal outside of the password-
requirements framework
- having non-empty is the same as minLength 1, but gives a different
error message
2019-11-02 19:23:04 +01:00
Adriaan de Groot
196a358493
[users] Flag password problems even when weak-passwords are ok
...
- when you allow weak passwords, flag problems as warnings (yellow)
- when weak passwords aren't allowed, they are fatal errors (red)
2019-11-01 14:48:46 +01:00
Adriaan de Groot
a4e3ea2a86
[users] Refactor retranslation
...
- move retranslation to a method so that code-formatting doesn't
get confused by it.
2019-11-01 13:55:32 +01:00
Adriaan de Groot
28c9da414b
[users] Apply coding style
2019-11-01 13:55:32 +01:00
Adriaan de Groot
9fa817a244
[users] Refactor password-validation
...
- add a method that does the work and sets UI strings for a
generic double-field password entry
- use that for user and root passwords
2019-11-01 13:55:32 +01:00
Adriaan de Groot
7d25173afb
[users] Remove TODO since it doesn't make sense
...
- the two explicit checks are the ones that handle *two*
strings as special cases; all the other checks from
the password-requirements system only handle the one string.
2019-11-01 13:17:31 +01:00
Adriaan de Groot
93eb169ea5
[users] Improve error messages
...
- distinguish beginning of username from the rest
- must start with a letter or _
- tighten message for bad username and bad hostname
FIXES #1261
2019-11-01 13:05:58 +01:00
Adriaan de Groot
8232ca626c
[users] Refactor constants
2019-10-29 16:21:26 +01:00
Adriaan de Groot
9cd1ef93bd
[users] Apply coding style
2019-10-29 16:20:52 +01:00
Adriaan de Groot
9ee0609b72
[users] Use tooltips
...
- the explanations under and around the boxes is noisy,
hard to size correctly (viz. issue #1202 )
- use tooltips in almost-all fields instead
- add placeholder text to be more suggestive
2019-10-29 14:37:26 +01:00
Adriaan de Groot
b3765bc144
[users] Massage the weak-passwords settings
...
- since the wording of the checkbox itself (and the functionality)
is to enforce strong passwords, need to switch out some
logic and fix the wording of the documentation.
2019-10-22 16:08:21 +02:00
Adriaan de Groot
3e4e492305
[users] Polish the documentation for the various checkboxes
2019-10-22 15:32:42 +02:00
Adriaan de Groot
ede50756a1
[users] Simplify config-logic for weak-passwords
...
- Use the convenience methods for config-reading.
- Always set the value (to the default if nog explicitly
set in the config-file).
2019-10-21 17:29:35 +02:00
Adriaan de Groot
21bcd560b1
[users] Use API to change weak-checkbox visibility
2019-10-21 17:26:06 +02:00