mirror of
https://github.com/Start9Labs/registry.git
synced 2026-04-01 20:44:15 +00:00
static path for appmgr and other feedback
This commit is contained in:
@@ -88,20 +88,14 @@ getSysR e = do
|
||||
|
||||
getAppManifestR :: Extension "s9pk" -> Text -> Handler TypedContent
|
||||
getAppManifestR e@(Extension appId) v = do
|
||||
appmgrVersion <- lookupGetParam "appmgr" >>= \case
|
||||
Nothing -> sendResponseStatus status400 ("Appmgr version required" :: Text)
|
||||
Just a -> pure $ toS a
|
||||
appMgrDir <- (<> "/") . (</> appmgrVersion) . (</> "appmgr") . (</> "sys") . resourcesDir . appSettings <$> getYesod
|
||||
appMgrDir <- (<> "/") . staticBinDir . appSettings <$> getYesod
|
||||
appDir <- (<> "/") . (</> toS v) . (</> appId) . (</> "apps") . resourcesDir . appSettings <$> getYesod
|
||||
manifest <- handleS9ErrT $ getManifest appMgrDir appDir e
|
||||
pure $ TypedContent "application/json" (toContent manifest)
|
||||
|
||||
getAppConfigR :: Extension "s9pk" -> Text -> Handler TypedContent
|
||||
getAppConfigR e@(Extension appId) v = do
|
||||
appmgrVersion <- lookupGetParam "appmgr" >>= \case
|
||||
Nothing -> sendResponseStatus status400 ("Appmgr version required" :: Text)
|
||||
Just a -> pure $ toS a
|
||||
appMgrDir <- (<> "/") . (</> appmgrVersion) . (</> "appmgr") . (</> "sys") . resourcesDir . appSettings <$> getYesod
|
||||
appMgrDir <- (<> "/") . staticBinDir . appSettings <$> getYesod
|
||||
appDir <- (<> "/") . (</> toS v) . (</> appId) . (</> "apps") . resourcesDir . appSettings <$> getYesod
|
||||
config <- handleS9ErrT $ getConfig appMgrDir appDir e
|
||||
pure $ TypedContent "application/json" (toContent config)
|
||||
|
||||
@@ -50,6 +50,7 @@ data AppSettings = AppSettings
|
||||
, sslCsrLocation :: FilePath
|
||||
, sslCertLocation :: FilePath
|
||||
, torPort :: AppPort
|
||||
, staticBinDir :: FilePath
|
||||
}
|
||||
|
||||
instance FromJSON AppSettings where
|
||||
@@ -64,6 +65,7 @@ instance FromJSON AppSettings where
|
||||
sslPath <- o .: "ssl-path"
|
||||
registryHostname <- o .: "registry-hostname"
|
||||
torPort <- o .: "tor-port"
|
||||
staticBinDir <- o .: "static-bin-dir"
|
||||
|
||||
let sslKeyLocation = sslPath </> "key.pem"
|
||||
let sslCsrLocation = sslPath </> "certificate.csr"
|
||||
|
||||
Reference in New Issue
Block a user