mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 10:21:51 +00:00
update routes
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
static-dir: "_env:YESOD_STATIC_DIR:static"
|
||||
host: "_env:YESOD_HOST:*4" # any IPv4 host
|
||||
port: "_env:YESOD_PORT:3000" # NB: The port `yesod devel` uses is distinct from this value. Set the `yesod devel` port from the command line.
|
||||
port: "_env:YESOD_PORT:443" # NB: The port `yesod devel` uses is distinct from this value. Set the `yesod devel` port from the command line.
|
||||
ip-from-header: "_env:YESOD_IP_FROM_HEADER:false"
|
||||
|
||||
# Default behavior: determine the application root from the request headers.
|
||||
|
||||
@@ -8,8 +8,8 @@ import Lib.Types.Semver
|
||||
import Paths_start9_registry (version)
|
||||
import Startlude
|
||||
|
||||
configPath :: FilePath
|
||||
configPath = "./config"
|
||||
sslPath :: FilePath
|
||||
sslPath = "/var/ssl"
|
||||
|
||||
resourcesPath :: FilePath
|
||||
resourcesPath = "/var/www/html/resources"
|
||||
|
||||
@@ -10,11 +10,11 @@ import Lib.Types.Semver
|
||||
(<||) a (AppVersionSpecification SVGreaterThan av1) = version a > av1
|
||||
(<||) a (AppVersionSpecification SVLessThanEq av1) = version a <= av1
|
||||
(<||) a (AppVersionSpecification SVGreaterThanEq av1) = version a >= av1
|
||||
(<||) a (AppVersionSpecification SVGreatestWithMajor av1)
|
||||
(<||) a (AppVersionSpecification SVGreatestWithMajor av1) -- "maj.*"
|
||||
= major av == major av1 && av >= av1
|
||||
where
|
||||
av = version a
|
||||
(<||) a (AppVersionSpecification SVGreatestWithMajorMinor av1)
|
||||
(<||) a (AppVersionSpecification SVGreatestWithMajorMinor av1) -- "maj.min.*"
|
||||
= major av == major av1 && minor av == minor av1 && av >= av1
|
||||
where
|
||||
av = version a
|
||||
|
||||
@@ -14,17 +14,14 @@ import Constants
|
||||
-- openssl req -new -key key.pem -out certificate.csr
|
||||
-- openssl x509 -req -in certificate.csr -signkey key.pem -out certificate.pem
|
||||
|
||||
sslBaseLocation :: FilePath
|
||||
sslBaseLocation = configPath </> "ssl"
|
||||
|
||||
sslKeyLocation :: FilePath
|
||||
sslKeyLocation = sslBaseLocation </> "key.pem"
|
||||
sslKeyLocation = sslPath </> "key.pem"
|
||||
|
||||
sslCsrLocation :: FilePath
|
||||
sslCsrLocation = sslBaseLocation </> "certificate.csr"
|
||||
sslCsrLocation = sslPath </> "certificate.csr"
|
||||
|
||||
sslCertLocation :: FilePath
|
||||
sslCertLocation = sslBaseLocation </> "certificate.pem"
|
||||
sslCertLocation = sslPath </> "certificate.pem"
|
||||
|
||||
checkForSslCert :: IO Bool
|
||||
checkForSslCert =
|
||||
@@ -55,7 +52,7 @@ setupSsl :: IO ()
|
||||
setupSsl = do
|
||||
exists <- checkForSslCert
|
||||
unless exists $ do
|
||||
void $ system $ "mkdir -p " <> sslBaseLocation
|
||||
void $ system $ "mkdir -p " <> sslPath
|
||||
void generateSslKey
|
||||
void $ generateSslCert getRegistryHostname
|
||||
void selfSignSslCert
|
||||
|
||||
Reference in New Issue
Block a user