Put a warning on CAA entries.

This commit is contained in:
Philippe Pittoli 2024-12-10 12:54:36 +01:00
parent 6b7b6a293a
commit 78ebfee5c4
2 changed files with 12 additions and 3 deletions

View File

@ -402,7 +402,7 @@ render state
[ HH.div [ HP.classes [C.container, C.has_text_centered] ]
[ HH.p [ HP.classes [C.subtitle] ]
[ HH.strong_ [ HH.u_ [ HH.text "net libre" ]]
, HH.text ": providing free domains since 2015!"
, HH.text ": providing free domains since 2013!"
]
]
]

View File

@ -298,7 +298,7 @@ default_empty_rr :: ResourceRecord
default_empty_rr = default_rr_A
default_qualifier_str = "hard_fail" :: String
default_caa = { flag: 0, tag: CAA.Issue, value: "" } :: CAA.CAA
default_caa = { flag: 0, tag: CAA.Issue, value: "letsencrypt.org" } :: CAA.CAA
initialState :: Input -> State
initialState domain =
@ -476,6 +476,9 @@ render state
, Bulma.selection_field'' "tagCAA" "Tag" CAA_tag (A.zip CAA.tags_txt CAA.tags_raw)
CAA.Issue
(Just (fromMaybe default_caa state._currentRR.caa).tag)
, HH.div [HP.classes [C.notification, C.is_warning]]
[ Bulma.p "⚠️​ CAA entries aren't thoroughly verified, yet. Also, do not put quotes."
]
, Bulma.box_input "valueCAA" "Value" "" (updateForm Field_CAA_value)
(fromMaybe default_caa state._currentRR.caa).value
]
@ -884,7 +887,13 @@ handleAction = case _ of
CAA_tag v -> do
state <- H.get
let new_caa = (fromMaybe default_caa state._currentRR.caa) { tag = fromMaybe CAA.Issue $ CAA.tags A.!! v }
let new_tag = fromMaybe CAA.Issue $ CAA.tags A.!! v
new_value = case new_tag of
CAA.Issue -> "letsencrypt.org"
CAA.ContactEmail -> "contact@example.com"
CAA.ContactPhone -> "0203040506"
_ -> ""
new_caa = (fromMaybe default_caa state._currentRR.caa) { tag = new_tag, value = new_value }
H.modify_ _ { _currentRR { caa = Just new_caa } }
SRV_Protocol v -> H.modify_ _ { _currentRR { protocol = RR.srv_protocols A.!! v } }