update routes

This commit is contained in:
Aaron Greenspan
2019-12-24 15:35:06 -07:00
parent 228264ebb5
commit 3e3dad056e
4 changed files with 9 additions and 12 deletions

View File

@@ -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.

View File

@@ -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"

View File

@@ -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

View File

@@ -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