Initial Stackage upload code

This commit is contained in:
Michael Snoyman 2014-04-10 12:46:37 +03:00
parent 95250c5b09
commit b978bcc2bb
7 changed files with 30 additions and 5 deletions

View File

@ -34,6 +34,7 @@ import Handler.Profile
import Handler.Email
import Handler.ResetToken
import Handler.HackageSdist
import Handler.UploadStackage
-- This line actually creates our YesodDispatch instance. It is the second half
-- of the call to mkYesodData which occurs in Foundation.hs. Please see the

View File

@ -1,11 +1,9 @@
module Model where
import Prelude
import Yesod
import Data.Text (Text)
import ClassyPrelude.Yesod
import Database.Persist.Quasi
import Data.Typeable (Typeable)
import Data.Slug (Slug)
import Types
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities

View File

@ -3,13 +3,14 @@ module Types where
import ClassyPrelude.Yesod
import Data.BlobStore (ToPath (..))
import Text.Blaze (ToMarkup)
import Database.Persist.Sql (PersistFieldSql)
newtype PackageName = PackageName { unPackageName :: Text }
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
newtype Version = Version { unVersion :: Text }
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
newtype PackageSetIdent = PackageSetIdent { unPackageSetIdent :: Text }
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup, PersistField, PersistFieldSql)
data StoreKey = HackageCabal !PackageName !Version
| HackageSdist !PackageName !Version

View File

@ -13,3 +13,11 @@ Email
Verkey
email Text
verkey Text
Stackage
user UserId
ident PackageSetIdent
uploaded UTCTime
title Text
desc Text
UniqueStackage ident

View File

@ -9,3 +9,4 @@
/email/#EmailId EmailR DELETE
/reset-token ResetTokenR POST
/hackage/#PackageName/#Version HackageSdistR GET
/upload UploadStackageR GET PUT

View File

@ -28,6 +28,7 @@ library
Handler.Email
Handler.ResetToken
Handler.HackageSdist
Handler.UploadStackage
if flag(dev) || flag(library-only)
cpp-options: -DDEVELOPMENT
@ -88,10 +89,18 @@ library
, blaze-markup >= 0.6 && < 0.7
, ghc-prim
, system-fileio
, system-filepath
, resourcet
, aws >= 0.9 && < 0.10
, conduit-extra
, tar >= 0.4 && < 0.5
, temporary >= 1.2 && < 1.3
, cryptohash-conduit >= 0.1.1 && < 0.2
, exceptions
, byteable
, cryptohash
, base64-bytestring
, zlib
executable stackage-server
if flag(library-only)

View File

@ -0,0 +1,7 @@
<h2>Browse stackages
FIXME!
<h2>Upload
<a href=@{UploadStackageR}>Upload