Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
ba82c395
Commit
ba82c395
authored
8 years ago
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move terminal to a new project
parent
0954f6d7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
242 deletions
+0
-242
__init__.py
terminal/__init__.py
+0
-7
.gitkeep
terminal/logs/.gitkeep
+0
-0
ssh_config.py
terminal/ssh_config.py
+0
-102
ssh_config_example.py
terminal/ssh_config_example.py
+0
-96
ssh_server.py
terminal/ssh_server.py
+0
-0
utils.py
terminal/utils.py
+0
-34
web_ssh_server.py
terminal/web_ssh_server.py
+0
-3
No files found.
terminal/__init__.py
deleted
100644 → 0
View file @
0954f6d7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
if
__name__
==
'__main__'
:
pass
This diff is collapsed.
Click to expand it.
terminal/logs/.gitkeep
deleted
100644 → 0
View file @
0954f6d7
This diff is collapsed.
Click to expand it.
terminal/ssh_config.py
deleted
100644 → 0
View file @
0954f6d7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import
logging
import
os
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__name__
))
class
Config
:
SSH_HOST
=
''
SSH_PORT
=
2200
LOG_LEVEL
=
'INFO'
LOG_DIR
=
os
.
path
.
join
(
BASE_DIR
,
'logs'
)
LOG_FILENAME
=
'ssh_server.log'
LOGGING
=
{
'version'
:
1
,
'disable_existing_loggers'
:
False
,
'formatters'
:
{
'verbose'
:
{
'format'
:
'
%(levelname)
s
%(asctime)
s
%(module)
s
%(process)
d
%(thread)
d
%(message)
s'
},
'main'
:
{
'datefmt'
:
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
,
'format'
:
'
%(asctime)
s [
%(module)
s
%(levelname)
s]
%(message)
s'
,
},
'simple'
:
{
'format'
:
'
%(levelname)
s
%(message)
s'
},
},
'handlers'
:
{
'null'
:
{
'level'
:
'DEBUG'
,
'class'
:
'logging.NullHandler'
,
},
'console'
:
{
'level'
:
'DEBUG'
,
'class'
:
'logging.StreamHandler'
,
'formatter'
:
'main'
,
'stream'
:
'ext://sys.stdout'
,
},
'file'
:
{
'level'
:
'DEBUG'
,
'class'
:
'logging.handlers.TimedRotatingFileHandler'
,
'formatter'
:
'main'
,
'filename'
:
os
.
path
.
join
(
LOG_DIR
,
LOG_FILENAME
),
'when'
:
'D'
,
'backupCount'
:
10
,
},
},
'loggers'
:
{
'jumpserver'
:
{
'handlers'
:
[
'console'
,
'file'
],
# 'level': LOG_LEVEL_CHOICES.get(LOG_LEVEL, None) or LOG_LEVEL_CHOICES.get('info')
'level'
:
LOG_LEVEL
,
'propagate'
:
True
,
},
'jumpserver.web_ssh_server'
:
{
'handlers'
:
[
'console'
,
'file'
],
# 'level': LOG_LEVEL_CHOICES.get(LOG_LEVEL, None) or LOG_LEVEL_CHOICES.get('info')
'level'
:
LOG_LEVEL
,
'propagate'
:
True
,
},
'jumpserver.ssh_server'
:
{
'handlers'
:
[
'console'
,
'file'
],
# 'level': LOG_LEVEL_CHOICES.get(LOG_LEVEL, None) or LOG_LEVEL_CHOICES.get('info')
'level'
:
LOG_LEVEL
,
'propagate'
:
True
,
}
}
}
def
__init__
(
self
):
pass
def
__getattr__
(
self
,
item
):
return
None
class
DevelopmentConfig
(
Config
):
pass
class
ProductionConfig
(
Config
):
pass
class
TestingConfig
(
Config
):
pass
config
=
{
'development'
:
DevelopmentConfig
,
'production'
:
ProductionConfig
,
'testing'
:
TestingConfig
,
'default'
:
DevelopmentConfig
,
}
env
=
'default'
This diff is collapsed.
Click to expand it.
terminal/ssh_config_example.py
deleted
100644 → 0
View file @
0954f6d7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import
logging
import
os
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__name__
))
class
Config
:
LOG_LEVEL
=
'INFO'
LOG_DIR
=
os
.
path
.
join
(
BASE_DIR
,
'logs'
)
LOGGING
=
{
'version'
:
1
,
'disable_existing_loggers'
:
False
,
'formatters'
:
{
'verbose'
:
{
'format'
:
'
%(levelname)
s
%(asctime)
s
%(module)
s
%(process)
d
%(thread)
d
%(message)
s'
},
'main'
:
{
'datefmt'
:
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
,
'format'
:
'
%(asctime)
s [
%(module)
s
%(levelname)
s]
%(message)
s'
,
},
'simple'
:
{
'format'
:
'
%(levelname)
s
%(message)
s'
},
},
'handlers'
:
{
'null'
:
{
'level'
:
'DEBUG'
,
'class'
:
'logging.NullHandler'
,
},
'console'
:
{
'level'
:
'DEBUG'
,
'class'
:
'logging.StreamHandler'
,
'formatter'
:
'main'
},
'file'
:
{
'level'
:
'DEBUG'
,
'class'
:
'logging.FileHandler'
,
'formatter'
:
'main'
,
'filename'
:
LOG_DIR
,
},
},
'loggers'
:
{
'jumpserver'
:
{
'handlers'
:
[
'console'
,
'file'
],
# 'level': LOG_LEVEL_CHOICES.get(LOG_LEVEL, None) or LOG_LEVEL_CHOICES.get('info')
'level'
:
LOG_LEVEL
,
},
'jumpserver.web_ssh_server'
:
{
'handlers'
:
[
'console'
,
'file'
],
# 'level': LOG_LEVEL_CHOICES.get(LOG_LEVEL, None) or LOG_LEVEL_CHOICES.get('info')
'level'
:
LOG_LEVEL
,
},
'jumpserver.ssh_server'
:
{
'handlers'
:
[
'console'
,
'file'
],
# 'level': LOG_LEVEL_CHOICES.get(LOG_LEVEL, None) or LOG_LEVEL_CHOICES.get('info')
'level'
:
LOG_LEVEL
,
}
}
}
def
__init__
(
self
):
pass
def
__getattr__
(
self
,
item
):
return
None
class
DevelopmentConfig
(
Config
):
pass
class
ProductionConfig
(
Config
):
pass
class
TestingConfig
(
Config
):
pass
config
=
{
'development'
:
DevelopmentConfig
,
'production'
:
ProductionConfig
,
'testing'
:
TestingConfig
,
'default'
:
DevelopmentConfig
,
}
env
=
'default'
if
__name__
==
'__main__'
:
pass
This diff is collapsed.
Click to expand it.
terminal/ssh_server.py
deleted
100644 → 0
View file @
0954f6d7
This diff is collapsed.
Click to expand it.
terminal/utils.py
deleted
100644 → 0
View file @
0954f6d7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import
logging
from
logging.config
import
dictConfig
from
ssh_config
import
config
,
env
CONFIG_SSH_SERVER
=
config
.
get
(
env
)
def
get_logger
(
name
):
dictConfig
(
CONFIG_SSH_SERVER
.
LOGGING
)
return
logging
.
getLogger
(
'jumpserver.
%
s'
%
name
)
class
ControlChar
:
CHARS
=
{
'clear'
:
'
\x1b
[H
\x1b
[2J'
,
}
def
__init__
(
self
):
pass
def
__getattr__
(
self
,
item
):
return
self
.
__class__
.
CHARS
.
get
(
item
,
''
)
class
SSHServerException
(
Exception
):
pass
control_char
=
ControlChar
()
This diff is collapsed.
Click to expand it.
terminal/web_ssh_server.py
deleted
100644 → 0
View file @
0954f6d7
# -*- coding: utf-8 -*-
#
This diff is collapsed.
Click to expand it.
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