Compare commits

...

2 Commits

Author SHA1 Message Date
a42d6a5a4f Local addresses. 2024-12-10 12:55:05 +01:00
78ebfee5c4 Put a warning on CAA entries. 2024-12-10 12:54:36 +01:00
2 changed files with 14 additions and 5 deletions

View File

@ -110,8 +110,8 @@ foreign import unsafeSetInnerHTML :: HTMLElement -> RawHTML -> Effect Unit
-- | Current limit is 30 minutes (`max_keepalive` = 60, 60 * 30 seconds = 30 minutes). -- | Current limit is 30 minutes (`max_keepalive` = 60, 60 * 30 seconds = 30 minutes).
max_keepalive = 60 :: Int max_keepalive = 60 :: Int
wsURLauthd = "wss://www.netlib.re/ws/authd" :: String wsURLauthd = "ws://localhost:8080" :: String
wsURLdnsmanagerd = "wss://www.netlib.re/ws/dnsmanagerd" :: String wsURLdnsmanagerd = "ws://localhost:8081" :: String
data Action data Action
= Initialize = Initialize
@ -402,7 +402,7 @@ render state
[ HH.div [ HP.classes [C.container, C.has_text_centered] ] [ HH.div [ HP.classes [C.container, C.has_text_centered] ]
[ HH.p [ HP.classes [C.subtitle] ] [ HH.p [ HP.classes [C.subtitle] ]
[ HH.strong_ [ HH.u_ [ HH.text "net libre" ]] [ 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_empty_rr = default_rr_A
default_qualifier_str = "hard_fail" :: String 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 :: Input -> State
initialState domain = initialState domain =
@ -476,6 +476,9 @@ render state
, Bulma.selection_field'' "tagCAA" "Tag" CAA_tag (A.zip CAA.tags_txt CAA.tags_raw) , Bulma.selection_field'' "tagCAA" "Tag" CAA_tag (A.zip CAA.tags_txt CAA.tags_raw)
CAA.Issue CAA.Issue
(Just (fromMaybe default_caa state._currentRR.caa).tag) (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) , Bulma.box_input "valueCAA" "Value" "" (updateForm Field_CAA_value)
(fromMaybe default_caa state._currentRR.caa).value (fromMaybe default_caa state._currentRR.caa).value
] ]
@ -884,7 +887,13 @@ handleAction = case _ of
CAA_tag v -> do CAA_tag v -> do
state <- H.get 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 } } H.modify_ _ { _currentRR { caa = Just new_caa } }
SRV_Protocol v -> H.modify_ _ { _currentRR { protocol = RR.srv_protocols A.!! v } } SRV_Protocol v -> H.modify_ _ { _currentRR { protocol = RR.srv_protocols A.!! v } }