Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8870ad63
authored
Sep 05, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: move access protocols' definition to config
parent
25746914
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
circle/circle/settings/base.py
+8
-0
circle/vm/models.py
+2
-7
No files found.
circle/circle/settings/base.py
View file @
8870ad63
...
@@ -292,3 +292,11 @@ WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
...
@@ -292,3 +292,11 @@ WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
FIREWALL_SETTINGS
=
loads
(
get_env_variable
(
'DJANGO_FIREWALL_SETTINGS'
))
FIREWALL_SETTINGS
=
loads
(
get_env_variable
(
'DJANGO_FIREWALL_SETTINGS'
))
CRISPY_TEMPLATE_PACK
=
'bootstrap3'
CRISPY_TEMPLATE_PACK
=
'bootstrap3'
# format: id: (name, port, protocol)
VM_ACCESS_PROTOCOLS
=
loads
(
get_env_variable
(
'DJANGO_VM_ACCESS_PROTOCOLS'
,
default
=
{
'rdp'
:
(
'rdp'
,
3389
,
'tcp'
),
'nx'
:
(
'nx'
,
22
,
'tcp'
),
'ssh'
:
(
'ssh'
,
22
,
'tcp'
),
}))
circle/vm/models.py
View file @
8870ad63
...
@@ -4,6 +4,7 @@ from datetime import timedelta
...
@@ -4,6 +4,7 @@ from datetime import timedelta
import
logging
import
logging
from
netaddr
import
EUI
from
netaddr
import
EUI
import
django.conf
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.db
import
models
from
django.db
import
models
from
django.db.models.signals
import
pre_delete
from
django.db.models.signals
import
pre_delete
...
@@ -21,13 +22,7 @@ from . import tasks
...
@@ -21,13 +22,7 @@ from . import tasks
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
pwgen
=
User
.
objects
.
make_random_password
pwgen
=
User
.
objects
.
make_random_password
# TODO get this from config
ACCESS_PROTOCOLS
=
django
.
conf
.
settings
.
VM_ACCESS_PROTOCOLS
ACCESS_PROTOCOLS
=
{
# format: id: (name, port, protocol)
'rdp'
:
(
'rdp'
,
3389
,
'tcp'
),
'nx'
:
(
'nx'
,
22
,
'tcp'
),
'ssh'
:
(
'ssh'
,
22
,
'tcp'
),
}
ACCESS_METHODS
=
[(
k
,
ap
[
0
])
for
k
,
ap
in
ACCESS_PROTOCOLS
.
iteritems
()]
ACCESS_METHODS
=
[(
k
,
ap
[
0
])
for
k
,
ap
in
ACCESS_PROTOCOLS
.
iteritems
()]
...
...
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