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
71c2dca4
Commit
71c2dca4
authored
Mar 04, 2019
by
wojiushixiaobai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'docs' of
https://github.com/wojiushixiaobai/jumpserver
into docs
parents
6879b214
4eab55d2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
54 deletions
+38
-54
setup_by_fast.rst
docs/setup_by_fast.rst
+2
-1
setup_by_ubuntu.rst
docs/setup_by_ubuntu.rst
+8
-26
setup_by_ubuntu18.rst
docs/setup_by_ubuntu18.rst
+1
-0
step_by_step.rst
docs/step_by_step.rst
+18
-27
user_api.rst
docs/user_api.rst
+9
-0
No files found.
docs/setup_by_fast.rst
View file @
71c2dca4
...
...
@@ -37,7 +37,8 @@
&& yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo \
&& yum makecache fast \
&& rpm --import https://mirrors.aliyun.com/docker-ce/linux/centos/gpg \
&& echo -e "[nginx]\nname=nginx repo\nbaseurl=http://nginx.org/packages/centos/7/\$basearch/\ngpgcheck=0\nenabled=1\n" > /etc/yum.repos.d/nginx.repo \
&& echo -e "[nginx-stable]\nname=nginx stable repo\nbaseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/\ngpgcheck=1\nenabled=1\ngpgkey=https://nginx.org/keys/nginx_signing.key" > /etc/yum.repos.d/nginx.repo \
&& rpm --import https://nginx.org/keys/nginx_signing.key \
&& yum -y install redis mariadb mariadb-devel mariadb-server nginx docker-ce \
&& systemctl enable redis mariadb nginx docker \
&& systemctl start redis mariadb \
...
...
docs/setup_by_ubuntu.rst
View file @
71c2dca4
...
...
@@ -54,17 +54,6 @@
# 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行
(py3) [root@localhost py3]
**1.4 自动载入 Python 虚拟环境配置**
此项仅为懒癌晚期的人员使用,防止运行 Jumpserver 时忘记载入 Python 虚拟环境导致程序无法运行。使用autoenv
.. code-block:: shell
$ cd /opt
$ git clone https://github.com/kennethreitz/autoenv.git
$ echo 'source /opt/autoenv/activate.sh' >> ~/.bashrc
$ source ~/.bashrc
二. 安装 Jumpserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
@@ -76,10 +65,6 @@
$ cd /opt/
$ git clone https://github.com/jumpserver/jumpserver.git
$ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env # 进入 jumpserver 目录时将自动载入 python 虚拟环境
# 首次进入 jumpserver 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**2.2 安装依赖包**
...
...
@@ -95,6 +80,10 @@
$ pip install --upgrade pip setuptools
$ pip install -r requirements.txt
# 如果下载速度很慢, 可以换国内源
$ pip install --upgrade pip setuptools -i https://mirrors.aliyun.com/pypi/simple/
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
**2.4 安装 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke**
.. code-block:: shell
...
...
@@ -225,17 +214,11 @@
**3.1 下载或 Clone 项目**
新开一个终端
.. code-block:: shell
$ cd /opt
$ source /opt/py3/bin/activate
$ git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master
$ echo "source /opt/py3/bin/activate" > /opt/coco/.env # 进入 coco 目录时将自动载入 python 虚拟环境
# 首次进入 coco 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**3.2 安装依赖**
...
...
@@ -244,12 +227,14 @@
$ cd /opt/coco/requirements
$ pip install -r requirements.txt
# 如果下载速度很慢, 可以换国内源
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
**3.3 查看配置文件并运行**
.. code-block:: shell
$ cd /opt/coco
$ mkdir keys logs
$ cp config_example.yml config.yml
$ vim config.yml
...
...
@@ -318,7 +303,7 @@
.. code-block:: shell
$ ./cocod start # 后台运行使用 -d 参数./cocod start -d
$ ./cocod start
-d
# 后台运行使用 -d 参数./cocod start -d
# 新版本更新了运行脚本,使用方式./cocod start|stop|status|restart 后台运行请添加 -d 参数
...
...
@@ -424,10 +409,8 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
$ apt-get -y install nginx
$ rm -rf /etc/nginx/site-enabled/default
**6.2 准备配置文件 修改 /etc/nginx/site-enabled/jumpserver.conf**
.. code-block:: nginx
$ vim /etc/nginx/site-enabled/jumpserver.conf
...
...
@@ -499,7 +482,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
$ nginx -t # 如果没有报错请继续
$ nginx -s reload
**6.4 开始使用 Jumpserver**
服务全部启动后,访问 http://192.168.244.144
...
...
docs/setup_by_ubuntu18.rst
View file @
71c2dca4
...
...
@@ -259,6 +259,7 @@ Ubuntu 18.04 安装文档
.. code-block:: shell
$ apt-get -y install curl gnupg2 ca-certificates lsb-release
$ add-apt-repository "deb http://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx"
$ curl -fsSL http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
$ apt-get -y install nginx
...
...
docs/step_by_step.rst
View file @
71c2dca4
...
...
@@ -51,6 +51,10 @@
$ yum -y install python36 python36-devel
# 如果下载速度很慢, 可以换国内源
$ wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
$ yum -y install python36 python36-devel
**1.3 建立 Python 虚拟环境**
因为 CentOS 7 自带的是 Python2,而 Yum 等工具依赖原来的 Python,为了不扰乱原来的环境我们来使用 Python 虚拟环境
...
...
@@ -64,17 +68,6 @@
# 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行
(py3) [root@localhost py3]
**1.4 自动载入 Python 虚拟环境配置**
此项仅为懒癌晚期的人员使用,防止运行 Jumpserver 时忘记载入 Python 虚拟环境导致程序无法运行。使用autoenv
.. code-block:: shell
$ cd /opt
$ git clone https://github.com/kennethreitz/autoenv.git
$ echo 'source /opt/autoenv/activate.sh' >> ~/.bashrc
$ source ~/.bashrc
二. 安装 Jumpserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
@@ -86,10 +79,6 @@
$ cd /opt/
$ git clone https://github.com/jumpserver/jumpserver.git
$ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env # 进入 jumpserver 目录时将自动载入 python 虚拟环境
# 首次进入 jumpserver 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**2.2 安装依赖 RPM 包**
...
...
@@ -105,6 +94,10 @@
$ pip install --upgrade pip setuptools
$ pip install -r requirements.txt
# 如果下载速度很慢, 可以换国内源
$ pip install --upgrade pip setuptools -i https://mirrors.aliyun.com/pypi/simple/
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
**2.4 安装 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke**
.. code-block:: shell
...
...
@@ -244,25 +237,23 @@
$ cd /opt
$ source /opt/py3/bin/activate
$ git clone https://github.com/jumpserver/coco.git
$ echo "source /opt/py3/bin/activate" > /opt/coco/.env # 进入 coco 目录时将自动载入 python 虚拟环境
# 首次进入 coco 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
**3.2 安装依赖**
.. code-block:: shell
$ cd /opt/coco/requirements
$ yum -y
install $(cat rpm_requirements.txt)
$ yum -y install $(cat rpm_requirements.txt)
$ pip install -r requirements.txt
# 如果下载速度很慢, 可以换国内源
$ pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
**3.3 修改配置文件并运行**
.. code-block:: shell
$ cd /opt/coco
$ mkdir keys logs
$ cp config_example.yml config.yml
$ sed -i "s/BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/coco/config.yml
...
...
@@ -357,8 +348,6 @@ Luna 已改为纯前端,需要 Nginx 来运行访问
五. 安装 Windows 支持组件(如果不需要管理 windows 资产,可以直接跳过这一步)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Guacamole 需要 Tomcat 来运行
**5.1 安装依赖**
.. code-block:: shell
...
...
@@ -441,13 +430,15 @@ Guacamole 需要 Tomcat 来运行
.. code-block:: shell
$ yum install yum-utils
$ vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/
7
/$basearch/
gpgcheck=
0
[nginx
-stable
]
name=nginx
stable
repo
baseurl=http://nginx.org/packages/centos/
$releasever
/$basearch/
gpgcheck=
1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
$ yum install -y nginx
$ rm -rf /etc/nginx/conf.d/default.conf
...
...
docs/user_api.rst
View file @
71c2dca4
...
...
@@ -29,6 +29,15 @@ API 文档
$ curl -H 'Authorization: Bearer 937b38011acf499eb474e2fecb424ab3' -H "Content-Type:application/json" http://localhost/api/users/v1/users/
# 使用token访问,token有效期 1小时
# 也可以创建一个永久 private_token , 避免二次认证
$ python manage.py shell
>>> from users.models import User
>>> u = User.objects.get(username='admin')
>>> u.create_private_token()
937b38011acf499eb474e2fecb424ab3
$ curl -H 'Authorization: Token 937b38011acf499eb474e2fecb424ab3' -H "Content-Type:application/json" http://localhost/api/users/v1/users/
- python代码示例
.. code-block:: python
...
...
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