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
nexedi
caddy
Commits
04162aaa
Commit
04162aaa
authored
Jan 13, 2015
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added flag to specify config file location
parent
db1adcac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
main.go
main.go
+10
-1
server/server.go
server/server.go
+2
-0
No files found.
main.go
View file @
04162aaa
package
main
import
(
"flag"
"log"
"sync"
...
...
@@ -11,7 +12,9 @@ import (
func
main
()
{
var
wg
sync
.
WaitGroup
vhosts
,
err
:=
config
.
Load
(
"Caddyfile"
)
flag
.
Parse
()
vhosts
,
err
:=
config
.
Load
(
conf
)
if
err
!=
nil
{
if
config
.
IsNotFound
(
err
)
{
vhosts
=
config
.
Default
()
...
...
@@ -37,3 +40,9 @@ func main() {
wg
.
Wait
()
}
func
init
()
{
flag
.
StringVar
(
&
conf
,
"conf"
,
server
.
DefaultConfigFile
,
"the configuration file to use"
)
}
var
conf
string
server/server.go
View file @
04162aaa
...
...
@@ -174,3 +174,5 @@ func enableLogging(l config.Log) (*log.Logger, error) {
return
log
.
New
(
file
,
""
,
0
),
nil
}
const
DefaultConfigFile
=
"Caddyfile"
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