summary refs log tree commit diff
path: root/services/tazblog/blog
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-08-19T23·17+0100
committerVincent Ambo <tazjin@google.com>2019-08-19T23·17+0100
commit11fcf6229751eb266485cbba78d30aced1787d14 (patch)
tree025f02ca1d1288949f69468e32d9efe795db02a7 /services/tazblog/blog
parent1d5b53abf8da7b00ac1e58d43a30f738c157b9d3 (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/blog')
-rw-r--r--services/tazblog/blog/Main.hs17
1 files changed, 2 insertions, 15 deletions
diff --git a/services/tazblog/blog/Main.hs b/services/tazblog/blog/Main.hs
index cfe068a8d9..246f1325e7 100644
--- a/services/tazblog/blog/Main.hs
+++ b/services/tazblog/blog/Main.hs
@@ -1,11 +1,8 @@
 -- | Main module for the blog's web server
 module Main where
 
-import           BlogDB              (initialBlogState)
-import           Control.Applicative (pure, (<$>), (<*>))
+import           Control.Applicative (pure, (<*>))
 import           Control.Exception   (bracket)
-import           Data.Acid
-import           Data.Acid.Remote
 import           Data.Word           (Word16)
 import           Locales             (version)
 import           Network             (HostName, PortID (..))
@@ -13,18 +10,12 @@ import           Options
 import           Server
 
 data MainOptions = MainOptions {
-  dbHost      :: String,
-  dbPort      :: Word16,
   blogPort    :: Int,
   resourceDir :: String
 }
 
 instance Options MainOptions where
   defineOptions = pure MainOptions
-    <*> simpleOption "dbHost" "localhost"
-        "Remote acid-state database host. Default is localhost"
-    <*> simpleOption "dbPort" 8070
-        "Remote acid-state database port. Default is 8070"
     <*> simpleOption "blogPort" 8000
         "Port to serve the blog on. Default is 8000."
     <*> simpleOption "resourceDir" "/opt/tazblog/static"
@@ -34,8 +25,4 @@ main :: IO()
 main = do
     putStrLn ("TazBlog " ++ version ++ " in Haskell starting")
     runCommand $ \opts _ ->
-      let port = PortNumber $ fromIntegral $ dbPort opts
-      in openRemoteState skipAuthenticationPerform (dbHost opts) port >>=
-              (\acid -> runBlog acid (blogPort opts) (resourceDir opts))
-
-
+      runBlog (blogPort opts) (resourceDir opts)