### Tailscale ACL grant for DNS TXT, A, and AAAA records Source: https://github.com/adrianosela/tsdmg/blob/main/README.md ACL grant extending the previous example to also allow creating `A` and `AAAA` records, e.g., for the client's own tailnet private IP or any other IP. ```json "grants": [ { "src": ["*"], "dst": ["*"], "ip": ["*"], "app": { "tsdmg.net/dns/v1": [ { "TXT": ["_acme-challenge.${node}.yourdomain.com"], "A": ["${node}.yourdomain.com"], "AAAA": ["${node}.yourdomain.com"], }, ], }, }, ], ``` -------------------------------- ### Run tsdmg Docker image with help flag Source: https://github.com/adrianosela/tsdmg/blob/main/README.md Runs the tsdmg Docker image to display help information. ```bash docker run ghcr.io/adrianosela/tsdmg -h ``` -------------------------------- ### Initialize and serve tsdmg service Source: https://github.com/adrianosela/tsdmg/blob/main/README.md Initializes the tsdmg service with a Tailscale client and DNS provider, then serves HTTP over a tsnet listener. Logs fatal errors if initialization or serving fails. ```go tsdmg, err := service.New(ctx, tsClient, dnsProvider) if err != nil { log.Fatalf("failed to initialize tsdmg service: %v", err) } if err = tsdmg.ServeHTTP(ln); err != nil { log.Fatalf("failed to serve HTTP over tsnet listener: %v", err) } ``` -------------------------------- ### Initialize tsdmg client with WithSkipTailscaleNode Source: https://github.com/adrianosela/tsdmg/blob/main/README.md Initialize a tsdmg client to request, cache, and refresh public TLS certificates from a tsdmg server. Set tsdmg.WithSkipTailscaleNode(true) when the Tailscale desktop client is already running and the server is reachable by node name; otherwise a new Tailscale node is initialized. The client supports creating and deleting DNS records via CreateRecords and DeleteRecords. ```go serverURL := "http://tsdmg" // my server's node name is tsdmg opts := []tsdmg.Option{ // My laptop is already running the Tailscale desktop // client, so the tsdmg server is already reachable by // node-name i.e. http://tsdmg. Not setting this option // will attempt to initialize a new Tailscale node. tsdmg.WithSkipTailscaleNode(true), } client, err := tsdmg.NewClient(ctx, serverURL, opts...) if err != nil { log.Fatalf("failed to initialize client: %v", err) } defer client.Close() created, err := client.CreateRecords(ctx, recordsToCreate...) // check error deleted, err := client.DeleteRecords(ctx, recordsToDelete...) // check error ``` -------------------------------- ### Run tsdmg with Cloudflare DNS provider Source: https://github.com/adrianosela/tsdmg/blob/main/README.md Runs the tsdmg Docker container with Cloudflare as the DNS provider, using environment variables for the Cloudflare API token and Tailscale auth key. Requires the -dns-provider and -ts-authkey flags. ```bash docker run -it ghcr.io/adrianosela/tsdmg \ -domain=yourdomain.com \ -dns-provider=cloudflare \ -cloudflare-api-token=$TSDMG_CLOUDFLARE_API_TOKEN \ -ts-authkey=$TSDMG_TS_AUTHKEY ``` -------------------------------- ### Tailscale ACL grant for DNS TXT records Source: https://github.com/adrianosela/tsdmg/blob/main/README.md ACL grant allowing any node to retrieve TLS certificates for `.`. The `${node}` placeholder is replaced with the `tsdmg` client node's name by the `tsdmg` server prior to evaluation. ```json "grants": [ { "src": ["*"], "dst": ["*"], "ip": ["*"], "app": { "tsdmg.net/dns/v1": [ { "TXT": ["_acme-challenge.${node}.yourdomain.com"], }, ], }, }, ], ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.