Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
635714fe
Commit
635714fe
authored
Sep 05, 2016
by
Mike Pulaski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Caddyfiles read from STDIN now have server types associated with them. Fixes #1090.
parent
a1223041
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
caddy.go
caddy.go
+4
-3
caddy/caddymain/run.go
caddy/caddymain/run.go
+1
-1
No files found.
caddy.go
View file @
635714fe
...
...
@@ -388,7 +388,7 @@ func (i *Instance) Wait() {
// but the Input value will be nil. An error is only returned
// if there was an error reading the pipe, even if the length
// of what was read is 0.
func
CaddyfileFromPipe
(
f
*
os
.
File
)
(
Input
,
error
)
{
func
CaddyfileFromPipe
(
f
*
os
.
File
,
serverType
string
)
(
Input
,
error
)
{
fi
,
err
:=
f
.
Stat
()
if
err
==
nil
&&
fi
.
Mode
()
&
os
.
ModeCharDevice
==
0
{
// Note that a non-nil error is not a problem. Windows
...
...
@@ -404,6 +404,7 @@ func CaddyfileFromPipe(f *os.File) (Input, error) {
return
CaddyfileInput
{
Contents
:
confBody
,
Filepath
:
f
.
Name
(),
ServerTypeName
:
serverType
,
},
nil
}
...
...
caddy/caddymain/run.go
View file @
635714fe
...
...
@@ -136,7 +136,7 @@ func confLoader(serverType string) (caddy.Input, error) {
}
if
conf
==
"stdin"
{
return
caddy
.
CaddyfileFromPipe
(
os
.
Stdin
)
return
caddy
.
CaddyfileFromPipe
(
os
.
Stdin
,
serverType
)
}
contents
,
err
:=
ioutil
.
ReadFile
(
conf
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment