Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
circle/circle/settings/base.py
+9
-1
circle/vm/models.py
+2
-7
No files found.
circle/circle/settings/base.py
View file @
8870ad63
...
...
@@ -3,7 +3,7 @@
from
os
import
environ
from
os.path
import
abspath
,
basename
,
dirname
,
join
,
normpath
from
json
import
loads
from
json
import
loads
from
socket
import
SOCK_STREAM
from
sys
import
path
...
...
@@ -292,3 +292,11 @@ WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
FIREWALL_SETTINGS
=
loads
(
get_env_variable
(
'DJANGO_FIREWALL_SETTINGS'
))
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
import
logging
from
netaddr
import
EUI
import
django.conf
from
django.contrib.auth.models
import
User
from
django.db
import
models
from
django.db.models.signals
import
pre_delete
...
...
@@ -21,13 +22,7 @@ from . import tasks
logger
=
logging
.
getLogger
(
__name__
)
pwgen
=
User
.
objects
.
make_random_password
# TODO get this from config
ACCESS_PROTOCOLS
=
{
# format: id: (name, port, protocol)
'rdp'
:
(
'rdp'
,
3389
,
'tcp'
),
'nx'
:
(
'nx'
,
22
,
'tcp'
),
'ssh'
:
(
'ssh'
,
22
,
'tcp'
),
}
ACCESS_PROTOCOLS
=
django
.
conf
.
settings
.
VM_ACCESS_PROTOCOLS
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