diff --git a/config/settings.yml b/config/settings.yml index d838b8d..19ab8f1 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -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. diff --git a/src/Constants.hs b/src/Constants.hs index 9ae381c..49f8034 100644 --- a/src/Constants.hs +++ b/src/Constants.hs @@ -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" diff --git a/src/Lib/Semver.hs b/src/Lib/Semver.hs index 3befb02..00454c6 100644 --- a/src/Lib/Semver.hs +++ b/src/Lib/Semver.hs @@ -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 diff --git a/src/Lib/Ssl.hs b/src/Lib/Ssl.hs index 2b42e0e..d1a1383 100644 --- a/src/Lib/Ssl.hs +++ b/src/Lib/Ssl.hs @@ -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