Compare commits
3 commits
9bf76b02c1
...
0f0eda8af5
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f0eda8af5 | |||
| e7d8d2520d | |||
| c154891060 |
11 changed files with 36 additions and 39 deletions
|
|
@ -112,8 +112,8 @@ foreign import unsafeSetInnerHTML :: HTMLElement -> RawHTML -> Effect Unit
|
|||
-- | Current limit is 30 minutes (`max_keepalive` = 60, 60 * 30 seconds = 30 minutes).
|
||||
max_keepalive = 60 :: Int
|
||||
|
||||
wsURLauthd = "wss://www.netlib.re/ws/authd" :: String
|
||||
wsURLdnsmanagerd = "wss://www.netlib.re/ws/dnsmanagerd" :: String
|
||||
wsURLauthd = "ws://localhost:8080" :: String
|
||||
wsURLdnsmanagerd = "ws://localhost:8081" :: String
|
||||
|
||||
data PageEvent
|
||||
= EventPageAuthentication PageAuthentication.Output
|
||||
|
|
|
|||
|
|
@ -40,12 +40,11 @@ import CSSClasses as C
|
|||
|
||||
import App.Text.Explanations as Explanations
|
||||
|
||||
import App.Type.RRId (RRId)
|
||||
import App.Type.ResourceRecord as RR
|
||||
import App.Type.Delegation (mkEmptyDelegationForm, update, Form, Field) as Delegation
|
||||
import App.Type.RRModal (RRModal(..))
|
||||
import App.Type.DKIM as DKIM
|
||||
import App.Type.DMARC as DMARC
|
||||
import App.Type.ResourceRecord.DKIM as DKIM
|
||||
import App.Type.ResourceRecord.DMARC as DMARC
|
||||
|
||||
import App.Type.LogMessage (LogMessage(..))
|
||||
import App.Message.DNSManagerDaemon as DNSManager
|
||||
|
|
@ -89,9 +88,9 @@ type Input = String
|
|||
-- | 4. `AddRR RR.AcceptedRRTypes RR.ResourceRecord`: send a message to `dnsmanagerd`.
|
||||
-- |
|
||||
-- | Steps to update an entry:
|
||||
-- | 1. `CreateUpdateRRModal RRId`: create a modal from the values of the RR in `_resources` to update.
|
||||
-- | 1. `CreateUpdateRRModal RR.RRId`: create a modal from the values of the RR in `_resources` to update.
|
||||
-- | 2. `UpdateCurrentRR Field`: modify the currently displayed RR.
|
||||
-- | 3. `ValidateLocal RRId RR.AcceptedRRTypes`: validate the RR.
|
||||
-- | 3. `ValidateLocal RR.RRId RR.AcceptedRRTypes`: validate the RR.
|
||||
-- | 4. `SaveRR RR.ResourceRecord`: save the _validated_ RR by sending a message to `dnsmanagerd`.
|
||||
|
||||
data Action
|
||||
|
|
@ -108,10 +107,10 @@ data Action
|
|||
| CreateDelegationModal
|
||||
|
||||
-- | Create modal (a form) for a resource record to update.
|
||||
| CreateUpdateRRModal RRId
|
||||
| CreateUpdateRRModal RR.RRId
|
||||
|
||||
-- | Create a modal to ask confirmation before deleting a resource record.
|
||||
| DeleteRRModal RRId
|
||||
| DeleteRRModal RR.RRId
|
||||
|
||||
-- | Change the current tab.
|
||||
| ChangeTab Tab
|
||||
|
|
@ -149,7 +148,7 @@ data Action
|
|||
|
||||
-- | Send a message to remove a resource record.
|
||||
-- | Automatically closes the modal.
|
||||
| RemoveRR RRId
|
||||
| RemoveRR RR.RRId
|
||||
|
||||
-- | Ask `dnsmanagerd` for the generated zone file.
|
||||
| AskGeneratedZoneFile
|
||||
|
|
@ -158,7 +157,7 @@ data Action
|
|||
| RRUpdate RR.RRUpdateValue
|
||||
|
||||
-- | Ask a (new) token for a resource record.
|
||||
| NewToken RRId
|
||||
| NewToken RR.RRId
|
||||
|
||||
data Tab = Zone | TheBasics | TokenExplanation
|
||||
derive instance eqTab :: Eq Tab
|
||||
|
|
@ -177,7 +176,7 @@ type State =
|
|||
|
||||
-- | All resource records.
|
||||
, _resources :: Array RR.ResourceRecord
|
||||
--, _local_errors :: Hash.HashMap RRId (Array Validation.Error)
|
||||
--, _local_errors :: Hash.HashMap RR.RRId (Array Validation.Error)
|
||||
|
||||
-- Unique RR form.
|
||||
, _rr_form :: RR.Form
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@ import Data.Maybe (Maybe(..), fromMaybe, maybe)
|
|||
|
||||
import Data.Tuple (Tuple)
|
||||
|
||||
import App.Type.CAA as CAA
|
||||
import App.Text.Explanations as Explanations
|
||||
import Web as Web
|
||||
import Halogen.HTML as HH
|
||||
import Halogen.HTML.Properties as HP
|
||||
import App.Type.RRId (RRId)
|
||||
import App.Type.DMARC as DMARC
|
||||
import App.Type.DKIM as DKIM
|
||||
import App.Type.Delegation as Delegation
|
||||
import App.Templates.Table as Table
|
||||
import Data.String (toLower)
|
||||
|
||||
import App.Text.Explanations as Explanations
|
||||
import App.Templates.Table as Table
|
||||
|
||||
import App.Type.Delegation as Delegation
|
||||
import App.Type.RRModal (RRModal(..))
|
||||
|
||||
import App.Type.ResourceRecord.CAA as CAA
|
||||
import App.Type.ResourceRecord.DMARC as DMARC
|
||||
import App.Type.ResourceRecord.DKIM as DKIM
|
||||
import App.Type.ResourceRecord.SPF (mechanism_types, modifier_types, qualifier_types, show_qualifier) as SPF
|
||||
import App.Type.ResourceRecord as RR
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ delegation_modal selected_domain form action_update_form action_validate action_
|
|||
|
||||
type Domain = String
|
||||
type ActionUpdateForm i = (RR.Field -> i)
|
||||
type ActionNewToken i = (RRId -> i)
|
||||
type ActionNewToken i = (RR.RRId -> i)
|
||||
type ActionUpdateRR i = (RR.RRUpdateValue -> i)
|
||||
type ActionValidateNewRR i = (RR.AcceptedRRTypes -> i)
|
||||
type ActionValidateLocalRR :: forall k. k -> k
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import Halogen.HTML as HH
|
|||
import Halogen.HTML.Properties as HP
|
||||
import Data.String.CodePoints as CP
|
||||
import Utils (id, attach_id)
|
||||
import App.Type.DMARC as DMARC
|
||||
import App.Type.ResourceRecord.DMARC as DMARC
|
||||
|
||||
import App.Type.ResourceRecord (ResourceRecord)
|
||||
import App.Type.ResourceRecord.SPF ( show_mechanism, show_mechanism_type
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
module App.Type.RRId where
|
||||
|
||||
type RRId = Int
|
||||
|
|
@ -6,12 +6,11 @@
|
|||
-- | FIXME: TODO: WIP: should this be replaced by something like `CRUD`?
|
||||
module App.Type.RRModal where
|
||||
|
||||
import App.Type.RRId
|
||||
import App.Type.ResourceRecord (AcceptedRRTypes)
|
||||
import App.Type.ResourceRecord (AcceptedRRTypes, RRId) as RR
|
||||
|
||||
data RRModal
|
||||
= NoModal
|
||||
| NewRRModal AcceptedRRTypes
|
||||
| NewRRModal RR.AcceptedRRTypes
|
||||
| UpdateRRModal
|
||||
| RemoveRRModal RRId
|
||||
| RemoveRRModal RR.RRId
|
||||
| DelegationModal
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module App.Type.ResourceRecord where
|
||||
|
||||
import Prelude (($), (-), (<>), map, bind, pure, class Show)
|
||||
import Prelude (class Show, ($), (-), (<>))
|
||||
-- import Data.String (toLower)
|
||||
import Data.Generic.Rep (class Generic)
|
||||
import App.Type.GenericSerialization (generic_serialization)
|
||||
|
|
@ -23,14 +23,16 @@ import Data.Codec.Argonaut as CA
|
|||
import Data.Codec.Argonaut.Record as CAR
|
||||
import Data.Int (fromString)
|
||||
|
||||
import App.Type.DKIM as DKIM
|
||||
import App.Type.DMARC as DMARC
|
||||
import App.Type.ResourceRecord.DKIM as DKIM
|
||||
import App.Type.ResourceRecord.DMARC as DMARC
|
||||
import App.Type.ResourceRecord.SPF as SPF
|
||||
import App.Type.CAA as CAA
|
||||
import App.Type.ResourceRecord.CAA as CAA
|
||||
|
||||
type RRId = Int
|
||||
|
||||
type ResourceRecord
|
||||
= { rrtype :: String
|
||||
, rrid :: Int
|
||||
, rrid :: RRId
|
||||
, name :: String
|
||||
, ttl :: Int
|
||||
, target :: String
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
-- | The Certification Authority Authorization (CAA) record is described in RFC8859.
|
||||
-- | The CAA record allows to specify Certification Authorities (CAs) authorized to issue certificates.
|
||||
module App.Type.CAA where
|
||||
module App.Type.ResourceRecord.CAA where
|
||||
|
||||
import Prelude
|
||||
import Data.Generic.Rep (class Generic)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module App.Type.DKIM where
|
||||
module App.Type.ResourceRecord.DKIM where
|
||||
|
||||
import Prelude
|
||||
import Data.Generic.Rep (class Generic)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
-- | DMARC is a spam mitigation mechanism described in RFC7489.
|
||||
-- | DMARC is built on top of DKIM and SPF.
|
||||
module App.Type.DMARC where
|
||||
module App.Type.ResourceRecord.DMARC where
|
||||
|
||||
import Prelude
|
||||
import Data.Generic.Rep (class Generic)
|
||||
|
|
@ -18,9 +18,9 @@ import GenericParser.DomainParser (name, sub_eof) as DomainParser
|
|||
import GenericParser.IPAddress as IPAddress
|
||||
import GenericParser.RFC5234 as RFC5234
|
||||
|
||||
import App.Type.DKIM as DKIM
|
||||
import App.Type.DMARC as DMARC
|
||||
import App.Type.CAA as CAA
|
||||
import App.Type.ResourceRecord.DKIM as DKIM
|
||||
import App.Type.ResourceRecord.DMARC as DMARC
|
||||
import App.Type.ResourceRecord.CAA as CAA
|
||||
|
||||
import Utils (id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue