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
68be4a91
Commit
68be4a91
authored
Aug 10, 2016
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't prompt for email when user is not there to provide one
Also don't bother showing stdout output in same situation
parent
46bc0d5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
caddy.go
caddy.go
+23
-0
caddyhttp/httpserver/https.go
caddyhttp/httpserver/https.go
+6
-3
No files found.
caddy.go
View file @
68be4a91
...
@@ -50,6 +50,14 @@ var (
...
@@ -50,6 +50,14 @@ var (
// was started as part of an upgrade, where a parent
// was started as part of an upgrade, where a parent
// Caddy process started this one.
// Caddy process started this one.
isUpgrade
bool
isUpgrade
bool
// started will be set to true when the first
// instance is started; it never gets set to
// false after that.
started
bool
// mu protects the variables 'isUpgrade' and 'started'.
mu
sync
.
Mutex
)
)
// Instance contains the state of servers created as a result of
// Instance contains the state of servers created as a result of
...
@@ -497,6 +505,10 @@ func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]r
...
@@ -497,6 +505,10 @@ func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]r
}
}
}
}
mu
.
Lock
()
started
=
true
mu
.
Unlock
()
return
nil
return
nil
}
}
...
@@ -737,9 +749,20 @@ func Upgrade() error {
...
@@ -737,9 +749,20 @@ func Upgrade() error {
// where a parent caddy process spawned this one to ugprade
// where a parent caddy process spawned this one to ugprade
// the binary.
// the binary.
func
IsUpgrade
()
bool
{
func
IsUpgrade
()
bool
{
mu
.
Lock
()
defer
mu
.
Unlock
()
return
isUpgrade
return
isUpgrade
}
}
// Started returns true if at least one instance has been
// started by this package. It never gets reset to false
// once it is set to true.
func
Started
()
bool
{
mu
.
Lock
()
defer
mu
.
Unlock
()
return
started
}
// CaddyfileInput represents a Caddyfile as input
// CaddyfileInput represents a Caddyfile as input
// and is simply a convenient way to implement
// and is simply a convenient way to implement
// the Input interface.
// the Input interface.
...
...
caddyhttp/httpserver/https.go
View file @
68be4a91
...
@@ -10,7 +10,9 @@ import (
...
@@ -10,7 +10,9 @@ import (
)
)
func
activateHTTPS
(
cctx
caddy
.
Context
)
error
{
func
activateHTTPS
(
cctx
caddy
.
Context
)
error
{
if
!
caddy
.
Quiet
{
operatorPresent
:=
!
caddy
.
Started
()
if
!
caddy
.
Quiet
&&
operatorPresent
{
fmt
.
Print
(
"Activating privacy features..."
)
fmt
.
Print
(
"Activating privacy features..."
)
}
}
...
@@ -21,7 +23,7 @@ func activateHTTPS(cctx caddy.Context) error {
...
@@ -21,7 +23,7 @@ func activateHTTPS(cctx caddy.Context) error {
// place certificates and keys on disk
// place certificates and keys on disk
for
_
,
c
:=
range
ctx
.
siteConfigs
{
for
_
,
c
:=
range
ctx
.
siteConfigs
{
err
:=
c
.
TLS
.
ObtainCert
(
true
)
err
:=
c
.
TLS
.
ObtainCert
(
operatorPresent
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -44,9 +46,10 @@ func activateHTTPS(cctx caddy.Context) error {
...
@@ -44,9 +46,10 @@ func activateHTTPS(cctx caddy.Context) error {
return
err
return
err
}
}
if
!
caddy
.
Quiet
{
if
!
caddy
.
Quiet
&&
operatorPresent
{
fmt
.
Println
(
" done."
)
fmt
.
Println
(
" done."
)
}
}
return
nil
return
nil
}
}
...
...
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