import OpenSSL
import Rakka.Environment
import Rakka.Resource.CheckAuth
+import Rakka.Resource.DumpRepos
import Rakka.Resource.Index
import Rakka.Resource.JavaScript
import Rakka.Resource.PageEntity
resTree env
= mkResTree [ ([] , resIndex env)
, (["checkAuth" ], resCheckAuth env)
+ , (["dumpRepos" ], resDumpRepos env)
, (["js" ], javaScript )
, (["object" ], resObject env)
, (["render" ], resRender env)
Executable rakka
Build-Depends:
- FileManip, HTTP, HUnit, HsHyperEstraier, HsOpenSSL, HsSVN,
- Lucu, base, bytestring, containers, dataenc, directory,
+ FileManip, HTTP, HUnit, HsHyperEstraier, HsOpenSSL, HsSVN >=
+ 0.3.1, Lucu, base, bytestring, containers, dataenc, directory,
utf8-string, filepath, hslogger, hxt, magic, mtl, network,
parsec, stm, time, unix, zlib
Main-Is:
Rakka.Page
Rakka.Resource
Rakka.Resource.CheckAuth
+ Rakka.Resource.DumpRepos
Rakka.Resource.Index
Rakka.Resource.JavaScript
Rakka.Resource.Object
--- /dev/null
+module Rakka.Resource.DumpRepos
+ ( resDumpRepos
+ )
+ where
+
+import Control.Monad.Trans
+import Network.HTTP.Lucu
+import Rakka.Environment
+import Subversion.Repository
+
+resDumpRepos :: Environment -> ResourceDef
+resDumpRepos env
+ = ResourceDef {
+ resUsesNativeThread = False
+ , resIsGreedy = False
+ , resGet = Just $ dumpRepos $ envRepository env
+ , resHead = Nothing
+ , resPost = Nothing
+ , resPut = Nothing
+ , resDelete = Nothing
+ }
+
+
+dumpRepos :: Repository -> Resource ()
+dumpRepos repos
+ = do setContentType $ read "application/octet-stream"
+ -- FIXME: 最終更新時刻が判るはず。
+ dump <- liftIO $ dumpRepository repos Nothing Nothing False True
+ outputLBS dump