Implements uploads, index, and deindex

This commit is contained in:
Keagan McClelland
2022-05-24 18:06:02 -06:00
parent 79323465db
commit 4c8cba18a2
9 changed files with 265 additions and 76 deletions

View File

@@ -85,7 +85,6 @@ data RegistryCtx = RegistryCtx
, appWebServerThreadId :: MVar (ThreadId, ThreadId)
, appShouldRestartWeb :: MVar Bool
, appConnPool :: ConnectionPool
, appStopFsNotifyPkg :: IO Bool
, appStopFsNotifyEos :: IO Bool
}
instance Has PkgRepo RegistryCtx where
@@ -196,6 +195,9 @@ instance Yesod RegistryCtx where
pure $ if hasAuthId then Authorized else Unauthorized "This feature is for admins only"
| otherwise = pure Authorized
maximumContentLengthIO :: RegistryCtx -> Maybe (Route RegistryCtx) -> IO (Maybe Word64)
maximumContentLengthIO _ (Just PkgUploadR) = pure Nothing
maximumContentLengthIO _ _ = pure $ Just 2097152 -- the original default
-- How to run database actions.
instance YesodPersist RegistryCtx where