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
ff374b71
Commit
ff374b71
authored
May 17, 2017
by
GuangHongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Docker] Build a docker
parent
45898932
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
173 additions
and
22 deletions
+173
-22
Dockerfile
Dockerfile
+15
-8
Dockerfile-alpine-py3
Dockerfile-alpine-py3
+5
-0
Dockerfile-base-env-alpine
Dockerfile-base-env-alpine
+0
-10
settings.py
apps/jumpserver/settings.py
+1
-1
config_docker.py
config_docker.py
+149
-0
config_example.py
config_example.py
+2
-2
.gitkeep
data/.gitkeep
+0
-0
requirements.txt
requirements/requirements.txt
+1
-1
No files found.
Dockerfile
View file @
ff374b71
FROM
jumpserver/
base-env-alpine:latest
FROM
jumpserver/
alpine-py3:v3.4
MAINTAINER
Jumpserver Team <ibuler@qq.com>
LABEL
MAINTAINER Jumpserver Team <ibuler@qq.com>
#RUN apk add --update python gcc python-dev py-pip musl-dev linux-headers \
# libffi-dev openssl-dev jpeg-dev redis && rm -rf /var/cache/apk/*
COPY
. /opt/jumpserver
COPY
. /opt/jumpserver
COPY
config_docker.py /opt/jumpserver/config.py
WORKDIR
/opt/jumpserver
WORKDIR
/opt/jumpserver
RUN
rm
-r
.git
RUN
rm
-f
config.py
RUN
cp
config_example.py config.py
VOLUME
/opt/jumpserver/data
#RUN pip install -r requirements.txt -i https://pypi.doubanio.com/simple
VOLUME
/opt/jumpserver/logs
RUN
rm
-f
db.sqlite3
&&
cd
utils
&&
sh make_migrations.sh
&&
sh init_db.sh
RUN
ln
-s
/usr/bin/pip3 /usr/bin/pip
RUN
ln
-s
/usr/bin/python3 /usr/bin/python
RUN
cp
config_docker.py config.py
RUN
pip
install
-r
requirements/requirements.txt
RUN
cd
utils
&&
sh make_migrations.sh
&&
sh init_db.sh
EXPOSE
8080
EXPOSE
8080
CMD
redis-server utils/redis.conf &&
python run_server.py
CMD
python run_server.py
Dockerfile-alpine-py3
0 → 100644
View file @
ff374b71
FROM alpine:3.4
LABEL MAINTAINER Jumpserver Team <ibuler@qq.com>
RUN apk add --update python3 gcc python3-dev musl-dev linux-headers \
libffi-dev openssl-dev jpeg-dev freetype-dev && rm -rf /var/cache/apk/*
Dockerfile-base-env-alpine
deleted
100644 → 0
View file @
45898932
FROM alpine:3.4
MAINTAINER Jumpserver Team <ibuler@qq.com>
RUN apk add --update python gcc python-dev py-pip musl-dev linux-headers \
libffi-dev openssl-dev jpeg-dev freetype-dev redis && rm -rf /var/cache/apk/*
COPY ./requirements.txt /tmp
WORKDIR /tmp
RUN pip install -r requirements.txt -i https://pypi.doubanio.com/simple
\ No newline at end of file
apps/jumpserver/settings.py
View file @
ff374b71
...
@@ -121,7 +121,7 @@ if CONFIG.DB_ENGINE == 'sqlite':
...
@@ -121,7 +121,7 @@ if CONFIG.DB_ENGINE == 'sqlite':
DATABASES
=
{
DATABASES
=
{
'default'
:
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
CONFIG
.
DB_NAME
or
os
.
path
.
join
(
BASE_DIR
,
'db.sqlite3'
),
'NAME'
:
CONFIG
.
DB_NAME
or
os
.
path
.
join
(
BASE_DIR
,
'd
ata'
,
'd
b.sqlite3'
),
}
}
}
}
else
:
else
:
...
...
config_docker.py
0 → 100644
View file @
ff374b71
"""
jumpserver.config
~~~~~~~~~~~~~~~~~
Jumpserver project setting file
:copyright: (c) 2014-2016 by Jumpserver Team.
:license: GPL v2, see LICENSE for more details.
"""
import
os
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
LOG_DIR
=
os
.
path
.
join
(
BASE_DIR
,
'logs'
)
class
Config
:
# Use it to encrypt or decrypt data
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
os
.
environ
.
get
(
'SECRET_KEY'
)
or
'2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=
%
s_qj$1
%
x'
# How many line display every page, default 25
DISPLAY_PER_PAGE
=
25
# It's used to identify your site, When we send a create mail to user, we only know login url is /login/
# But we should know the absolute url like: http://jms.jumpserver.org/login/, so SITE_URL is
# HTTP_PROTOCOL://HOST[:PORT]
SITE_URL
=
'http://localhost'
# Domain name, If set app email will set as it
DOMAIN_NAME
=
'jumpserver.org'
# Django security setting, if your disable debug model, you should setting that
ALLOWED_HOSTS
=
[
'*'
]
# Development env open this, when error occur display the full process track, Production disable it
DEBUG
=
True
# DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/
LOG_LEVEL
=
'DEBUG'
# Database setting, Support sqlite3, mysql, postgres ....
# See https://docs.djangoproject.com/en/1.10/ref/settings/#databases
# Sqlite setting:
DB_ENGINE
=
'sqlite3'
DB_NAME
=
os
.
path
.
join
(
BASE_DIR
,
'data'
,
'db.sqlite3'
)
# Mysql or postgres setting like:
# DB_ENGINE = 'mysql'
# DB_HOST = '127.0.0.1'
# DB_PORT = 3306
# DB_USER = 'root'
# DB_PASSWORD = ''
# DB_NAME = 'jumpserver'
# When Django start it will bind this host and port
# ./manage.py runserver 127.0.0.1:8080
# Todo: Gunicorn or uwsgi run may be use it
HTTP_BIND_HOST
=
'0.0.0.0'
HTTP_LISTEN_PORT
=
8080
# Use Redis as broker for celery and web socket
REDIS_HOST
=
'127.0.0.1'
REDIS_PORT
=
6379
REDIS_PASSWORD
=
''
BROKER_URL
=
'redis://
%(password)
s
%(host)
s:
%(port)
s/3'
%
{
'password'
:
REDIS_PASSWORD
,
'host'
:
REDIS_HOST
,
'port'
:
REDIS_PORT
,
}
# Api token expiration when create
TOKEN_EXPIRATION
=
3600
# Session and csrf domain settings, If you deploy jumpserver,coco,luna standby,
# So than share cookie, and you need use a same top-level domain name
# SESSION_COOKIE_DOMAIN = '.jms.com'
# CSRF_COOKIE_DOMAIN = '.jms.com'
SESSION_COOKIE_AGE
=
3600
*
24
# Email SMTP setting, we only support smtp send mail
# EMAIL_HOST = 'smtp.qq.com'
# EMAIL_PORT = 25
# EMAIL_HOST_USER = ''
# EMAIL_HOST_PASSWORD = ''
# EMAIL_USE_SSL = False # If port is 465, set True
# EMAIL_USE_TLS = False # If port is 587, set True
# EMAIL_SUBJECT_PREFIX = '[Jumpserver] '
CAPTCHA_TEST_MODE
=
False
# You can set jumpserver usage url here, that when user submit wizard redirect to
USER_GUIDE_URL
=
''
def
__init__
(
self
):
pass
def
__getattr__
(
self
,
item
):
return
None
class
DevelopmentConfig
(
Config
):
DEBUG
=
True
DISPLAY_PER_PAGE
=
20
DB_ENGINE
=
'sqlite'
DB_NAME
=
os
.
path
.
join
(
BASE_DIR
,
'data'
,
'db.sqlite3'
)
EMAIL_HOST
=
'smtp.exmail.qq.com'
EMAIL_PORT
=
465
EMAIL_HOST_USER
=
'a@jumpserver.org'
EMAIL_HOST_PASSWORD
=
'somepasswrd'
EMAIL_USE_SSL
=
True
EMAIL_USE_TLS
=
False
EMAIL_SUBJECT_PREFIX
=
'[Jumpserver] '
SITE_URL
=
'http://localhost:8080'
class
ProductionConfig
(
Config
):
DEBUG
=
False
DB_ENGINE
=
'mysql'
DB_HOST
=
'127.0.0.1'
DB_PORT
=
3306
DB_USER
=
'root'
DB_PASSWORD
=
''
DB_NAME
=
'jumpserver'
class
DockerConfig
(
Config
):
DB_ENGINE
=
'sqlite'
DB_NAME
=
os
.
path
.
join
(
BASE_DIR
,
'data'
,
'db.sqlite3'
)
REDIS_HOST
=
os
.
environ
.
get
(
'REDIS_HOST'
)
or
'redis'
EMAIL_HOST
=
os
.
environ
.
get
(
'EMAIL_HOST'
)
or
'smtp.qq.com'
EMAIL_PORT
=
int
(
os
.
environ
.
get
(
'EMAIL_PORT'
,
465
))
EMAIL_HOST_USER
=
os
.
environ
.
get
(
'EMAIL_HOST_USER'
)
or
'admin'
EMAIL_HOST_PASSWORD
=
os
.
environ
.
get
(
'EMAIL_HOST_PASSWORD'
)
or
'somepasswrd'
EMAIL_USE_SSL
=
True
if
EMAIL_PORT
==
465
else
False
EMAIL_USE_TLS
=
True
if
EMAIL_PORT
==
587
else
False
EMAIL_SUBJECT_PREFIX
=
os
.
environ
.
get
(
'EMAIL_SUBJECT_PREFIX'
)
or
'[Jumpserver] '
SITE_URL
=
os
.
environ
.
get
(
'SITE_URL'
)
or
'http://localhost:8080'
config
=
{
'development'
:
DevelopmentConfig
,
'production'
:
ProductionConfig
,
'default'
:
DevelopmentConfig
,
'docker'
:
DockerConfig
,
}
env
=
'docker'
config_example.py
View file @
ff374b71
...
@@ -43,7 +43,7 @@ class Config:
...
@@ -43,7 +43,7 @@ class Config:
# Sqlite setting:
# Sqlite setting:
DATABASE_ENGINE
=
'sqlite3'
DATABASE_ENGINE
=
'sqlite3'
DB_NAME
=
os
.
path
.
join
(
BASE_DIR
,
'db.sqlite3'
)
DB_NAME
=
os
.
path
.
join
(
BASE_DIR
,
'd
ata'
,
'd
b.sqlite3'
)
# Mysql or postgres setting like:
# Mysql or postgres setting like:
# DB_ENGINE = 'mysql'
# DB_ENGINE = 'mysql'
...
@@ -104,7 +104,7 @@ class DevelopmentConfig(Config):
...
@@ -104,7 +104,7 @@ class DevelopmentConfig(Config):
DEBUG
=
True
DEBUG
=
True
DISPLAY_PER_PAGE
=
20
DISPLAY_PER_PAGE
=
20
DB_ENGINE
=
'sqlite'
DB_ENGINE
=
'sqlite'
DB_NAME
=
os
.
path
.
join
(
BASE_DIR
,
'db.sqlite3'
)
DB_NAME
=
os
.
path
.
join
(
BASE_DIR
,
'd
ata'
,
'd
b.sqlite3'
)
EMAIL_HOST
=
'smtp.exmail.qq.com'
EMAIL_HOST
=
'smtp.exmail.qq.com'
EMAIL_PORT
=
465
EMAIL_PORT
=
465
EMAIL_HOST_USER
=
'a@jumpserver.org'
EMAIL_HOST_USER
=
'a@jumpserver.org'
...
...
data/.gitkeep
0 → 100644
View file @
ff374b71
requirements/requirements.txt
View file @
ff374b71
...
@@ -3,7 +3,7 @@ django-bootstrap3>=8.2.2
...
@@ -3,7 +3,7 @@ django-bootstrap3>=8.2.2
Pillow>=4.1.0
Pillow>=4.1.0
djangorestframework>=3.6.2
djangorestframework>=3.6.2
ForgeryPy
ForgeryPy
openpyxl>=2.4.0
#
openpyxl>=2.4.0
celery>=4.0.2
celery>=4.0.2
paramiko>=2.1.2
paramiko>=2.1.2
ansible>=2.2.2.0
ansible>=2.2.2.0
...
...
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