Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
slapos
Commits
1a6faa7c
Commit
1a6faa7c
authored
Jul 12, 2011
by
Vivien Alger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified generation of certificate
parent
2fabca95
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
26 deletions
+3
-26
slapos/recipe/kvm/__init__.py
slapos/recipe/kvm/__init__.py
+1
-24
slapos/recipe/kvm/certificate_authority.py
slapos/recipe/kvm/certificate_authority.py
+1
-1
slapos/recipe/kvm/template/websockify_run.in
slapos/recipe/kvm/template/websockify_run.in
+1
-1
No files found.
slapos/recipe/kvm/__init__.py
View file @
1a6faa7c
...
@@ -165,7 +165,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -165,7 +165,7 @@ class Recipe(BaseSlapRecipe):
noVNC_conf
[
'python_path'
]
=
python_path
noVNC_conf
[
'python_path'
]
=
python_path
noVNC_conf
[
'ca_conf'
]
=
self
.
installCertificateAuthority
()
noVNC_conf
[
'ca_conf'
]
=
self
.
installCertificateAuthority
()
noVNC_conf
[
'
pem_path'
]
=
self
.
createPem
(
'noVNC'
)
noVNC_conf
[
'
certificate_path'
]
=
self
.
requestCertificate
(
'noVNC'
)
# Instanciate Websockify
# Instanciate Websockify
websockify_runner_path
=
self
.
instanciate_wrapper
(
"websockify"
,
websockify_runner_path
=
self
.
instanciate_wrapper
(
"websockify"
,
...
@@ -311,26 +311,3 @@ class Recipe(BaseSlapRecipe):
...
@@ -311,26 +311,3 @@ class Recipe(BaseSlapRecipe):
)[
0
]
)[
0
]
self
.
path_list
.
append
(
wrapper
)
self
.
path_list
.
append
(
wrapper
)
return
cron_d
return
cron_d
def
createPem
(
self
,
name
):
"""
Create self.pem file for noVNC encryption
Parameters: name for the requestCertificate function
Return: path to self.pem
"""
key
,
certificate
=
self
.
requestCertificate
(
name
)
pem
=
os
.
path
.
join
(
self
.
ca_certs
,
'self.pem'
)
pem_file
=
open
(
pem
,
'w'
)
key_file
=
open
(
key
,
'r'
)
pem_file
.
write
(
key_file
.
read
())
key_file
.
close
()
certificate_file
=
open
(
certificate
,
'r'
)
pem_file
.
write
(
certificate_file
.
read
())
certificate_file
.
close
()
pem_file
.
close
()
return
pem
slapos/recipe/kvm/certificate_authority.py
View file @
1a6faa7c
...
@@ -43,7 +43,7 @@ class CertificateAuthority:
...
@@ -43,7 +43,7 @@ class CertificateAuthority:
# no CA, let us create new one
# no CA, let us create new one
popenCommunicate
([
self
.
openssl_binary
,
'req'
,
'-nodes'
,
'-config'
,
popenCommunicate
([
self
.
openssl_binary
,
'req'
,
'-nodes'
,
'-config'
,
self
.
openssl_configuration
,
'-new'
,
'-x509'
,
'-extensions'
,
self
.
openssl_configuration
,
'-new'
,
'-x509'
,
'-extensions'
,
'v3_ca'
,
'-keyout'
,
self
.
key
,
'-out'
,
self
.
certificate
,
'v3_ca'
,
'-keyout'
,
self
.
certificate
,
'-out'
,
self
.
certificate
,
'-days'
,
'10950'
],
'Automatic Certificate Authority
\
n
'
)
'-days'
,
'10950'
],
'Automatic Certificate Authority
\
n
'
)
except
:
except
:
try
:
try
:
...
...
slapos/recipe/kvm/template/websockify_run.in
View file @
1a6faa7c
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
# BEWARE: This file is operated by slapgrid
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
# BEWARE: It will be overwritten automatically
%
(
python_path
)
s %
(
websockify_path
)
s
--web
%
(
noVNC_location
)
s
--cert
=
%
(
pem
_path
)
s
--ssl-only
%
(
source_ip
)
s:%
(
source_port
)
s %
(
target_ip
)
s:%
(
target_port
)
s
%
(
python_path
)
s %
(
websockify_path
)
s
--web
%
(
noVNC_location
)
s
--cert
=
%
(
certificate
_path
)
s
--ssl-only
%
(
source_ip
)
s:%
(
source_port
)
s %
(
target_ip
)
s:%
(
target_port
)
s
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