Compare commits
9 Commits
4ee48aa6c7
...
9b44edb5a5
Author | SHA1 | Date | |
---|---|---|---|
leo | 9b44edb5a5 | ||
leo | 4ab5599784 | ||
leo | 0ab0975ad5 | ||
leo | 063bbe9f16 | ||
leo | 8549e0188d | ||
leo | 2eef5a1328 | ||
leo | b61e07b57c | ||
leo | 0e5761216a | ||
leo | bd1223a731 |
|
@ -1,14 +1,14 @@
|
|||
{ Schema =
|
||||
./schema.dhall
|
||||
sha256:2e7490953649881f93eec24109ef7a93738ab8fab8ccf40c33260af7faf413a5
|
||||
sha256:3f615a66aa32fc6c61a7ecfa42b809efcd42acbccf55ed7b0067bd11636debb2
|
||||
? ./schema.dhall
|
||||
, Schema/validate =
|
||||
./validate.dhall
|
||||
sha256:8d309832e89fab8babec5b1fef692f1bd6db5974befe8c4fbdbaac6b4e9c1619
|
||||
sha256:b549161c382eab83cc2c0063bd0ac0472b51b78687e4aa36f686244cf4a0a1b1
|
||||
? ./validate.dhall
|
||||
, Schema/version =
|
||||
./version.dhall
|
||||
sha256:0f11c01e7e2c9a4532211f599115b64c5830e2478475605766278a08f86161ee
|
||||
sha256:29f94d910d58af54d187e6bcbc7dcfe7f67513c8bd4463d0856fa532783b3c1e
|
||||
? ./version.dhall
|
||||
, Prelude =
|
||||
./prelude.dhall
|
||||
|
|
58
schema.dhall
58
schema.dhall
|
@ -11,10 +11,28 @@ let Schema =
|
|||
, TLSCertKeyPath : Text
|
||||
, HSTSMaxAge : Natural
|
||||
, ContentSecurityPolicy : Text
|
||||
, RateLimit : Natural
|
||||
, Gzip : Natural
|
||||
, Timeout : Natural
|
||||
}
|
||||
, Mailer :
|
||||
{ Enabled : Bool
|
||||
, Protocol : Text
|
||||
, SMTPAddr : Text
|
||||
, SMTPPort : Natural
|
||||
, ForceTrustServerCert : Bool
|
||||
, EnableHELO : Bool
|
||||
, HELOHostname : Text
|
||||
, Auth : Text
|
||||
, From : Text
|
||||
, User : Text
|
||||
, Password : Text
|
||||
, SubjectPrefix : Text
|
||||
, SendPlainText : Bool
|
||||
}
|
||||
, AppName : Text
|
||||
, LiveMode : Bool
|
||||
, DevelMode : Bool
|
||||
, AppPath : Text
|
||||
, Session :
|
||||
{ CookieName : Text
|
||||
, CookieAuthSecret : Text
|
||||
|
@ -22,7 +40,7 @@ let Schema =
|
|||
, MaxAge : Natural
|
||||
}
|
||||
, Logger : { JSON : Bool, Fmt : Optional Text }
|
||||
, InitialAdminPassword : Text
|
||||
, Init : { CreateAdmin : Bool, AdminPassword : Text }
|
||||
, Registration : { Allowed : Bool }
|
||||
}
|
||||
, default =
|
||||
|
@ -37,10 +55,29 @@ let Schema =
|
|||
, TLSCertKeyPath = ""
|
||||
, HSTSMaxAge = 0
|
||||
, ContentSecurityPolicy = ""
|
||||
, RateLimit = 0
|
||||
, Gzip = 0
|
||||
, Timeout = 0
|
||||
}
|
||||
, AppName = "pcmt"
|
||||
, LiveMode = False
|
||||
, Mailer =
|
||||
{ Enabled = False
|
||||
, Protocol = "smtps"
|
||||
, SMTPPort = 465
|
||||
, ForceTrustServerCert = False
|
||||
, EnableHELO = False
|
||||
, SubjectPrefix = "pcmt - "
|
||||
, SendPlainText = True
|
||||
}
|
||||
, LiveMode =
|
||||
-- | LiveMode controls whether the application looks for
|
||||
-- | directories "assets" and "templates" on the filesystem or
|
||||
-- | in its bundled Embed.FS.
|
||||
False
|
||||
, DevelMode = False
|
||||
, AppPath =
|
||||
-- | AppPath specifies where the program looks for "assets" and
|
||||
-- | "templates" in case LiveMode is True.
|
||||
"."
|
||||
, Session =
|
||||
{ CookieName = "pcmt_session"
|
||||
, CookieAuthSecret = ""
|
||||
|
@ -48,9 +85,16 @@ let Schema =
|
|||
, MaxAge = 3600
|
||||
}
|
||||
, Logger = { JSON = True, Fmt = None Text }
|
||||
, InitialAdminPassword =
|
||||
-- | used for the first admin, forced change on first login.
|
||||
"50ce50fd0e4f5894d74c4caecb450b00c594681d9397de98ffc0c76af5cff5953eb795f7"
|
||||
, Init =
|
||||
{ CreateAdmin =
|
||||
-- | if this is True, attempt to create a user with admin
|
||||
-- | privileges with the password specified below (or better -
|
||||
-- | overriden); it fails if users already exist in the DB.
|
||||
False
|
||||
, AdminPassword =
|
||||
-- | used for the first admin, forced change on first login.
|
||||
"50ce50fd0e4f5894d74c4caecb450b00c594681d9397de98ffc0c76af5cff5953eb795f7"
|
||||
}
|
||||
, Registration.Allowed = True
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ let Prelude =
|
|||
|
||||
let Schema =
|
||||
./schema.dhall
|
||||
sha256:2e7490953649881f93eec24109ef7a93738ab8fab8ccf40c33260af7faf413a5
|
||||
sha256:3f615a66aa32fc6c61a7ecfa42b809efcd42acbccf55ed7b0067bd11636debb2
|
||||
? ./schema.dhall
|
||||
|
||||
let Schema/validate
|
||||
|
@ -13,13 +13,20 @@ let Schema/validate
|
|||
=
|
||||
-- | define validation.
|
||||
\(c : Schema.Type) ->
|
||||
let expected = { validPort = True }
|
||||
let expected = { validPort = True, validSMTPPort = True }
|
||||
|
||||
let actual =
|
||||
{ validPort =
|
||||
-- | make sure port number belongs to the <1;65535> range.
|
||||
Prelude.Natural.lessThanEqual 1 c.Port
|
||||
&& Prelude.Natural.lessThanEqual c.Port 65535
|
||||
, validSMTPPort =
|
||||
if c.Mailer.Enabled == False
|
||||
then True
|
||||
else Prelude.Natural.lessThanEqual 1 c.Mailer.SMTPPort
|
||||
&& Prelude.Natural.lessThanEqual
|
||||
c.Mailer.SMTPPort
|
||||
65535
|
||||
}
|
||||
|
||||
in expected === actual
|
||||
|
|
|
@ -1 +1 @@
|
|||
let version = "0.0.0" in version
|
||||
let version = "0.0.1-rc.1" in version
|
||||
|
|
Loading…
Reference in New Issue