Skip to content

Add files via upload#6975

Open
Matthiasvpfr wants to merge 1 commit into
acmesh-official:masterfrom
matthias-matze:Matthiasvpfr-patch-1
Open

Add files via upload#6975
Matthiasvpfr wants to merge 1 commit into
acmesh-official:masterfrom
matthias-matze:Matthiasvpfr-patch-1

Conversation

@Matthiasvpfr

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

Welcome
READ ME !!!!!
Read me !!!!!!
First thing: don't send PR to the master branch, please send to the dev branch instead.
Please read the DNS API Dev Guide.
You MUST pass the DNS-API-Test.
Then reply on this message, otherwise, your code will not be reviewed or merged.
Please also make sure to add/update the usage here: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2
注意: 必须通过了 DNS-API-Test 才会被 review. 无论是修改, 还是新加的 dns api, 都必须确保通过这个测试.

@Matthiasvpfr

Matthiasvpfr commented May 19, 2026 via email

Copy link
Copy Markdown
Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new ComLaude DNS API hook for managing ACME DNS-01 TXT records through ComLaude’s API.

Changes:

  • Adds dns_comlaude_add and dns_comlaude_rm.
  • Adds ComLaude authentication and root-zone lookup helpers.
  • Introduces direct API calls for TXT record lookup, creation, and deletion.

Shell Review Summary

Critical Issues (Must Fix Before Merge):

  • Script uses bash instead of POSIX sh.
  • Credentials/group ID are not persisted or fully validated.
  • Raw curl/jq usage bypasses acme.sh helpers and portability expectations.
  • Add/remove operations return success without validating API success.

Suggestions (Improvements to Consider):

  • Use standard acme.sh logging helpers instead of raw echo.
  • Escape JSON payload values using the project helper.

Good Practices (Points to Commend):

  • Implements both required add and remove entry points.
  • Attempts to avoid duplicate TXT creation before adding records.

Comment thread dnsapi/dns_comlaude.sh
@@ -0,0 +1,150 @@
#!/usr/bin/env bash
Comment thread dnsapi/dns_comlaude.sh
Comment on lines +3 to +4
# ===== CONFIG =====
COMLAUDE_API="https://api.comlaude.com"
Comment thread dnsapi/dns_comlaude.sh
Comment on lines +13 to +15
if [ -z "${COMLAUDE_USERNAME:-}" ] || [ -z "${COMLAUDE_PASSWORD:-}" ] || [ -z "${COMLAUDE_API_KEY:-}" ]; then
echo "❌ Missing COMLAUDE credentials"
return 1
Comment thread dnsapi/dns_comlaude.sh
Comment on lines +20 to +28
AUTH_RESPONSE=$(curl -s -X POST "$COMLAUDE_API/api_login" \
-H "Content-Type: application/json" \
-d "{
\"username\": \"$COMLAUDE_USERNAME\",
\"password\": \"$COMLAUDE_PASSWORD\",
\"api_key\": \"$COMLAUDE_API_KEY\"
}")

COMLAUDE_ACCESS_TOKEN=$(echo "$AUTH_RESPONSE" | jq -r '.data.access_token')
Comment thread dnsapi/dns_comlaude.sh
Comment on lines +22 to +26
-d "{
\"username\": \"$COMLAUDE_USERNAME\",
\"password\": \"$COMLAUDE_PASSWORD\",
\"api_key\": \"$COMLAUDE_API_KEY\"
}")
Comment thread dnsapi/dns_comlaude.sh
return 1
fi

echo "🔎 Checking domain: $d"
Comment thread dnsapi/dns_comlaude.sh
Comment on lines +104 to +117
RESPONSE=$(curl -s -X POST \
-H "Authorization: Bearer $COMLAUDE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"$COMLAUDE_API/groups/$COMLAUDE_GROUP_ID/zones/$_zone_id/records" \
-d "{
\"type\": \"TXT\",
\"name\": \"$fulldomain\",
\"value\": \"$txtvalue\",
\"ttl\": 60
}")

echo "$RESPONSE" | jq .

return 0
Comment thread dnsapi/dns_comlaude.sh
Comment on lines +143 to +146
curl -s -X DELETE \
-H "Authorization: Bearer $COMLAUDE_ACCESS_TOKEN" \
"$COMLAUDE_API/groups/$COMLAUDE_GROUP_ID/zones/$_zone_id/records/$RECORD_ID"

@neilpang

neilpang commented Jul 2, 2026

Copy link
Copy Markdown
Member

This needs a rewrite following the DNS API Dev Guide:

  1. Target dev, not master.
  2. POSIX sh, not bash (#!/usr/bin/env sh).
  3. Use _get/_post, never raw curl; no jq dependency — parse with _egrep_o etc.
  4. Use _info/_err/_debug instead of echo (and drop the emojis).
  5. Add the dns_comlaude_info= block, and load/save credentials via _readaccountconf_mutable/_saveaccountconf_mutable.
  6. Pass the DNS-API-Test in your fork, open a "Report bugs to ComLaude DNS API" tracking issue, and add the usage entry on the dnsapi2 wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants