Compare commits

..

No commits in common. "master" and "jswt" have entirely different histories.
master ... jswt

7 changed files with 29 additions and 54 deletions

2
.gitignore vendored
View file

@ -12,5 +12,3 @@ report.html
*.save*
.envrc
.direnv/
.hie/
stan.html

View file

@ -11,37 +11,27 @@ module Main where
import Prelude as P
import Crypto.JWT hiding (Context, header)
import Crypto.JOSE.JWK hiding (Context)
import Control.Concurrent.STM.TVar
import Control.Concurrent.STM (newTQueueIO)
import Control.Concurrent (forkIO)
import Control.Lens hiding (Context)
import Control.Monad (void, unless)
import Control.Monad.Reader
import Servant
import Servant.Server.Experimental.Auth
import qualified Servant.OpenApi as OA
import Servant.Swagger.UI
import Servant.RawM.Server
import Servant.RawM
import qualified Data.Aeson as A
import Data.Set as S (empty)
import qualified Data.ByteString.Lazy as B
import Data.ByteString.Char8 as B8 hiding (putStrLn)
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import Data.String
import Data.Yaml
import Data.Version (showVersion)
import qualified Data.OpenApi as OA hiding (Server)
import Database.PostgreSQL.Simple
@ -52,6 +42,12 @@ import Network.Wai
import Network.Wai.Logger
import Network.Wai.Handler.Warp
import Control.Monad.Reader
import Control.Concurrent.STM.TVar
import Control.Lens hiding (Context)
import Options.Applicative
import System.Clock (TimeSpec(..))
@ -153,6 +149,7 @@ main = do
, rsJWTSecret =
fromOctets . B.fromStrict $ TE.encodeUtf8 jwt_secret
}
expirationSpec = TimeSpec 5 0 -- five seconds
runSettings settings (app initState)
where
opts = info (options <**> helper)

View file

@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1725059563,
"narHash": "sha256-laJvLHrSU5M9zWlejH7H67HdpLhcUI6uPDa4rX7eUuE=",
"lastModified": 1709116111,
"narHash": "sha256-V7BbC39cGDOzJsCsmg+hCdBu1Tuhqs7kLcPxw86STh4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0abfc619bcb605299a0f3f01c1887bb65db61a6b",
"rev": "b84d9f029fa675d5ef312f032f322889149daa82",
"type": "github"
},
"original": {

View file

@ -72,22 +72,10 @@ library
-- Modules included in this library but not exported.
-- other-modules:
default-extensions:
StrictData
other-extensions:
DataKinds
TypeOperators
FlexibleInstances
MultiParamTypeClasses
RankNTypes
ScopedTypeVariables
FlexibleContexts
OverloadedStrings
Arrows
CPP
LambdaCase
DeriveGeneric
TypeFamilies
DataKinds TypeOperators FlexibleInstances MultiParamTypeClasses
RankNTypes ScopedTypeVariables FlexibleContexts OverloadedStrings
Arrows CPP LambdaCase DeriveGeneric TypeFamilies
TypeSynonymInstances
build-depends:
@ -105,6 +93,7 @@ library
, servant
, servant-server
, servant-openapi3
, servant-rawm >= 0.3.0.0
, servant-rawm-server
, opaleye
, aeson
@ -122,14 +111,12 @@ library
, haskell-gettext
, mime-mail
, directory
, jose >= 0.10
, jose
, monad-time
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
-fwrite-ide-info
-hiedir=.hie
executable mateamt
main-is: Main.hs
@ -140,8 +127,6 @@ executable mateamt
AppTypes.Configuration
Janitor
Paths_mateamt
default-extensions:
StrictData
other-extensions:
DataKinds TypeOperators FlexibleInstances MultiParamTypeClasses
RankNTypes ScopedTypeVariables FlexibleContexts OverloadedStrings
@ -166,7 +151,7 @@ executable mateamt
, network
, servant
, servant-server
, servant-rawm-server
, servant-rawm
, servant-openapi3
, servant-swagger-ui
, servant-swagger-ui-core
@ -185,8 +170,6 @@ executable mateamt
hs-source-dirs: app
default-language: Haskell2010
ghc-options: -Wall
-fwrite-ide-info
-hiedir=.hie
-- test-suite mateamt-test
-- default-language: Haskell2010

View file

@ -13,7 +13,8 @@ import Servant.Server
import Data.Proxy
import Servant.RawM.Server
import Servant.RawM
import Servant.RawM.Server ()
-- internal imports
@ -123,7 +124,7 @@ journalShowLink :: Maybe Int -> Maybe Int -> Link
journalPostCheck :: Link
avatarGetLink :: Int -> Link
avatarInsertLink :: Link
avaterInsertLink :: Link
avatarUpdateLink :: Int -> Link
avatarListLink :: Link
@ -136,7 +137,7 @@ roleAssociationSubmitLink :: Link
roleAssociationDeleteLink :: Link
settingsGetLink :: Link
settingsUpdateLink :: Link
settingsUpdateLnk :: Link
metaGetLink :: Link
@ -167,7 +168,7 @@ metaGetLink :: Link
journalPostCheck :<|>
avatarGetLink :<|>
avatarInsertLink :<|>
avaterInsertLink :<|>
avatarUpdateLink :<|>
avatarListLink :<|>
@ -180,7 +181,7 @@ metaGetLink :: Link
roleAssociationDeleteLink :<|>
settingsGetLink :<|>
settingsUpdateLink :<|>
settingsUpdateLnk :<|>
metaGetLink
) = allLinks (Proxy :: Proxy MateAPI)

View file

@ -11,10 +11,8 @@ metaGet :: MateHandler MetaInformation
metaGet = do
symbol <- asks rsCurrencySymbol
version <- asks rsSoftwareVersion
decimals <- asks rsCurrencyFraction
return (MetaInformation
{ metaInfoVersion = version
, metaInfoCurrency = symbol
, metaInfoDecimals = fromIntegral decimals
}
)

View file

@ -1,8 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Control.Settings where
import Control.Monad (void, unless)
import Control.Monad.Reader
import Servant