diff options
author | Vincent Ambo <tazjin@google.com> | 2019-08-19T23·17+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2019-08-19T23·17+0100 |
commit | 11fcf6229751eb266485cbba78d30aced1787d14 (patch) | |
tree | 025f02ca1d1288949f69468e32d9efe795db02a7 /services/tazblog/db/Main.hs | |
parent | 1d5b53abf8da7b00ac1e58d43a30f738c157b9d3 (diff) |
chore(tazblog): Replace BlogDB with stubs for DNS-based storage r/44
Removes acid-state specific code and the former BlogDB module, in its stead the new BlogStorage module contains stubs for the functions that will be filled in with DNS-based storage. This code is unformatted and will not currently serve a working blog.
Diffstat (limited to 'services/tazblog/db/Main.hs')
-rw-r--r-- | services/tazblog/db/Main.hs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/services/tazblog/db/Main.hs b/services/tazblog/db/Main.hs deleted file mode 100644 index 9523041f109a..000000000000 --- a/services/tazblog/db/Main.hs +++ /dev/null @@ -1,34 +0,0 @@ --- | Main module for the database server -module Main where - -import BlogDB (initialBlogState) -import Control.Applicative (pure, (<$>), (<*>)) -import Control.Exception (bracket) -import Data.Acid -import Data.Acid.Local (createCheckpointAndClose) -import Data.Acid.Remote -import Data.Word -import Network (PortID (..)) -import Options - -data DBOptions = DBOptions { - dbPort :: Word16, - stateDirectory :: String -} - -instance Options DBOptions where - defineOptions = pure DBOptions - <*> simpleOption "dbport" 8070 - "Port to serve acid-state on remotely." - <*> simpleOption "state" "/var/tazblog/state" - "Directory in which the acid-state is located." - -main :: IO () -main = do - putStrLn ("Launching TazBlog database server ...") - runCommand $ \opts args -> - bracket (openState opts) createCheckpointAndClose - (acidServer skipAuthenticationCheck $ getPort opts) - where - openState o = openLocalStateFrom (stateDirectory o) initialBlogState - getPort = PortNumber . fromIntegral . dbPort |