- Fix array handling for 3+ domains by detecting if content is already
an array and extracting all existing values correctly
- Restructure code following dns_cf.sh best practices
- Add better debug output ("Getting txt records", "Adding record")
- Improve error handling and make error messages consistent
- Ensure wildcard certificates work correctly with multiple TXT values
The previous implementation used simple string trimming which only
worked for single-value content fields. When content was already an
array (2nd domain onwards), only the first character was extracted,
causing data loss and failures for 3+ domains.
Now properly detects array vs string format using grep and extracts
all existing values before appending new ones, preserving all TXT
records.
Introduced a new OpenIndiana job to the DNS GitHub Actions workflow for testing, including necessary environment variables and steps. Updated README to display the OpenIndiana workflow status badge.
kislyuk yq (used by Debian packages) does not accept `yq e` and
also returns strings with double quotes.
mikefarah's yq-go (used by Alpine) accepts `yq e` and `yq`.
replace `yq e` with `yq` and also use `-r` switch to remove double
quoting to ensure uniform return values from both yq versions.
Signed-off-by: invario <67800603+invario@users.noreply.github.com>
Before this, some deployment scripts would interact with STDIN and that would cause this loop to skip some elements. By using descriptor 3 we avoid clashing with the very common stdin and stdout.
Before this, the eval call would try to run some commands (if they were compound commands) in the yaml file on the machine running acme.sh
Eval might not be worth it for the little benefit it brings.
The config file checks were returning okay even when there were errors. The yq tool returns "null" when it cannot find what's queried, but exists with a 0 rc still.
- Prefer using a pipe to `while read`
- But use a temp file when the loop needs to modify variables that need to be used outside the loop, as the pipe creates a subshell and modifications do not survive after the loop exits.