Start only enabled, unlocked attachments on pool.reimport
The default FSAttachmentDelegate.start_on_import queried items with
enabled=False. On pool.reimport, a disabled share on the pool made
the share delegate start its service and reload it. A pool with only
enabled shares did not start or reload the service at all.
The default now queries enabled, unlocked items, the same as
start_on_unlock. A disabled service stays stopped, because
start_service checks the service enable flag.
Make RDMA link choices cache clearable
Replace the permanent @cache on rdma._get_link_choices and
rdma.get_card_choices with entries in the cache service, and add
private rdma.reset_link_choices to clear them.
Add the truesearch.status event
The event sends what truesearch.status returns: on subscribe, on each
change in the indexer's status, and every 5 seconds while a pass runs.
Middleware holds one indexer subscription for all subscribers, so the
event takes no argument. While the indexer is down or refuses, it polls
every 5 seconds.
Each dataset's status gains progress and last_pass.
NAS-145406 / 27.1.0 / Require NTS for S3 Object Lock only when require_nts is set (by anodos325) (#20296)
s3d refused every time source without NTS, so on the default NTP servers
every object-locked bucket was read-only. Render require_nts into its
[server] section, and when the setting changes, restart S3 once chronyd
has selected a source again (up to 60 s).
Needs truenas_s3 with the [server] require_nts key.
Original PR: https://github.com/truenas/middleware/pull/20282
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
NAS-145406 / 28.0.0-BETA.1 / Require NTS for S3 Object Lock only when require_nts is set (#20282)
s3d refused every time source without NTS, so on the default NTP servers
every object-locked bucket was read-only. Render require_nts into its
[server] section, and when the setting changes, restart S3 once chronyd
has selected a source again (up to 60 s).
Needs truenas_s3 with the [server] require_nts key.
27.1 backport notes:
- system.security.update: the S3 hook goes in plugins/security/update.py
through middleware.call; 27 has no plugins/security/config.py
- buckets.conf.mako, lifecycle.py: system.security.config and
service.query return dicts on 27, so read require_nts and state by key
- s3 conftest: keep 27's zfs.resource.destroy for the excluded bucket's
dataset in place of master's destroy_impl
- test_s3_buckets.py needs truenas_s3 NAS-145392 (404 for a bucket no
row holds), which is on its stable/27
[3 lines not shown]
NAS-145425 / 27.1.0 / Fix `test_audit_websocket.test_api_key_login_failed` (#20308)
In 27.1 `login_with_api_key` doesn't go through PAM, so the error
message is different.
NAS-145438 / 28.0.0-BETA.1 / Fix flaky NFS logging test (by themylogin) (#20322)
We'll have to use NFSv3 to test logging. NFSv4 mounts only produce the
inotify-driven "v4.x client attached/detached" lines, which are racy.
Also, WARNINGs like "refused unmount not exported" pass the simple
`'rpc.mountd' in syslog_data` filter and can mess with tests results
too.
Original PR: https://github.com/truenas/middleware/pull/20321
Co-authored-by: themylogin <themylogin at gmail.com>
NAS-145438 / 27.1.0 / Fix flaky NFS logging test (#20321)
We'll have to use NFSv3 to test logging. NFSv4 mounts only produce the
inotify-driven "v4.x client attached/detached" lines, which are racy.
Also, WARNINGs like "refused unmount not exported" pass the simple
`'rpc.mountd' in syslog_data` filter and can mess with tests results
too.
NAS-145420 / 28.0.0-BETA.1 / Fix broken path security tests (#20305)
27.1 backport notes:
- test_authorized_keys_symlink_is_not_read: this branch already set the
user's home to the dataset; took master's version of that hunk
(cherry picked from commit f5a2141fd0727e659a57854723000f3cd5175774)
NAS-145415 / 27.1.0 / Advertise the TrueNAS API over mDNS as _truenas-api._tcp (by william-gr) (#20309)
Advertise the TrueNAS API over mDNS as `_truenas-api._tcp`, on the web
UI's HTTPS port, so that a client such as the TrueNAS Connect app can
find a TrueNAS whatever its host name. Today a TrueNAS advertises its UI
only as `_http._tcp`, named after its host name, and nothing in that
says TrueNAS: the app keeps services whose name starts with "truenas"
and misses a renamed system.
The TXT record holds what the NAS already answers before signing in,
with the `_PLAIN` suffixes trimmed off the authentication mechanisms,
and `txtvers` first (RFC 6763 §6.7). It is 73 bytes:
```
txtvers=1
api=min=v25.10.0,max=v28.0.0
mech=API_KEY,TOKEN,PASSWORD,SCRAM
```
[16 lines not shown]