Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' as of 2024-01-22 into …
Browse files Browse the repository at this point in the history
…libconf-nutconf
  • Loading branch information
jimklimov committed Jan 27, 2024
2 parents 12739f0 + 746cb86 commit 1182587
Show file tree
Hide file tree
Showing 216 changed files with 5,426 additions and 1,380 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
of "real" changes in the other commits. Similarly for typo fixes in
comments or text documents.

- [ ] Please star NUT on GitHub, this helps with sponsorships! ;)

## Frequent "underwater rocks" for driver addition/update PRs

- [ ] Revised existing driver families and added a sub-driver if applicable
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/PyNUTClient.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Publish PyNUT client bindings for NUT 🐍 distributions 📦 to PyPI
# based on https://medium.com/@VersuS_/automate-pypi-releases-with-github-actions-4c5a9cfe947d
# and https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

# NOTE: We may need to split this workflow into two files to do only
# paths for master branch, and run always for (release) tags?
on:
push:
paths:
- 'scripts/python/module/*'
- '.github/workflows/PyNUTClient.yml'
tags:
- '*'
branches:
- 'master'

permissions:
id-token: write

jobs:
build-n-publish:
if: github.repository_owner == 'networkupstools'
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Extract python interpreter path name
id: pythoncmd
run: >-
set -x ;
echo "PYTHON=$(command -v python)" >> $GITHUB_OUTPUT
- name: Extract tag name
id: tag
# Note: this is all a single shell line in the end,
# so we need semicolons between commands!
run: >-
set -x ;
TAG_NAME="$(echo $GITHUB_REF | cut -d / -f 3)" ;
if [ x"$TAG_NAME" = xmaster ]; then
{ TAG_NAME="$(git describe --tags --match 'v[0-9]*.[0-9]*.[0-9]' --exclude '*-signed' --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*')" \
|| TAG_NAME="$(git describe --tags --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*' --exclude '*Windows*' --exclude '*IPM*')" ; } \
&& test -n "${TAG_NAME}" \
|| TAG_NAME="2.8.1-`TZ=UTC date +%s`" ;
fi >&2 ;
TAG_NAME="$(echo "$TAG_NAME" | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,' -e 's/^v//' -e 's/-g.*$//' -e 's/-/./g')" ;
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Install pypa/setuptools
run: >-
${{ steps.pythoncmd.outputs.PYTHON }} -m
pip install wheel build
- name: Prepare source layout and Build a binary wheel
run: >-
set -e ;
cd scripts/python/module ;
cp -f Makefile.am Makefile ;
make -f Makefile.am clean-local dist NUT_SOURCE_GITREV_NUMERIC="${{ steps.tag.outputs.TAG_NAME }}" PYTHON="${{ steps.pythoncmd.outputs.PYTHON }}" top_srcdir="../../.." srcdir="." builddir="." ;
find . -ls
- name: Publish master distribution 📦 to Test PyPI
# https://github.com/pypa/gh-action-pypi-publish
if: ${{ !startsWith(github.ref, 'refs/tags') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: scripts/python/module/dist
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish tagged release distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: scripts/python/module/dist
password: ${{ secrets.PYPI_API_TOKEN }}
20 changes: 20 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
# include directory for aclocal
ACLOCAL_AMFLAGS = -I m4

# Export certain values for ccache which NUT ci_build.sh can customize,
# to facilitate developer iteration re-runs of "make" later.
# At least GNU and BSD make implementations are okay with this syntax.
@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@
@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@
@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@
@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@
@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@

# subdirectories to build and distribute. The order matters, as
# several subdirectories depend on stuff in "common" or tools being built first
SUBDIRS = include common clients conf data docs drivers tools \
Expand Down Expand Up @@ -134,6 +143,17 @@ spellcheck spellcheck-interactive:
(cd $(builddir)/docs/man && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/conf && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/data && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/data/html && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/Solaris && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/Windows && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/devd && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/hotplug && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/python && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/systemd && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/udev && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/scripts/upsdrvsvcctl && $(MAKE) -s $@) || RES=$$? ; \
(cd $(builddir)/tests/NIT && $(MAKE) -s $@) || RES=$$? ; \
exit $$RES

# Note: the "all-docs" and "check-docs" targets may require tools not
Expand Down
151 changes: 150 additions & 1 deletion NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,153 @@ ChangeLog file (generated for release archives), or to the Git version
control history for "live" codebase.


PLANNED: Release notes for NUT 2.8.4 - what's new since 2.8.3
-------------------------------------------------------------

https://github.com/networkupstools/nut/milestone/9

- (expected) Dynamic Mapping Files (DMF) feature supported, to allow
the driver binaries to be built once and data mappings to be loaded
and modernized on the fly [Ported from 42ITy project]


PLANNED: Release notes for NUT 2.8.3 - what's new since 2.8.2
-------------------------------------------------------------
https://github.com/networkupstools/nut/milestone/11
- (expected) clean-up of libusb API variants support [#300 and follow-ups]
- (expected) CI automation for coding style
- (expected) CI automation for use of data points in drivers that conform
to patterns defined in link:docs/nut-names.txt[]
- (expected) Porting of performance and bug fixes from 42ITy project
- (expected) Bug fixes for fallout possible due to "fightwarn" effort in 2.8.0
PLANNED: Release notes for NUT 2.8.2 - what's new since 2.8.1
-------------------------------------------------------------

https://github.com/networkupstools/nut/milestone/10

- Fix fallout of development in NUT v2.8.0 and/or v2.8.1:
* dstate machinery: a segmentation fault (null pointer dereference) was
possible with `INSTCMD` processing of commands without parameters nor
`TRACKING` identifier. [#2155]
* USB bus number detection for libusb-1.0 builds was overly zealous and
wrongly considered zero values as an error. [#2198]
* `upsmon` recognition of `CAL` state could linger after the calibration
activity was completed by the hardware, which led to mis-processing of
shutdown triggers. Also, notification was added to report "finished
calibration". [issue #2168, PR #2169]
* `upsmon` support for `POLLFAIL_LOG_THROTTLE_MAX` did not neuter the
applied setting when live-reloading configuration, so commenting it
away in `upsmon.conf` did not have the effect of resetting the logging
frequency to default. It also did not reset the counters to certainly
follow the new configuration for existing faults. [#2207]
* `upsmon` support for `POLLFAIL_LOG_THROTTLE_MAX` had an off-by-one error
(e.g. reporting "Data stale" or "Driver not connected" every 30 sec with
`POLLFAIL_LOG_THROTTLE_MAX 5` and `POLLFREQ 5` settings). [#2207]
* Drivers running with non-default user account (e.g. with `user=root`
in their configuration) failed to apply group ownership and permissions
to their Unix socket file for interaction with the local data server.
[#2185, #2096]
* Dispatcher script `scripts/python/app/NUT-Monitor` referenced `py3qt3`
instead of the correct `py3qt5`. It also tries to check both `py2gtk2`
and `py3qt5` implementations verbosely, even if one is not installed.
[#2199, #2201]
* Set the `DesktopFileName` in `scripts/python/app/NUT-Monitor-py3qt5`,
this binds the application with the desktop file and allow the Open
Desktop compatible implementation to display the proper icon and
application name. [#2205]
* Original recipe for `apc_modbus` strictly required USB support even if
building NUT without it. [#2262]

- nut-usbinfo.pl, nut-scanner and libnutscan:
* Library API version for `libnutscan` was bumped from 2.2.0 to 2.5.0
during evolution of this NUT release.
* USB VendorID:ProductID support list files generated by the script for
different OS frameworks now include a comment with other possibly
compatible driver names, where the respective file format allows for
comments.
* Added the concept of `alt_driver_names` in `nutscan_device_t` structure
for ability to suggest a comment with other possibly compatible driver
names in configuration snippets generated by `nut-scanner`; practical
support implemented for USB connected drivers.
* Added the concept of commented-away suggested option values `comment_tag`
and a method to `nutscan_add_commented_option_to_device()`, instead of
hacks in prepared config data which broke some use-cases. [#2221]
* Command-line option `-U` for USB scan can now be specified several times
to increase the detail level about hardware link to the device (this was
previously always suggested, but may be not reliable if USB enumeration
gets changed over time). [#2221]
* Added generation of FreeBSD/pfSense quirks for USB devices supported
by NUT (may get installed to `$datadir` e.g. `/usr/local/share/nut`
and need to be pasted into your `/boot/loader.conf.local`). [#2159]
* nut-scanner now avoids creating ambiguous `nutdevN` device section names
when called separately to scan different media buses (one at a time).
Now the "bus" name would be embedded (e.g. non-colliding `nutdev-usb1`
and `nutdev-snmp1`). [#2247]
* nut-scanner can now discover NUT simulated devices (`.dev` and `.seq`
files) located in your sysconfig directory, and prepare configuration
sections with the simulation driver (currently `dummy-ups`). [#2246]
* nut-scanner now reports `dummy-ups` as driver when scanning NUT "bus"
with Old or Avahi method. [#2236, #2245]

- upsd: Fixed conditions for "no listening interface available" diagnosis
to check how many listeners we succeeded with, not whether the first one
succeeded or not. If not all requested (non-localhost) listeners were
available, default to fail the daemon start-up attempt; support for an
`ALLOW_NOT_ALL_LISTENERS` setting was added to control this behavior. [#723]

- NUT CI improvements:
* Added publishing recipes for PyNUT client bindings for NUT, so it ends
up in the link:https://pypi.org/project/PyNUTClient[PyPI repository].
[#2158]

- main driver core codebase:
* Help users of drivers that can be built to support optionally USB and
other media (like `nutdrv_qx` built for serial-only support), and built
in fact without USB support but used for USB devices, with some more
information to make troubleshooting easier. [#2259]
* Driver programs with debug tracing support via `-D` CLI option and/or
the `NUT_DEBUG_LEVEL` environment variable now check those earlier in
their life-time, so that initialization routine can be debugged. [#2259]

- nut-driver-enumerator (NDE) service/script:
* The optional daemon mode (primarily useful for systems which monitor
a large and dynamic population of power devices) was enhanced with a
`--daemon-after` variant which parses the configuration once before
daemonization and this has a chance to fail while not forked off, as
well as to allow only completing the service unit initialization when
everything is actually ready to work (so further dependencies can start
at the proper time). [#682]
* Also applied other optimizations to the script implementation. [#682]

- powerpanel text driver now handles status responses in any format and should
support most devices [#2156]

- usbhid-ups driver:
* `arduino-hid` subdriver was enhanced from "initial bare bones" experimental
set of mapped data points to support some 20 more mappings to make it more
useful as an UPS driver, not just a controller developer sandbox. [#2188]
* The `onlinedischarge` configuration flag name was too ambiguous and got
deprecated (will be supported but no longer promoted by documentation),
introducing `onlinedischarge_onbattery` as the meaningful alias. [#2213]
* Logged notifications about `OL+DISCHRG` state should now be throttled
(see the driver manual page for more details) [#2214, #2215]:
- If `battery.charge` is available, make the message when entering the
state and then only if the charge differs from that when we posted
the earlier message (e.g. really discharging) and is under
`onlinedischarge_log_throttle_hovercharge` value (defaults to 100%);
- Also can throttle to a time frequency configurable by a new option
`onlinedischarge_log_throttle_sec`, by default 30 sec if `battery.charge`
is not reported by the device (should be frequent by default, in case
the UPS-reported state combination does reflect a bad power condition).

Release notes for NUT 2.8.1 - what's new since 2.8.0
----------------------------------------------------
Expand Down Expand Up @@ -373,6 +520,8 @@ as part of https://github.com/networkupstools/nut/issues/1410 solution.
- nutclient C++ library:
* added `listDeviceClients()` and `deviceGetClients(dev)` to `Client`
classes, and `Device::getClients()` to match PyNUT capabilities [#549]
* published artifacts may include a `libnutclientstub` which is an
implementation of a NUT TCP client in C++ with in-memory data store.
- upsclient C library:
* added support for `NUT_QUIET_INIT_SSL` environment variable to hide
Expand Down Expand Up @@ -1817,7 +1966,7 @@ NOTE: Per original semantic versioning, there were no public NUT 2.3.x releases.
- NUT now embeds Python client support through the PyNUTClient module and the
NUT-Monitor application. Both are from David Goncalves, and are still
available from http://www.lestat.st.
For more information, refer to link:scripts/python/README[].
For more information, refer to link:scripts/python/README.adoc[].

- the dummy-ups driver now supports a "repeater" mode. This allows it to act as
a NUT client, and to forward data. This can be useful for supervision and
Expand Down
Loading

0 comments on commit 1182587

Please sign in to comment.