Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acmeserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai3
tools
acmeserver
Commits
a5477d77
Commit
a5477d77
authored
5 years ago
by
godog
Browse files
Options
Downloads
Patches
Plain Diff
Switch to certbot pem names
Easier to swap between the two.
parent
a32c41b4
Loading
Loading
1 merge request
!1
Switch to certbot pem names
Pipeline
#3274
passed
5 years ago
Stage: build_pkgsrc
Stage: build_pkg
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manager_test.go
+1
-1
1 addition, 1 deletion
manager_test.go
storage.go
+3
-3
3 additions, 3 deletions
storage.go
with
4 additions
and
4 deletions
manager_test.go
+
1
−
1
View file @
a5477d77
...
@@ -125,7 +125,7 @@ func TestManager_NewCert(t *testing.T) {
...
@@ -125,7 +125,7 @@ func TestManager_NewCert(t *testing.T) {
if
_
,
err
:=
os
.
Stat
(
p
);
err
!=
nil
{
if
_
,
err
:=
os
.
Stat
(
p
);
err
!=
nil
{
t
.
Fatalf
(
"file not created: %v"
,
err
)
t
.
Fatalf
(
"file not created: %v"
,
err
)
}
}
p
=
filepath
.
Join
(
m
.
configDirs
[
0
],
"../certs/example.com/priv
ate_
key.pem"
)
p
=
filepath
.
Join
(
m
.
configDirs
[
0
],
"../certs/example.com/privkey.pem"
)
if
_
,
err
:=
os
.
Stat
(
p
);
err
!=
nil
{
if
_
,
err
:=
os
.
Stat
(
p
);
err
!=
nil
{
t
.
Fatalf
(
"file not created: %v"
,
err
)
t
.
Fatalf
(
"file not created: %v"
,
err
)
}
}
...
...
This diff is collapsed.
Click to expand it.
storage.go
+
3
−
3
View file @
a5477d77
...
@@ -25,7 +25,7 @@ type dirStorage struct {
...
@@ -25,7 +25,7 @@ type dirStorage struct {
func
(
d
*
dirStorage
)
GetCert
(
cn
string
)
([][]
byte
,
crypto
.
Signer
,
error
)
{
func
(
d
*
dirStorage
)
GetCert
(
cn
string
)
([][]
byte
,
crypto
.
Signer
,
error
)
{
certPath
:=
filepath
.
Join
(
d
.
root
,
cn
,
"fullchain.pem"
)
certPath
:=
filepath
.
Join
(
d
.
root
,
cn
,
"fullchain.pem"
)
keyPath
:=
filepath
.
Join
(
d
.
root
,
cn
,
"priv
ate_
key.pem"
)
keyPath
:=
filepath
.
Join
(
d
.
root
,
cn
,
"privkey.pem"
)
der
,
err
:=
parseCertsFromFile
(
certPath
)
der
,
err
:=
parseCertsFromFile
(
certPath
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -53,7 +53,7 @@ func (d *dirStorage) PutCert(cn string, der [][]byte, key crypto.Signer) error {
...
@@ -53,7 +53,7 @@ func (d *dirStorage) PutCert(cn string, der [][]byte, key crypto.Signer) error {
for
path
,
data
:=
range
filemap
{
for
path
,
data
:=
range
filemap
{
var
mode
os
.
FileMode
=
0644
var
mode
os
.
FileMode
=
0644
if
strings
.
HasSuffix
(
path
,
"priv
ate_
key.pem"
)
{
if
strings
.
HasSuffix
(
path
,
"privkey.pem"
)
{
mode
=
0400
mode
=
0400
}
}
log
.
Printf
(
"writing %s (%03o)"
,
path
,
mode
)
log
.
Printf
(
"writing %s (%03o)"
,
path
,
mode
)
...
@@ -83,7 +83,7 @@ func dumpCertsAndKey(cn string, der [][]byte, key crypto.Signer) (map[string][]b
...
@@ -83,7 +83,7 @@ func dumpCertsAndKey(cn string, der [][]byte, key crypto.Signer) (map[string][]b
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
m
[
filepath
.
Join
(
cn
,
"priv
ate_
key.pem"
)]
=
data
m
[
filepath
.
Join
(
cn
,
"privkey.pem"
)]
=
data
return
m
,
nil
return
m
,
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment