Package version: 7.4.1 – 7.4.18
Version 7.4 has been a major feature and hardening cycle for the shared
library. Four areas dominate: a full LINBO remote-control / host-status /
image-management overhaul, a new password-management and password-constraints
layer, a long tail of correctness fixes across ldapconnector, samba_util
and quotas — several of them closing bugs reported by early testers — and,
late in the cycle, a packaging pass that moves the runtime dependencies to
apt and repairs the shared venv after a Python upgrade. This work is what the
API, the webui and the CLI now build on: most of the logic that used to be
duplicated in those projects has moved here.
- New
LinboRemote(linbo_sync.py): builds and runslinbo-remotecommands against a group, a room, or an explicit list of clients (IP or hostname), with parameter validation and the target'snrchecked against itsstart.confbefore running. RaisesLinboRemoteParameterErrorinstead of silently building a wrong command. - Session tracking:
list_running_sessions()/attach_command()followlinbo-remote's tmux sessions. Fixed a naming bug in the process — tmux silently replaces the dot in<hostname>.linbo-remotewith an underscore, so sessions were never actually matched. classify_host(): synchronous boot-state probe (Off / Linbo / OS Linux / OS Windows / OS Unknown) using plain blocking sockets — nonmap, noasyncio, safe to call from the webui's gevent-based code.- Fixed
format:<nr>partition numbering: it now uses the partition's position instart.conf's[Partition]list instead of the digit in its device path (the two diverge once partitions aren't defined in device order). last_sync_all()'s return shape aligned with the webui's:host['image'](list of{date, status, image}).last_sync()takes atimestampparameter. Left to its default it returns the epoch of the last synchronisation, as before; set toFalseit returns the whole status entry, which also carries the creation timestamp of the image that was applied.last_sync_all()uses it to add animageVersionkey to every entry of a host's image list, saying which version of the image that host actually runs, orNonewhen it never synchronised it. Existing callers are untouched.image.status: the three duplicated parsers are merged into one, timestamps are exposed as UTC epoch, a missing or malformed status file no longer raises, and file names are matched case-insensitively (reported by @TomS).scan_hosts()no longer returnslastSeen: the field held the time of the probe, not a last-seen date. Recording it is the caller's job.- Boot logs are listed with the hostname each file belongs to,
Nonefor a file naming no host (a multicast log, a client which could not identify itself), so that a caller can keep only the machines of one school. - LINBO hardware inventory reader, Windows driver profile metadata, image driver assignments and dispatcher rendering (@amolani).
- Image manager:
.hashfiles are now recognized as non-editable extras (previously left orphaned on delete/rename); newImageExistsError/IncompleteImageInfoErrorreplace silentprint()-and-return or crashes; fixed a backup-only deletion bug (self.images[group]instead ofself.groups[group]). - Renaming or duplicating an image left behind a
.torrentand a.hashdescribing the previous name: a torrent embeds the file name it serves, so neither survives the rename. Both are now dropped and rebuilt withlinbo-torrent create, in the background and only once the directory holds its final name. The image listing gained atorrentflag saying whether the file is there (closes #30, reported by @TomlDev). - Raw
start.confwrite/delete support, plus new backup handling:list_startconf_backups(),restore_startconf_backup()anddelete_startconf_backup(). A restore backs the current file up first, so it can itself be undone, and copies the backup byte for byte: comments and formatting are the point of keeping one. list_examples()/read_example()expose the example configs shipped in/srv/linbo/examples, limited to thestart.conftemplates and their.reg/.postsync/.prestartsidecars.read_vdi_config(),write_vdi_config()anddelete_vdi_config()handle a group'sstart.conf.<group>.vdifile.parse_linbo_startconf()flushes the last stanza (closes #29, reported by @TomlDev). Group listing is decoupled fromstart.confparsing and exposed through the newgroup_idsattribute.- The unused
LinboImageSyncclass moved to WIP.
LMNUsergainedset_actual_password()(direct SamDB write, bypassingsophomorix-passwd/smbpasswd),set_first_password(),set_random_first_password()andtest_first_password().- New password-constraints module: policy provider, Samba domain floor (minimum length/complexity/age), YAML config.
- Removed the deprecated, buggy
samba_util.UserManager— password management now lives entirely inLMNUser.
- Breaking change: removed the deprecated
LMNMgmtGroupclass, superseded bysamba_util.GroupManager, which reports LDAP errors instead of swallowing them. add_members()/remove_members()no longer hide per-member failures — one invalidcnused to hide the rest of the batch; failures are now collected and returned as a list.GroupManager.add_members()now only swallows the benign "already a member" LDAP error (code 68); every other exception used to be dropped too. Each post-hook script now runs in its own try/except, logged on failure instead of failing the whole call.- A failed LDAP write while adding a member now reaches the caller instead of being logged and reported as a success.
- Printer members are added and removed in a single targeted LDAP modify
instead of rewriting the whole member list: two changes landing at the same
time can no longer overwrite each other.
LMNPrinter.add_members()/remove_members()take users as well as groups and report their failures like the group writers do. - Fixed a
ValueErrorwhen the last member of a group was removed: an empty member list now goes throughdelattr()(reported by @juergen). - Fixed the parent group lookup for student logins containing a dot (merge of PR #31, @Maddi02).
- Fixed custom-fields config resolution: role names were looked up singular
against a YAML keyed plural, only fields 1–4 were read instead of 1–5, and
the config always loaded
default-school's settings regardless of the actual user's school (closes #25). A separateKeyErroron partialcustom_fields.ymlentries was fixed too. - Added
SchoolError(raised when instantiating a group withschool='global'), fixedsetattr()silently no-op'ing on an empty value (now raisesValueError), fixed a lowercase mismatch on group/user lookups and a crash on an empty/oulookup result. - New
NameChecker.validate(), used wherever a name is used to build a path.
- The
<class>-teachers/-students/-parentssubgroups are now kept in sync insophomorixAdminstoo, can be deleted, and their orphans are detected after a kill. NewSchoolClassExistError. Devicesexposeshostnames,hostname_prefixandprefixed_hostnames: the same hosts as anything school-agnostic writes them (LINBO logs, hwinfo files, AD objects), which answers "is this host mine?" for a name coming from outside the school.- Install scripts: student groups are checked for every school and the attic is excluded. The sophomorix hooks no longer abort on a single failure and drop a deprecated school parameter.
sophomorixCloudQuotaCalculated and sophomorixMailQuotaCalculated were
typed as list instead of str in LMNUserModel, LMNRawUserModel and
LMNObjectModel — both are single-valued LDAP attributes
(isSingleValued: TRUE). This caused values to render as ["2506 MB"] once
displayed by the webui. Any consumer of these two fields now gets a plain
str, not a list.
configobj,jinja2,python-ldap,magic,pexpectandpyyamlare declared as apt dependencies instead ofrequirements.txt: pip installs nothing in a--system-site-packagesvenv when the system already satisfies the requirement, so the file never guaranteed anything (should close #32, reported by @HappyBasher;pexpectalone closes #28).- A venv whose
pyvenv.cfgno longer matches the running Python is rebuilt from scratch: it records its interpreter version once and never updates it, so after an Ubuntu LTS upgrade everything pip installed sits in an orphanedsite-packages, offsys.path, and the venv looks healthy while importing nothing. The rebuild fires the newlinuxmuster-venvdpkg trigger, which haslinuxmuster-api7,-cli7and-webui7reinstall their own requirements.
- Unknown
start.confparameters are reported at debug level through the module logger, instead of warning level through the root one. Astart.confholding legacy LINBO 2.x keys logged one warning per key and per file, and since the root logger is the one the consumers configure, those warnings landed straight in the output oflmncli: 37 lines for three groups before a single result was printed. - Same treatment for the malformed lines skipped by the sophomorix log parsers.
lmnfile:ConfigLoaderwrites are now atomic;ConfigLoaderaccepts negative values (a quota of-1stayed a string and left the quota tab empty, reported by @juergen); the CSV loader no longer parses comment lines as data.lmnfile:StartConfLoaderopening a non-existentstart.conf.*in'w'mode now creates a new group file instead of raisingFileNotFoundError(closes linuxmuster/linuxmuster-webui7#293, the webui creating a new LINBO group viawith LMNFile(path, 'w') as f).- New
subnetsmodule to manage subnets and track changes (@hermanntoast). - New
printmodule features: large-card printing (36 passwords on 2 pages), sophomorix templates converted to Jinja. - LDAP connection pooling with implicit reconnect; dots allowed in
usernames/logins;
datetime.utcnow()usage replaced. - New READMEs for
common,devices, install scripts,lmnconfig,print,smbclient,subnets, and an updatedldapconnectorREADME for the password-management API.
The following changes are breaking for any code calling into
linuxmuster-tools directly (the API, the webui and the CLI have all been
updated already):
sophomorixCloudQuotaCalculated/sophomorixMailQuotaCalculatedare nowstr, notlist, onLMNUserModel,LMNRawUserModelandLMNObjectModel.LMNMgmtGroupandsamba_util.UserManagerhave been removed. Usesamba_util.GroupManagerandLMNUser's password methods instead.scan_hosts()no longer returns alastSeenkey.- The
image.statusparsers are unified and now return UTC epochs; callers reading the previous, locale-dependent strings must be adapted. LinboImageSynchas moved to WIP and is no longer importable from its previous location.
Runtime dependencies are now apt dependencies, not requirements.txt
entries. After an Ubuntu LTS upgrade the shared venv is rebuilt on the next
upgrade of the package, and the linuxmuster-venv trigger makes the API, the
CLI and the webui reinstall their own requirements — no manual step is
needed.
Author: Arnaud Kientz Co-Author: Claude