mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
Initial Stackage upload code
This commit is contained in:
parent
95250c5b09
commit
b978bcc2bb
@ -34,6 +34,7 @@ import Handler.Profile
|
|||||||
import Handler.Email
|
import Handler.Email
|
||||||
import Handler.ResetToken
|
import Handler.ResetToken
|
||||||
import Handler.HackageSdist
|
import Handler.HackageSdist
|
||||||
|
import Handler.UploadStackage
|
||||||
|
|
||||||
-- This line actually creates our YesodDispatch instance. It is the second half
|
-- 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
|
-- of the call to mkYesodData which occurs in Foundation.hs. Please see the
|
||||||
|
|||||||
6
Model.hs
6
Model.hs
@ -1,11 +1,9 @@
|
|||||||
module Model where
|
module Model where
|
||||||
|
|
||||||
import Prelude
|
import ClassyPrelude.Yesod
|
||||||
import Yesod
|
|
||||||
import Data.Text (Text)
|
|
||||||
import Database.Persist.Quasi
|
import Database.Persist.Quasi
|
||||||
import Data.Typeable (Typeable)
|
|
||||||
import Data.Slug (Slug)
|
import Data.Slug (Slug)
|
||||||
|
import Types
|
||||||
|
|
||||||
-- You can define all of your database entities in the entities file.
|
-- You can define all of your database entities in the entities file.
|
||||||
-- You can find more information on persistent and how to declare entities
|
-- You can find more information on persistent and how to declare entities
|
||||||
|
|||||||
3
Types.hs
3
Types.hs
@ -3,13 +3,14 @@ module Types where
|
|||||||
import ClassyPrelude.Yesod
|
import ClassyPrelude.Yesod
|
||||||
import Data.BlobStore (ToPath (..))
|
import Data.BlobStore (ToPath (..))
|
||||||
import Text.Blaze (ToMarkup)
|
import Text.Blaze (ToMarkup)
|
||||||
|
import Database.Persist.Sql (PersistFieldSql)
|
||||||
|
|
||||||
newtype PackageName = PackageName { unPackageName :: Text }
|
newtype PackageName = PackageName { unPackageName :: Text }
|
||||||
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
|
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
|
||||||
newtype Version = Version { unVersion :: Text }
|
newtype Version = Version { unVersion :: Text }
|
||||||
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
|
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
|
||||||
newtype PackageSetIdent = PackageSetIdent { unPackageSetIdent :: Text }
|
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
|
data StoreKey = HackageCabal !PackageName !Version
|
||||||
| HackageSdist !PackageName !Version
|
| HackageSdist !PackageName !Version
|
||||||
|
|||||||
@ -13,3 +13,11 @@ Email
|
|||||||
Verkey
|
Verkey
|
||||||
email Text
|
email Text
|
||||||
verkey Text
|
verkey Text
|
||||||
|
|
||||||
|
Stackage
|
||||||
|
user UserId
|
||||||
|
ident PackageSetIdent
|
||||||
|
uploaded UTCTime
|
||||||
|
title Text
|
||||||
|
desc Text
|
||||||
|
UniqueStackage ident
|
||||||
|
|||||||
@ -9,3 +9,4 @@
|
|||||||
/email/#EmailId EmailR DELETE
|
/email/#EmailId EmailR DELETE
|
||||||
/reset-token ResetTokenR POST
|
/reset-token ResetTokenR POST
|
||||||
/hackage/#PackageName/#Version HackageSdistR GET
|
/hackage/#PackageName/#Version HackageSdistR GET
|
||||||
|
/upload UploadStackageR GET PUT
|
||||||
|
|||||||
@ -28,6 +28,7 @@ library
|
|||||||
Handler.Email
|
Handler.Email
|
||||||
Handler.ResetToken
|
Handler.ResetToken
|
||||||
Handler.HackageSdist
|
Handler.HackageSdist
|
||||||
|
Handler.UploadStackage
|
||||||
|
|
||||||
if flag(dev) || flag(library-only)
|
if flag(dev) || flag(library-only)
|
||||||
cpp-options: -DDEVELOPMENT
|
cpp-options: -DDEVELOPMENT
|
||||||
@ -88,10 +89,18 @@ library
|
|||||||
, blaze-markup >= 0.6 && < 0.7
|
, blaze-markup >= 0.6 && < 0.7
|
||||||
, ghc-prim
|
, ghc-prim
|
||||||
, system-fileio
|
, system-fileio
|
||||||
|
, system-filepath
|
||||||
, resourcet
|
, resourcet
|
||||||
, aws >= 0.9 && < 0.10
|
, aws >= 0.9 && < 0.10
|
||||||
, conduit-extra
|
, conduit-extra
|
||||||
, tar >= 0.4 && < 0.5
|
, 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
|
executable stackage-server
|
||||||
if flag(library-only)
|
if flag(library-only)
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
<h2>Browse stackages
|
||||||
|
|
||||||
|
FIXME!
|
||||||
|
|
||||||
|
<h2>Upload
|
||||||
|
|
||||||
|
<a href=@{UploadStackageR}>Upload
|
||||||
Loading…
Reference in New Issue
Block a user