-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Caddyfile snippets #1921
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
Merged
Merged
Caddyfile snippets #1921
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
425f611
initial implementation of caddyfile macros
3a969bc
add nil check
dd4b3ef
remove 'macro foo' syntax
68a495f
actually return error on redeclaration
1889049
Merge branch 'master' into macros
02ac1f6
retrigger build
5c9fc3a
Merge branch 'macros' of github.com:mholt/caddy into macros
91a60a8
Merge branch 'master' into macros
ad2956f
snippets now
4ec5522
Merge branch 'macros' of github.com:mholt/caddy into macros
9ebc11d
Merge branch 'master' into macros
tobya 345b312
Merge branch 'master' into macros
tobya 8658e18
Merge branch 'master' into macros
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 hidden or 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 hidden or 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
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.
Why TrimSuffix instead of just
[1:len(keys[0])-1]
?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.
Can we explicitly check here that the snippet name inside the parens () does not include a
.
(dot) this will avoid 1 possible route to confusion.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 is confusing about it?
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.
I just think it would be good to avoid
(example.com) {
log example.log "{common}"
}
as a snippet
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.
Hmm. Well, I'm curious to see if that will actually be a problem. How about we wait and find out before we add a restriction...
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.
I'm not sure I understand why it shouldn't be added as a restriction? It needs to be added from the beginning or not at all, otherwise you will have the potential to break installations. The only legitimate use I could see would be if someone wished to create a snippet
I wonder how likely that is. I would suggest it is easier to remove the restriction if people feel it gets in the way rather than add it in at a later point.
Uh oh!
There was an error while loading. Please reload this page.
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.
Hmm, well, I see what you mean... (I think this change requires that the name in parens is only one word, and I assume your example is just an example in that sense) - what do you think @captncraig ?