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