cabal-version:      3.0
name:               sabela-hub
version:            0.1.0.0
synopsis:           Session proxy for multi-user Sabela deployment
license:            MIT
license-file:       ../LICENSE
author:             DataHaskell
build-type:         Simple

common warnings
    ghc-options: -Wall

library
    import:           warnings
    exposed-modules:  Hub.Types,
                      Hub.Allowlist,
                      Hub.Config,
                      Hub.Meta,
                      Hub.Users,
                      Hub.Gallery,
                      Hub.Gallery.Store,
                      Hub.Gallery.Render,
                      Hub.Gallery.Style,
                      Hub.Gallery.Chrome,
                      Hub.Gallery.Feed,
                      Hub.Gallery.Public,
                      Hub.Gallery.Seed,
                      Hub.Gallery.SeedRender,
                      Hub.Gallery.SeedAssets,
                      Hub.Gallery.Lyah,
                      Hub.Gallery.Lyah.Convert,
                      Hub.Gallery.Lyah.Code,
                      Hub.Fork,
                      Hub.Admin.Api,
                      Hub.Admin.Page,
                      Hub.Ecs,
                      Hub.Docker,
                      Hub.OAuth,
                      Hub.CliAuth,
                      Hub.CliAuth.Page,
                      Hub.Session,
                      Hub.Proxy,
                      Hub.Proxy.Forward,
                      Hub.Pages,
                      Hub.Auth,
                      Hub.Shares.Api,
                      Hub.Reaper,
                      Hub.Banner,
                      Hub.Runner,
                      Hub.Republish,
                      Hub.Share
    build-depends:    base >= 4 && < 5,
                      aeson >= 2 && < 3,
                      bytestring >= 0.10 && < 0.13,
                      containers >= 0.6 && < 0.9,
                      directory >= 1.3 && < 1.4,
                      filepath >= 1.4 && < 1.6,
                      http-client >= 0.7 && < 0.8,
                      http-client-tls >= 0.3 && < 0.4,
                      http-types >= 0.12 && < 0.13,
                      process >= 1.6 && < 1.8,
                      stm >= 2.4 && < 3,
                      text >= 1.2 && < 3,
                      time >= 1.9 && < 2,
                      wai >= 3.2 && < 3.3,
                      warp >= 3.3 && < 3.5
    hs-source-dirs:   src
    default-language: Haskell2010

executable sabela-hub
    import:           warnings
    main-is:          Main.hs
    build-depends:    base >= 4 && < 5,
                      sabela-hub,
                      directory >= 1.3 && < 1.4,
                      http-client >= 0.7 && < 0.8,
                      http-client-tls >= 0.3 && < 0.4,
                      stm >= 2.4 && < 3,
                      text >= 1.2 && < 3,
                      warp >= 3.3 && < 3.5
    hs-source-dirs:   app
    default-language: Haskell2010
    ghc-options:      -threaded -rtsopts "-with-rtsopts=-N"

test-suite sabela-hub-test
    import:           warnings
    type:             exitcode-stdio-1.0
    main-is:          Main.hs
    other-modules:    Test.MockEcs,
                      Test.AllowlistSpec,
                      Test.AuthSpec,
                      Test.SessionSpec,
                      Test.ReaperSpec,
                      Test.ProxyHelpers,
                      Test.ProxyRoutesSpec,
                      Test.ProxySpec,
                      Test.DockerSpec,
                      Test.ShareSpec,
                      Test.UsersSpec,
                      Test.GallerySpec,
                      Test.GalleryRenderSpec,
                      Test.BannerSpec,
                      Test.RunnerSpec,
                      Test.CliAuthSpec,
                      Test.SeedSpec,
                      Test.LyahSpec,
                      Test.SeedRenderSpec,
                      Test.AdminApiSpec
    build-depends:    base >= 4 && < 5,
                      sabela-hub,
                      aeson >= 2 && < 3,
                      bytestring >= 0.10 && < 0.13,
                      containers >= 0.6 && < 0.9,
                      directory >= 1.3 && < 1.4,
                      filepath >= 1.4 && < 1.6,
                      hspec >= 2 && < 3,
                      http-client >= 0.7 && < 0.8,
                      http-client-tls >= 0.3 && < 0.4,
                      http-types >= 0.12 && < 0.13,
                      QuickCheck >= 2.14 && < 3,
                      stm >= 2.4 && < 3,
                      text >= 1.2 && < 3,
                      time >= 1.9 && < 2,
                      wai >= 3.2 && < 3.3,
                      wai-extra >= 3.1 && < 3.2,
                      warp >= 3.3 && < 3.5
    hs-source-dirs:   test
    default-language: Haskell2010
    ghc-options:      -threaded
