Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
slapos
Commits
2fabca95
Commit
2fabca95
authored
Jul 12, 2011
by
Vivien Alger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creating needed file for noVNC encryption
parent
0adaa48c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
18 deletions
+39
-18
slapos/recipe/kvm/__init__.py
slapos/recipe/kvm/__init__.py
+38
-15
slapos/recipe/kvm/template/websockify_run.in
slapos/recipe/kvm/template/websockify_run.in
+1
-3
No files found.
slapos/recipe/kvm/__init__.py
View file @
2fabca95
...
@@ -125,6 +125,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -125,6 +125,7 @@ class Recipe(BaseSlapRecipe):
kvm_conf
[
'smp_count'
]
=
self
.
options
[
'smp_count'
]
kvm_conf
[
'smp_count'
]
=
self
.
options
[
'smp_count'
]
kvm_conf
[
'ram_size'
]
=
self
.
options
[
'ram_size'
]
kvm_conf
[
'ram_size'
]
=
self
.
options
[
'ram_size'
]
kvm_conf
[
'vnc_display'
]
=
1
# Instanciate KVM
# Instanciate KVM
kvm_runner_path
=
self
.
instanciate_wrapper
(
"kvm"
,
kvm_conf
)
kvm_runner_path
=
self
.
instanciate_wrapper
(
"kvm"
,
kvm_conf
)
...
@@ -140,7 +141,6 @@ class Recipe(BaseSlapRecipe):
...
@@ -140,7 +141,6 @@ class Recipe(BaseSlapRecipe):
##slapreport_runner_path = self.instanciate_wrapper("slapreport",
##slapreport_runner_path = self.instanciate_wrapper("slapreport",
# [database_path, python_path])
# [database_path, python_path])
kvm_conf
[
'vnc_display'
]
=
1
return
kvm_conf
return
kvm_conf
def
installNoVnc
(
self
,
source_ip
,
source_port
,
target_ip
,
target_port
,
def
installNoVnc
(
self
,
source_ip
,
source_port
,
target_ip
,
target_port
,
...
@@ -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
[
'
key_path'
],
noVNC_conf
[
'certificate_path'
]
=
self
.
requestCertificate
(
'noVNC'
)
noVNC_conf
[
'
pem_path'
]
=
self
.
createPem
(
'noVNC'
)
# Instanciate Websockify
# Instanciate Websockify
websockify_runner_path
=
self
.
instanciate_wrapper
(
"websockify"
,
websockify_runner_path
=
self
.
instanciate_wrapper
(
"websockify"
,
...
@@ -311,3 +311,26 @@ class Recipe(BaseSlapRecipe):
...
@@ -311,3 +311,26 @@ 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/template/websockify_run.in
View file @
2fabca95
...
@@ -2,7 +2,5 @@
...
@@ -2,7 +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
cat
%
(
key_path
)
s
>
self.pem
%
(
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
cat
%
(
certificate_path
)
s
>>
self.pem
%
(
python_path
)
s %
(
websockify_path
)
s
--web
%
(
noVNC_location
)
s %
(
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