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