Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openwrt-23.05] acme-common: syntax error in uci default configuration #23756

Closed
JKSTAFF opened this issue Mar 26, 2024 · 11 comments
Closed

[openwrt-23.05] acme-common: syntax error in uci default configuration #23756

JKSTAFF opened this issue Mar 26, 2024 · 11 comments
Assignees
Labels
bug OpenWrt 23.05 Issue/PR on branch 23.05

Comments

@JKSTAFF
Copy link

JKSTAFF commented Mar 26, 2024

Steps to reproduce:

  1. Make a fiemware with luci-app-acme and its depends build in
  2. go to: Services → ACME certs
    Screenshot 2024-03-26 231233

Actual behavior:

In browser luci shows

RPCError
RPC call to uci/get failed with ubus code 9: Unspecified error
  at ClassConstructor.handleCallReply (https://192.168.0.1/luci-static/resources/rpc.js?v=git-24.080.71710-b07cf9d:15:3)

Expected behavior:

ACME gui displayed correctly

Additional Information:

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='23.05-SNAPSHOT'
DISTRIB_REVISION='r23812-0a2047cf77'
DISTRIB_TARGET='mediatek/filogic'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt 23.05-SNAPSHOT r23812-0a2047cf77'
DISTRIB_TAINTS='no-all'
@systemcrash
Copy link
Contributor

@tohojo any ideas?

Make a fiemware with luci-app-acme and its depends build in

@JKSTAFF and what are its depends?

@tohojo
Copy link
Contributor

tohojo commented Mar 26, 2024

No idea how the UCI stuff works under the hood, sorry :/

@JKSTAFF
Copy link
Author

JKSTAFF commented Mar 26, 2024

@tohojo any ideas?

Make a fiemware with luci-app-acme and its depends build in

@JKSTAFF and what are its depends?

I checked that luci-mod-admin-full acme acme-acmesh acme-common acme-acmesh-dnsapi libc were installed

@jow-
Copy link
Contributor

jow- commented Mar 26, 2024

Error code 9 is UBUS_STATUS_UNKNOWN_ERROR - this can only happen if libuci reports a lower level error such as bus error.

Edit:
Root cause is

root@OpenWrt:/# uci show acme
uci: Parse error (invalid command) at line 23, byte 1

Specifically the line validation_method webroot in

root@OpenWrt:/# cat /etc/config/acme 
config acme
	option account_email 'email@example.org'
	option debug 0

config cert 'example_wildcard'
	option enabled 0
	option staging 1
	list domains example.org
	list domains sub.example.org
	list domains *.sub.example.org
	option validation_method dns
	option dns "dns_freedns"
	list credentials 'FREEDNS_User="ssladmin@example.org"'
	list credentials 'FREEDNS_Password="1234"'
	option calias "example.com"
	option dalias "dalias.example.com"

config cert 'example'
	option enabled 0
	option staging 1
	list domains example.org
	list domains sub.example.org
	validation_method webroot

This has been fixed in master with d701cae which needs to be backported to OpenWrt 23.05

@jow- jow- transferred this issue from openwrt/luci Mar 26, 2024
@jow- jow- changed the title luci-app-acme: Page is not loading [openwrt-23.05] acme-common: syntax error in uci default configuration Mar 26, 2024
@saudiqbal
Copy link

Same problem when installing the package. https://forum.openwrt.org/t/installing-luci-app-acme-not-working-on-23-05-2/192303

@tohojo
Copy link
Contributor

tohojo commented Mar 27, 2024

Ah, thanks @jow- ! I will push a fix to the 23.05 branch :)

@tohojo tohojo added bug OpenWrt 23.05 Issue/PR on branch 23.05 labels Mar 27, 2024
@tohojo tohojo self-assigned this Mar 27, 2024
@user8446
Copy link

I am on 23.05.3 installing acme for the 1st time. Even after the d701cae fix it does not start:

Failed to execute "/etc/init.d/acme enable" action: Command failed

If I run /usr/lib/acme/client/acme.sh the script itself runs but of course isn't usable since nothing is configured.

tohojo added a commit that referenced this issue Mar 27, 2024
Backport config changes from commit 04ac8c1 ("acme-common: simplify config
example") from master, and apply the subsequent fixup. This should fix the issue
with ACME not working in Luci (resolving #23756).

Keep the version number bump as a bugfix (1.0.4) since we have not backported
all the ACME changes to 23.05.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
@tohojo
Copy link
Contributor

tohojo commented Mar 27, 2024

Fixed with 73bee1f

@stokito
Copy link
Contributor

stokito commented Apr 19, 2024

I forgot to say sorry for this bug. I added the option in the VM when tested but when copied back to sources forgot the option.
But, I would say that the UCI should be more lenient for syntax errors and better to follow the Postel Law. This is a good sample of a minor error on the embedded device that broke the world.
We should try to make the UCI more smart and not fail in such cases.

@user8446
Copy link

No worries my friend, thank you for the development!

@saudiqbal
Copy link

Using acme plugin in Openwrt does not replace the default certificate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OpenWrt 23.05 Issue/PR on branch 23.05
Projects
None yet
Development

No branches or pull requests

7 participants