软件下载
wget https://github.com/hhyo/Archery/archive/refs/tags/v1.9.1.tar.gz -O Archery-1.9.1.tar.gz
tar -zxvf Archery-1.9.1.tar.gz
需要开启防火墙
systemctl start firewalld
安装docker
yum install docker-ce -y
启动docker
systemctl start docker
安装docker-compose
yum -y install docker-compose
启动archery 初始化配置
# 进入目录
cd Archery-1.9.1/src/docker-compose
# 修改配置文件
vim docker-compose.yaml
version: '3'
services:
redis:
image: redis:5
container_name: redis
restart: always
command: redis-server --requirepass 123456
expose:
- "6379"
mysql:
image: mysql:5.7
container_name: mysql
restart: always
ports:
- "3306:3306"
volumes:
- "./mysql/my.cnf:/etc/mysql/my.cnf"
- "./mysql/datadir:/var/lib/mysql"
environment:
MYSQL_DATABASE: archery
MYSQL_ROOT_PASSWORD: 123456 # 修改archery 数据库密码
goinception:
image: hanchuanchuan/goinception
container_name: goinception
restart: always
ports:
- "4000:4000"
volumes:
- "./inception/config.toml:/etc/config.toml"
archery:
image: hhyo/archery:v1.9.1
container_name: archery
restart: always
ports:
- "9123:9123"
volumes:
- "./archery/settings.py:/opt/archery/local_settings.py"
- "./archery/soar.yaml:/etc/soar.yaml"
- "./archery/docs.md:/opt/archery/docs/docs.md"
- "./archery/downloads:/opt/archery/downloads"
- "./archery/sql/migrations:/opt/archery/sql/migrations"
- "./archery/logs:/opt/archery/logs"
- "./archery/keys:/opt/archery/keys"
entrypoint: "dockerize -wait tcp://mysql:3306 -wait tcp://redis:6379 -timeout 60s /opt/archery/src/docker/startup.sh"
env_file:
- .env
修改mysql 配置信息
vim /root/archery-1.9.1/src/docker-compose/archery/settings.py
# -*- coding: UTF-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'archery',
'USER': 'root',
'PASSWORD': '123456', # 修改密码
'HOST': '192.168.217.145', # 修改mysql 镜像的权限
'PORT': '3306',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
'charset': 'utf8mb4'
},
'TEST': {
'NAME': 'test_archery',
'CHARSET': 'utf8mb4',
},
}
}
修改docker mysql5.7的root 权限
#登录mysql 容器
docker exec -it mysql /bin/bash
#查询权限
select User,authentication_string,Host from user;
# 给root赋予权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' ;
flush privileges;
表初始化
docker exec -ti archery /bin/bash
cd /opt/archery
source /opt/venv4archery/bin/activate
python3 manage.py makemigrations sql
python3 manage.py migrate
数据初始化
python3 manage.py dbshell<sql/fixtures/auth_group.sql
python3 manage.py dbshell<src/init_sql/mysql_slow_query_review.sql
创建管理用户
python3 manage.py createsuperuser #admin/adminadmin
交互信息
admin
admin@qq.com
123456
123456 再次确认密码
重启服务
docker restart archery
网页访问
配置sql上线
必须配置 goInception配置
、工单审核流配置
添加实例
增加对应的组 在实例列表里面选择实例名称 选择对应的 组
测试实例的连通性
增加资源组
提交sql 上线之后 执行报错
修改goinception 的配置
vim /root/archery-1.9.1/src/docker-compose/inception/config.toml
重启goception 服务
docker restart goception