]> git.proxmox.com Git - proxmox-acme.git/commit - src/proxmox-acme
plugin-caller: add missing methods from acme.sh
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 15 Jul 2021 13:56:57 +0000 (15:56 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Jul 2021 15:57:59 +0000 (17:57 +0200)
commit79364a8c544800652af04ba0acd53f3d4951dc5d
tree160855e898d54388919c9f0e15b32c28a3867818
parent1a9d0b7bad30f125e54ef1437cb6e1a96e29be3a
plugin-caller: add missing methods from acme.sh

As reported in our community forum [0] certain dns plugins use code
from `acme.sh`, which is currently not in our proxmox-acme.

I initially only added _sign and it's callees, but then though about
trying to get all missing methods somehow (only resethttp() was
missing in addition).

The heuristic used to get all missing methods was grepping for '\b_'
in all dns plugins and then removing:
* declarations in proxmox_acme (already present)
* methods declared in the plugins themselves
* $_.* (or ${_.*) - variable use
* comments

in shell:
```
present=$(awk 'BEGIN{ORS="|";} /^_/{ gsub(/\(\) {/, ""); print $0}' \
  src/proxmox-acme | | sed -r 's/\|$//')
local=$(awk 'BEGIN{ORS="|";} /^_/{ gsub(/\(\) {/, ""); print $0}' \
  src/acme.sh/dnsapi/dns*.sh | sed -r 's/\|$//')
grep '\b_' src/acme.sh/dnsapi/* | grep -Ev \
  "$present|$local|_[a-zA-Z0-9_-]+=|\\$\{?_|^src/acme.sh/dnsapi/.*sh:#"
```

[0] https://forum.proxmox.com/threads/proxmox-acme-with-transip-plugin-_sign-command-not-found.92582/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/proxmox-acme