openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.89k stars 3.4k forks source link

acme: 34 warning messages about egrep obsolescence in the output #24262

Open stangri opened 1 month ago

stangri commented 1 month ago

Maintainer: @tohojo , also pinging @stokito Environment: OpenWrt 23.05.3

Description: Having the following versions of the acme packages installed:

xg-135r3 in ~ # opkg list-installed | grep acme
acme - 4.0.0
acme-acmesh - 3.0.7-2
acme-acmesh-dnsapi - 3.0.7-2
acme-common - 1.0.4

Running the following command: /usr/lib/acme/client/acme.sh --home "/etc/acme" --server letsencrypt --issue --dns dns_cf -d domain1 -d domain2

Produces a total of 34 warnings: egrep: warning: egrep is obsolescent; using grep -E

The certificate is being successfully issued, but the presence of 34 of those warnings in the output is annoying.

yurtpage commented 1 month ago

This is an issue of the acme.sh itself https://github.com/acmesh-official/acme.sh/issues/4835 We can't use just grep -E because it's missing on some old NAS.

The warning started to be printed by the egrep stating from recent versions https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep

yurtpage commented 1 month ago

Also you better not to use the acme.sh command directly but use UCI config in /etc/config/acme or luci-app-acme

stangri commented 1 month ago

Also you better not to use the acme.sh command directly but use UCI config in /etc/config/acme or luci-app-acme

What's your reference for that? Either way, that's how the acme.sh is packaged for OpenWrt would be nice if it didn't produce errors, either thru the patch or update from upstream.

And actually I would use it thru uci, but:

  1. There's little to no documentation
  2. I ended up defining an entry in /etc/config/acme and it didn't work, so I've had to do it manually
yurtpage commented 1 month ago

The warning was added to the GNU /usr/bin/egrep:

#!@SHELL@
cmd=${0##*/}
echo "$cmd: warning: $cmd is obsolescent; using @grep@ @option@" >&2
exec @grep@ @option@ "$@"

So this shouldn't affect most of OpenWrt users because it uses BusyBox egrep. Patching is something that generally should be avoided unless the package won't be built. The acme.sh script is itself over bloated so it would be better to avoid the additional complexity. This is a warning and people shouldn't see it unless they troubleshooting a problem. Normally the acme.sh should just work without a user interaction.

yurtpage commented 1 month ago

Ok, actually it was fixed in the acme.sh with hiding the warning by redirection of stderr to null: https://github.com/acmesh-official/acme.sh/commit/fe890c62f4229c8696d85edfd2336130214135db It was simply not released yet.

So you can close the issue as WONTFIX

stangri commented 1 month ago

Ok, actually it was fixed in the acme.sh with hiding the warning by redirection of stderr to null: acmesh-official/acme.sh@fe890c6

@tohojo @stokito do you gentlemen mind updating the OpenWrt package with the fix (and ideally cherry-picking for stable)?

Thanks!

tohojo commented 1 month ago

We can update once there's an upstream release with the fix :)