-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add per bundle certificates for static files and redirects. #163
Open
tolysz
wants to merge
7
commits into
snoyberg:master
Choose a base branch
from
tolysz:multiple-certs-sf+redir
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ecbae7d
Add per bundle certificates for static files and redirects.
tolysz 1de6179
update sample configuration
tolysz 6133e7e
add reverse proxy
tolysz e4f5dba
Use better gzip default setting i.e. serve pre compressed version `.g…
tolysz 73488a1
Update readme for systemd being used in ubuntu
mac10688 a8ad8a2
Changed configuration of keter service from Upstart to systemd.
frt 7e54bcc
* Builds with `process` 1.6
tolysz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,6 +235,7 @@ data StaticFilesConfig = StaticFilesConfig | |
-- FIXME basic auth | ||
, sfconfigMiddleware :: ![ MiddlewareConfig ] | ||
, sfconfigTimeout :: !(Maybe Int) | ||
, sfconfigSsl :: !SSLConfig | ||
} | ||
deriving Show | ||
|
||
|
@@ -246,6 +247,7 @@ instance ToCurrent StaticFilesConfig where | |
, sfconfigListings = True | ||
, sfconfigMiddleware = [] | ||
, sfconfigTimeout = Nothing | ||
, sfconfigSsl = SSLFalse | ||
} | ||
|
||
instance ParseYamlFile StaticFilesConfig where | ||
|
@@ -255,6 +257,7 @@ instance ParseYamlFile StaticFilesConfig where | |
<*> o .:? "directory-listing" .!= False | ||
<*> o .:? "middleware" .!= [] | ||
<*> o .:? "connection-time-bound" | ||
<*> o .:? "ssl" .!= SSLFalse | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to have an example, even if it's "commented out" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated, but it is exactly the same syntax as for webapp |
||
|
||
instance ToJSON StaticFilesConfig where | ||
toJSON StaticFilesConfig {..} = object | ||
|
@@ -263,12 +266,14 @@ instance ToJSON StaticFilesConfig where | |
, "directory-listing" .= sfconfigListings | ||
, "middleware" .= sfconfigMiddleware | ||
, "connection-time-bound" .= sfconfigTimeout | ||
, "ssl" .= sfconfigSsl | ||
] | ||
|
||
data RedirectConfig = RedirectConfig | ||
{ redirconfigHosts :: !(Set Host) | ||
, redirconfigStatus :: !Int | ||
, redirconfigActions :: !(Vector RedirectAction) | ||
, redirconfigSsl :: !SSLConfig | ||
} | ||
deriving Show | ||
|
||
|
@@ -279,19 +284,22 @@ instance ToCurrent RedirectConfig where | |
, redirconfigStatus = 301 | ||
, redirconfigActions = V.singleton $ RedirectAction SPAny | ||
$ RDPrefix False (CI.mk to) Nothing | ||
, redirconfigSsl = SSLFalse | ||
} | ||
|
||
instance ParseYamlFile RedirectConfig where | ||
parseYamlFile _ = withObject "RedirectConfig" $ \o -> RedirectConfig | ||
<$> (Set.map CI.mk <$> ((o .: "hosts" <|> (Set.singleton <$> (o .: "host"))))) | ||
<*> o .:? "status" .!= 303 | ||
<*> o .: "actions" | ||
<*> o .:? "ssl" .!= SSLFalse | ||
|
||
instance ToJSON RedirectConfig where | ||
toJSON RedirectConfig {..} = object | ||
[ "hosts" .= Set.map CI.original redirconfigHosts | ||
, "status" .= redirconfigStatus | ||
, "actions" .= redirconfigActions | ||
, "ssl" .= redirconfigSsl | ||
] | ||
|
||
data RedirectAction = RedirectAction !SourcePath !RedirectDest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ flags: | |
packages: | ||
- '.' | ||
extra-deps: [] | ||
resolver: lts-5.0 | ||
resolver: lts-7.19 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's missing to support this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pointer for others, I am happy with an absolute path.
I.e. I am using
letsencrypt
via https://github.com/lukas2511/dehydrated to generate certs in a fixed location in the filesystem (and I have to regenerate them every couple of months), then have my bundles to point to that absolute folders.