diff --git a/src/Constants.hs b/src/Constants.hs index 49f8034..62c2f80 100644 --- a/src/Constants.hs +++ b/src/Constants.hs @@ -11,8 +11,8 @@ import Startlude sslPath :: FilePath sslPath = "/var/ssl" -resourcesPath :: FilePath -resourcesPath = "/var/www/html/resources" +resourcesDir :: FilePath +resourcesDir = "/var/www/html/resources" registryVersion :: AppVersion registryVersion = fromJust . parseMaybe parseJSON . String . toS . showVersion $ version diff --git a/src/Handler/Apps.hs b/src/Handler/Apps.hs index cced7a8..eb29d26 100644 --- a/src/Handler/Apps.hs +++ b/src/Handler/Apps.hs @@ -17,6 +17,7 @@ import qualified GHC.Show (Show (..)) import System.Directory import Yesod.Core +import Constants import Foundation import Handler.Types.Status import Lib.Registry @@ -39,7 +40,7 @@ getAppsManifestR :: Handler TypedContent getAppsManifestR = respondSource typePlain $ CB.sourceFile appManifestPath .| awaitForever sendChunkBS getImageR :: Handler TypedContent -getImageR = getApp sysResourceDir ("image" :: Extension "") +getImageR = getApp resourcesDir ("sys" :: Extension "tar.gz") getAgentR :: Handler TypedContent getAgentR = getApp sysResourceDir ("agent" :: Extension "") diff --git a/src/Lib/Registry.hs b/src/Lib/Registry.hs index 284ffd0..e9838b8 100644 --- a/src/Lib/Registry.hs +++ b/src/Lib/Registry.hs @@ -21,13 +21,13 @@ import Lib.Semver import Lib.Types.Semver appResourceDir :: FilePath -appResourceDir = resourcesPath "apps" +appResourceDir = resourcesDir "apps" sysResourceDir :: FilePath -sysResourceDir = resourcesPath "sys" +sysResourceDir = resourcesDir "sys" iconsResourceDir :: FilePath -iconsResourceDir = resourcesPath "icons" +iconsResourceDir = resourcesDir "icons" appManifestPath :: FilePath appManifestPath = appResourceDir appManifestFile