From 939507f23359c9bac81f977bb27e934c4ddc59e9 Mon Sep 17 00:00:00 2001 From: tomo <49612544+tomo2403@users.noreply.github.com> Date: Sat, 27 Jul 2024 18:01:17 +0200 Subject: [PATCH] Updated DNS API Dev Guide (markdown) --- DNS-API-Dev-Guide.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/DNS-API-Dev-Guide.md b/DNS-API-Dev-Guide.md index 84b23de..35da95f 100644 --- a/DNS-API-Dev-Guide.md +++ b/DNS-API-Dev-Guide.md @@ -20,33 +20,32 @@ acme.sh --issue -d example.com --dns dns_myapi Here we go: ### 1. The Cloudflare DNS API is a recommended reference: - Read it first: - https://github.com/acmesh-official/acme.sh/blob/master/dnsapi/dns_cf.sh +Read it first: +https://github.com/acmesh-official/acme.sh/blob/master/dnsapi/dns_cf.sh ### 2. The script file name must be `dns_myapi.sh` - - The file name must be in this format: `dns_yourApiName.sh`, in this example, it should be `dns_myapi.sh` +The file name must be in this format: `dns_yourApiName.sh`, in this example, it should be `dns_myapi.sh` ### 3. The file can be placed in `acme.sh/` folder, or in `acme.sh/dnsapi/` subfolder. - If you want to contribute your script to `acme.sh` project, it must be placed in `acme.sh/dnsapi/` folder. - If you just want to use your script on your machine, you can put it in `.acme.sh/` or `.acme.sh/dnsapi/` folders. - acme.sh searches the script files in either the acme.sh home dir(`.acme.sh/`) or in the `dnsapi` subfolder(`.acme.sh/dnsapi`). +If you want to contribute your script to `acme.sh` project, it must be placed in `acme.sh/dnsapi/` folder. +If you just want to use your script on your machine, you can put it in `.acme.sh/` or `.acme.sh/dnsapi/` folders. +acme.sh searches the script files in either the acme.sh home dir(`.acme.sh/`) or in the `dnsapi` subfolder(`.acme.sh/dnsapi`). ### 4. There must be 2 functions in your script: - ```sh - # Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" - # Used to add txt record - dns_myapi_add() { } +```sh +# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" +# Used to add txt record +dns_myapi_add() { } - # Usage: fulldomain txtvalue - # Used to remove the txt record after validation - dns_myapi_rm() { } +# Usage: fulldomain txtvalue +# Used to remove the txt record after validation +dns_myapi_rm() { } +``` - ``` - Actually, the `dns_myapi_add()` is required, but `dns_myapi_rm()` is optional. You can just write the add function at the beginning for testing purposes, it's `highly recommended` to implement the rm function too. Otherwise, your TXT records will increase 1 every 2 months. +Actually, the `dns_myapi_add()` is required, but `dns_myapi_rm()` is optional. You can just write the add function at the beginning for testing purposes, it's `highly recommended` to implement the rm function too. Otherwise, your TXT records will increase 1 every 2 months. ### 5. Guide for the add function