Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
certman
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
certman
Commits
b6fcb9b6
Commit
b6fcb9b6
authored
4 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
csr dir can be configured too
parent
83a55965
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
cm.sh
+28
-21
28 additions, 21 deletions
cm.sh
inc_config.sh.dist
+3
-1
3 additions, 1 deletion
inc_config.sh.dist
readme.md
+15
-12
15 additions, 12 deletions
readme.md
with
47 additions
and
34 deletions
.gitignore
+
1
−
0
View file @
b6fcb9b6
certs/*
csr/*
log/*
inc_config.sh
...
...
This diff is collapsed.
Click to expand it.
cm.sh
+
28
−
21
View file @
b6fcb9b6
...
...
@@ -55,7 +55,7 @@ function _certMustNotExist(){
}
# internal function: transfer generated/ updated cert data to a
# known directory (based on
A
CM
E_Outdir
- see inc_config.sh)
# known directory (based on CM
_diracme
- see inc_config.sh)
# used in public_add and public_renew
function
_certTransfer
(){
_wd
"--- acme internal data"
...
...
@@ -115,6 +115,7 @@ function _gencsr(){
_wd
"DNS alternative names:
$altdns
"
rm
-f
$CM_filecnf
$CM_filekey
$CM_filecsr
mkdir
-p
"
${
CM_dircsr
}
"
2>/dev/null
cat
./templates/csr.txt
\
|
sed
"s#__FQDN__#
$CM_fqdn
#g"
\
...
...
@@ -171,7 +172,7 @@ function public_add(){
mkdir
-p
"
${
CM_dircerts
}
"
2>/dev/null
# _wd "--- domains in csr"
./acme.sh/acme.sh
--showcsr
--csr
$CM_filecsr
||
exit
1
$ACME
--showcsr
--csr
$CM_filecsr
||
exit
1
_wd
"--- create certificate"
$ACME
--signcsr
--force
--csr
$CM_filecsr
$ACME_Params
||
exit
1
...
...
@@ -271,18 +272,21 @@ if [ $# -gt 0 -a $? -eq 0 ]; then
action
=
$1
CM_fqdn
=
$2
shift
2
test
-z
"
${
ACME_Outdir
}
"
&&
ACME_Outdir
=
./certs
test
-z
"
${
CM_diracme
}
"
&&
CM_diracme
=
./certs
test
-z
"
${
CM_dircsr
}
"
&&
CM_dircsr
=
./csr
test
-z
"
${
ACME
}
"
&&
ACME
=
$(
which acme.sh
)
if
[
!
-x
"
${
ACME
}
"
]
;
then
echo
"ERROR: acme.sh not found. You need to install acme.sh client and configure it in inc_config.sh."
exit
1
fi
CM_filecsr
=
"
./
csr/
${
CM_fqdn
}
.csr"
CM_filecnf
=
"
./
csr/
${
CM_fqdn
}
.cnf"
CM_filekey
=
"
./
csr/
${
CM_fqdn
}
.key"
CM_filecsr
=
"
${
CM_dir
csr
}
/
${
CM_fqdn
}
.csr"
CM_filecnf
=
"
${
CM_dir
csr
}
/
${
CM_fqdn
}
.cnf"
CM_filekey
=
"
${
CM_dir
csr
}
/
${
CM_fqdn
}
.key"
CM_dircerts
=
"
${
A
CM
E_Outdir
}
/
${
CM_fqdn
}
"
CM_dircerts
=
"
${
CM
_diracme
}
/
${
CM_fqdn
}
"
# echo $CM_fqdn
# set | grep "^CM_"
...
...
@@ -298,24 +302,27 @@ HELP
The basic syntax is
$self
ACTION [FQDN]
The ACTIONs are:
The ACTIONs
for single certificate handlings
are:
add FQDN [.. FQDN-N]
create new certificate ... or force it
The first FQDN is a hostname to generate the certificate for.
Following hostnames will be used as DNS aliases in the same certificate.
delete FQDN
delete a given certificate
add FQDN [.. FQDN-N]
create new certificate ... or force it
The first FQDN is a hostname to generate the certificate for.
Following multiple hostnames will be used as DNS aliases in the
same certificate.
delete FQDN
delete a given certificate
renew FQDN
renew (an already added) certificate
list
list all certificates including creation and renew d
ate
show FQDN
show place of csr + certificate data and show certific
ate
renew FQDN
renew (an already added) certificate
ACTIONs for all certs
show FQDN
show place of csr + certificate data and show certific
ate
list
list all certificates including creation and renew d
ate
EOF
fi
This diff is collapsed.
Click to expand it.
inc_config.sh.dist
+
3
−
1
View file @
b6fcb9b6
...
...
@@ -30,7 +30,9 @@ export ACME=../acme.sh/acme.sh
# export ACME_Params="$ACME_Params --staging"
# where to write certificate data
# export
A
CM
E_Outdir
="./certs"
# export CM
_diracme
="./certs"
# place for cnf + csr files
# export CM_dircsr="./csr"
# ----------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
readme.md
+
15
−
12
View file @
b6fcb9b6
...
...
@@ -9,13 +9,13 @@ source: https://git-repo.iml.unibe.ch/open-source/iml-certman
*
Install acme.sh client: https://github.com/acmesh-official/acme.sh
*
Clone or extract files of iml-certman
*
Make your changes by copying
*
dist files to file without ".dist" extension and edit
+
inc_config.sh
-
set credentials for dns api
-
set path to acme.sh script
-
optional: set custom target for generated certificates
-
optional: for testing enable Let's Encrypt stage server to prevent running into weekly limits during tests
+
templates/csr.txt
-
set location, company and department
*
inc_config.sh
*
set credentials for dns api
*
set path to acme.sh script
*
optional: set custom target for generated certificates
*
optional: for testing enable Let's Encrypt stage server to prevent running into weekly limits during tests
*
templates/csr.txt
*
set location, company and department
## Usage
...
...
@@ -35,24 +35,27 @@ HELP
The basic syntax is
cm.sh ACTION [FQDN]
The ACTIONs are:
The ACTIONs
for single certificate handlings
are:
add FQDN [.. FQDN-N]
create new certificate ... or force it
The first FQDN is a hostname to generate the certificate for.
Following hostnames will be used as DNS aliases in the same certificate.
Following multiple hostnames will be used as DNS aliases in the
same certificate.
delete FQDN
delete a given certificate
list
list all certificates including creation and renew date
renew FQDN
renew (an already added) certificate
show FQDN
show place of csr + certificate data and show certificate
ACTIONs for all certs
list
list all certificates including creation and renew date
```
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