{{define "content"}} {{$csrf := .CSRF}}
Server configuration, stored in the database.
{{template "settingsnav" .}}| Name | Prefix | Created | Last used | Status | Actions |
|---|---|---|---|---|---|
|
{{.Name}}
{{if .Description}} {{truncate 70 .Description}} {{end}}
|
vibedns_{{.Prefix}}… | {{timeAgo .CreatedAt}} | {{if .LastUsedAt}}{{timeAgo .LastUsedAt}}{{else}}never{{end}} | {{statusWord .Enabled}} |
{{template "postform" dict
"Action" (printf "/settings/api/tokens/%d/toggle" .ID) "CSRF" $csrf
"Fields" (dict "enabled" (boolstr (not .Enabled)))
"Icon" (toggleIcon .Enabled)
"Class" "btn btn-sm btn-outline-secondary"
"Title" (printf "%s this token" (toggleVerb .Enabled))}}
{{template "confirmform" dict
"Action" (printf "/settings/api/tokens/%d/delete" .ID) "CSRF" $csrf
"Icon" "bi-trash" "Title" "Revoke permanently"
"Message" (printf "Revoke the token %q? Any automation using it will stop working immediately." .Name)}}
|
Every resource lives under /api/v1. Authenticate with a bearer token, or with the administrator's HTTP Basic credentials.
curl -H "Authorization: Bearer $VIBEDNS_TOKEN" \
{{default "http://127.0.0.1:8080" .Data.BaseURL}}/api/v1/zones
curl -X POST -H "Authorization: Bearer $VIBEDNS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"www","type":"A","data":"192.0.2.10","ttl":3600}' \
{{default "http://127.0.0.1:8080" .Data.BaseURL}}/api/v1/zones/1/records
curl -X POST -H "Authorization: Bearer $VIBEDNS_TOKEN" \
--data-binary @hosts.txt \
{{default "http://127.0.0.1:8080" .Data.BaseURL}}/api/v1/blacklists/1/import
A token is 256 bits from the system random source. Only a short prefix — enough to find the right row — and a SHA-256 hash are stored; the token itself is shown once, at creation, and cannot be recovered afterwards.
A fast hash is appropriate here precisely because a token is not a human-chosen password: there is no small guess space to search, and the hash is verified on every API request.
Tokens carry the same authority as the administrator over the API, but cannot be used to sign in to this interface or to change the administrator's credentials.