Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docker-ocserv
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docker-ocserv
Commits
b19c99eb
Commit
b19c99eb
authored
Feb 10, 2015
by
Tommy Lau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use different EOF for different files
parent
80ffed79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
docker-entrypoint.sh
docker-entrypoint.sh
+5
-7
No files found.
docker-entrypoint.sh
View file @
b19c99eb
#!/bin/sh
if
[
!
-f
/etc/ocserv/server-key.pem
]
||
[
-f
/etc/ocserv/server-cert.pem
]
;
then
if
[
!
-f
/etc/ocserv/server-key.pem
]
||
[
!
-f
/etc/ocserv/server-cert.pem
]
;
then
# Check environment variables
if
[
-z
"
$CA_CN
"
]
;
then
CA_CN
=
"VPN CA"
...
...
@@ -29,7 +29,7 @@ if [ ! -f /etc/ocserv/server-key.pem ] || [ -f /etc/ocserv/server-cert.pem ]; th
# No certification found, generate one
cd
/etc/ocserv
certtool
--generate-privkey
--outfile
ca-key.pem
cat
<<
_EOF_
> ca.tmpl
cat
<<
_EOF_
CA_
> ca.tmpl
cn = "
$CA_CN
"
organization = "
$CA_ORG
"
serial = 1
...
...
@@ -38,19 +38,17 @@ ca
signing_key
cert_signing_key
crl_signing_key
_EOF_
_EOF_CA_
certtool
--generate-self-signed
--load-privkey
ca-key.pem
--template
ca.tmpl
--outfile
ca-cert.pem
certtool
--generate-privkey
--outfile
server-key.pem
cat
<<
_EOF_
> server.tmpl
cat
<<
_EOF_
SRV_
> server.tmpl
cn = "
$SRV_CN
"
organization = "
$SRV_ORG
"
expiration_days =
$SRV_DAYS
signing_key
encryption_key #only if the generated key is an RSA one
tls_www_server
_EOF_
_EOF_SRV_
certtool
--generate-certificate
--load-privkey
server-key.pem
--load-ca-certificate
ca-cert.pem
--load-ca-privkey
ca-key.pem
--template
server.tmpl
--outfile
server-cert.pem
# Create a test user
...
...
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