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
a39ed282
Commit
a39ed282
authored
Nov 10, 2015
by
Matt Holt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #332 from coolaj86/coolaj86-alphabetize
Alphabetize command line options, add -pidfile
parents
76ec785e
4bed399c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
main.go
main.go
+19
-10
No files found.
main.go
View file @
a39ed282
...
...
@@ -18,9 +18,10 @@ import (
var
(
conf
string
cpu
string
version
bool
revoke
string
logfile
string
pidfile
string
revoke
string
version
bool
)
const
(
...
...
@@ -30,21 +31,22 @@ const (
func
init
()
{
flag
.
StringVar
(
&
conf
,
"conf"
,
""
,
"Configuration file to use (default="
+
caddy
.
DefaultConfigFile
+
")"
)
flag
.
BoolVar
(
&
caddy
.
HTTP2
,
"http2"
,
true
,
"HTTP/2 support"
)
// TODO: temporary flag until http2 merged into std lib
flag
.
BoolVar
(
&
caddy
.
Quiet
,
"quiet"
,
false
,
"Quiet mode (no initialization output)"
)
flag
.
StringVar
(
&
cpu
,
"cpu"
,
"100%"
,
"CPU cap"
)
flag
.
StringVar
(
&
caddy
.
Root
,
"root"
,
caddy
.
DefaultRoot
,
"Root path to default site"
)
flag
.
StringVar
(
&
caddy
.
Host
,
"host"
,
caddy
.
DefaultHost
,
"Default host"
)
flag
.
BoolVar
(
&
caddy
.
HTTP2
,
"http2"
,
true
,
"HTTP/2 support"
)
// TODO: temporary flag until http2 merged into std lib
flag
.
StringVar
(
&
pidfile
,
"pidfile"
,
""
,
"Path to write pid file"
)
flag
.
StringVar
(
&
caddy
.
Port
,
"port"
,
caddy
.
DefaultPort
,
"Default port"
)
flag
.
BoolVar
(
&
caddy
.
Quiet
,
"quiet"
,
false
,
"Quiet mode (no initialization output)"
)
flag
.
StringVar
(
&
caddy
.
Root
,
"root"
,
caddy
.
DefaultRoot
,
"Root path to default site"
)
flag
.
BoolVar
(
&
version
,
"version"
,
false
,
"Show version"
)
// TODO: Boulder dev URL is: http://192.168.99.100:4000
// TODO: Staging API URL is: https://acme-staging.api.letsencrypt.org
// TODO: Production endpoint is: https://acme-v01.api.letsencrypt.org
flag
.
StringVar
(
&
letsencrypt
.
CAUrl
,
"ca"
,
"https://acme-staging.api.letsencrypt.org"
,
"Certificate authority ACME server"
)
flag
.
BoolVar
(
&
letsencrypt
.
Agreed
,
"agree"
,
false
,
"Agree to Let's Encrypt Subscriber Agreement"
)
flag
.
StringVar
(
&
letsencrypt
.
CAUrl
,
"ca"
,
"https://acme-staging.api.letsencrypt.org"
,
"Certificate authority ACME server"
)
flag
.
StringVar
(
&
letsencrypt
.
DefaultEmail
,
"email"
,
""
,
"Default Let's Encrypt account email address"
)
flag
.
StringVar
(
&
revoke
,
"revoke"
,
""
,
"Hostname for which to revoke the certificate"
)
flag
.
StringVar
(
&
logfile
,
"log"
,
""
,
"Process log file"
)
flag
.
StringVar
(
&
revoke
,
"revoke"
,
""
,
"Hostname for which to revoke the certificate"
)
}
func
main
()
{
...
...
@@ -69,9 +71,12 @@ func main() {
log
.
SetOutput
(
file
)
}
if
version
{
fmt
.
Printf
(
"%s %s
\n
"
,
caddy
.
AppName
,
caddy
.
AppVersion
)
os
.
Exit
(
0
)
if
pidfile
!=
""
{
pid
:=
[]
byte
(
strconv
.
Itoa
(
os
.
Getpid
())
+
"
\n
"
)
err
:=
ioutil
.
WriteFile
(
pidfile
,
pid
,
0644
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
}
if
revoke
!=
""
{
err
:=
letsencrypt
.
Revoke
(
revoke
)
...
...
@@ -81,6 +86,10 @@ func main() {
fmt
.
Printf
(
"Revoked certificate for %s
\n
"
,
revoke
)
os
.
Exit
(
0
)
}
if
version
{
fmt
.
Printf
(
"%s %s
\n
"
,
caddy
.
AppName
,
caddy
.
AppVersion
)
os
.
Exit
(
0
)
}
// Set CPU cap
err
:=
setCPU
(
cpu
)
...
...
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