Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
Commits
0a687aff
Commit
0a687aff
authored
Dec 08, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kvm frontend : Correctly detect if we want to start plain http redirect server
parent
4e2896f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
slapos/recipe/kvm_frontend/__init__.py
slapos/recipe/kvm_frontend/__init__.py
+7
-2
slapos/recipe/kvm_frontend/template/kvm-proxy.js
slapos/recipe/kvm_frontend/template/kvm-proxy.js
+1
-1
No files found.
slapos/recipe/kvm_frontend/__init__.py
View file @
0a687aff
...
@@ -33,6 +33,7 @@ import zc.buildout
...
@@ -33,6 +33,7 @@ import zc.buildout
import
zc.recipe.egg
import
zc.recipe.egg
import
ConfigParser
import
ConfigParser
TRUE_VALUE_LIST
=
[
'y'
,
'yes'
,
'1'
,
'true'
]
class
Recipe
(
BaseSlapRecipe
):
class
Recipe
(
BaseSlapRecipe
):
...
@@ -53,7 +54,6 @@ class Recipe(BaseSlapRecipe):
...
@@ -53,7 +54,6 @@ class Recipe(BaseSlapRecipe):
self
.
path_list
.
append
(
self
.
killpidfromfile
)
self
.
path_list
.
append
(
self
.
killpidfromfile
)
# This should come from parameter.
frontend_port_number
=
self
.
parameter_dict
.
get
(
"port"
,
4443
)
frontend_port_number
=
self
.
parameter_dict
.
get
(
"port"
,
4443
)
frontend_domain_name
=
self
.
parameter_dict
.
get
(
"domain"
,
frontend_domain_name
=
self
.
parameter_dict
.
get
(
"domain"
,
"host.vifib.net"
)
"host.vifib.net"
)
...
@@ -268,12 +268,17 @@ class Recipe(BaseSlapRecipe):
...
@@ -268,12 +268,17 @@ class Recipe(BaseSlapRecipe):
kvm_proxy_script_in
)
kvm_proxy_script_in
)
self
.
path_list
.
append
(
kvm_proxy_script
)
self
.
path_list
.
append
(
kvm_proxy_script
)
# Create http server?
if
plain_http
in
TRUE_VALUE_LIST
:
plain_http
=
'1'
else
:
plain_http
=
''
# Create wrapper
# Create wrapper
wrapper
=
zc
.
buildout
.
easy_install
.
scripts
([(
wrapper
=
zc
.
buildout
.
easy_install
.
scripts
([(
"kvm_frontend"
,
'slapos.recipe.librecipe.execute'
,
'executee_wait'
)],
self
.
ws
,
"kvm_frontend"
,
'slapos.recipe.librecipe.execute'
,
'executee_wait'
)],
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
[
self
.
options
[
'node_binary'
].
strip
(),
kvm_proxy_script
,
[
self
.
options
[
'node_binary'
].
strip
(),
kvm_proxy_script
,
ip
,
str
(
port
),
key
,
certificate
,
map_file
,
str
(
plain_http
)
],
ip
,
str
(
port
),
key
,
certificate
,
map_file
,
plain_http
],
[
key
,
certificate
],
[
key
,
certificate
],
{
'NODE_PATH'
:
self
.
options
[
'node_path'
]}]
{
'NODE_PATH'
:
self
.
options
[
'node_path'
]}]
)[
0
]
)[
0
]
...
...
slapos/recipe/kvm_frontend/template/kvm-proxy.js
View file @
0a687aff
...
@@ -80,7 +80,7 @@ console.log('HTTPS server started and listening at ' + listenInterface + ':' +
...
@@ -80,7 +80,7 @@ console.log('HTTPS server started and listening at ' + listenInterface + ':' +
port
);
port
);
// Dummy HTTP server redirecting to HTTPS. Only has sense if we can use port 80
// Dummy HTTP server redirecting to HTTPS. Only has sense if we can use port 80
if
(
redirect
=
==
true
)
{
if
(
redirect
=
'
1
'
)
{
try
{
try
{
var
httpPort
=
80
;
var
httpPort
=
80
;
http
.
createServer
(
function
(
req
,
res
)
{
http
.
createServer
(
function
(
req
,
res
)
{
...
...
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