mirror of
https://github.com/acme-dns/acme-dns.git
synced 2026-04-27 12:55:48 +03:00
[PR #245] Add ability to delete txt records #352
Labels
No labels
Documentation
Documentation
bug
enhancement
feature request
feature request
help wanted
pull-request
question
security
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/acme-dns#352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/acme-dns/acme-dns/pull/245
Author: @jacobmyers-codeninja
Created: 9/29/2020
Status: 🔄 Open
Base:
master← Head:master📝 Commits (2)
b08f083Delete txt records (#1)e328865Actually call delete in /delete api (used update for testing)📊 Changes
6 files changed (+466 additions, -48 deletions)
View changed files
📝
api.go(+36 -0)📝
api_test.go(+250 -0)📝
db.go(+28 -1)📝
dns_test.go(+150 -47)📝
main.go(+1 -0)📝
types.go(+1 -0)📄 Description
I wanted to be able to remove txt records after successful verification. I intend to be able to monitor domains in an automated fashion using scripts and watching for a lingering txt record on a domain indicates something is wrong somewhere and needs attention. In order to facilitate this I just added a new endpoint, to not mess with the existing public api in any way, and update the DB for the necessary functionality. Right now this fits in with minimal modification, the majority is duplicate code for test cases, and adds the ability for things like acme.sh to be able to remove records after validation.
Added /delete API endpoint to call DB.Delete, structured off /update - Functionally nearly identical with just some strings and the DB call adjusted.
Added test functions, structured off update tests, for the API for the delete endpoint.
Added DB.Delete function to DB to set the LastUpdate to 0 for the record being deleted.
Changed DB.GetTXTForDomain to only return records with LastUpdate > 0
Adjusted the test function TestResolveTXT to include tests for multiple records and deleting records. This update created a new function to reduce copy/paste, this code lives in hasExpectedResolveTXTs
Adjusted the test function hasExpectedTXTAnswer to handle checking for the correct number of records, and verifying all expected records are returned
My first time with go/working with github for stuff so apologies if I missed anything or did something wrong.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.