Skip to content

Commit

Permalink
Merge pull request #332 from jumpserver/dev
Browse files Browse the repository at this point in the history
v3.5.0
  • Loading branch information
BaiJiangJie authored Jul 20, 2023
2 parents 32cee8a + d88ed1a commit 0044468
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 27 deletions.
48 changes: 46 additions & 2 deletions compose/docker-compose-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ services:
volumes:
- ${CONFIG_DIR}/core/config.yml:/opt/jumpserver/config.yml
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
- ${VOLUME_DIR}/core/logs:/opt/jumpserver/logs
healthcheck:
test: "curl -fsL http://localhost:8080/api/health/ > /dev/null"
interval: 10s
Expand All @@ -36,7 +35,6 @@ services:
ports:
- ${SSH_PORT}:2222
volumes:
- ${CONFIG_DIR}/koko/config.yml:/opt/koko/config.yml
- ${VOLUME_DIR}/koko/data:/opt/koko/data
depends_on:
core:
Expand Down Expand Up @@ -101,6 +99,52 @@ services:
networks:
- net

chen:
image: jumpserver/chen:${VERSION}
container_name: jms_chen
ulimits:
core: 0
restart: always
tty: true
env_file:
- ${CONFIG_FILE}
volumes:
- ${VOLUME_DIR}/chen/data:/opt/chen/data
depends_on:
core:
condition: service_healthy
healthcheck:
test: "curl -f 127.0.0.1:8082/chen"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
- net

kael:
image: jumpserver/kael:${VERSION}
container_name: jms_kael
ulimits:
core: 0
restart: always
tty: true
env_file:
- ${CONFIG_FILE}
volumes:
- ${VOLUME_DIR}/kael/data:/opt/kael/data
depends_on:
core:
condition: service_healthy
healthcheck:
test: "curl -fsL http://localhost:8083/kael/health/ > /dev/null"
interval: 10s
timeout: 5s
retries: 3
start_period: 90s
networks:
- net

web:
image: jumpserver/web:${VERSION}
container_name: jms_web
Expand Down
1 change: 0 additions & 1 deletion compose/docker-compose-init-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ services:
volumes:
- ${CONFIG_DIR}/core/config.yml:/opt/jumpserver/config.yml
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
- ${VOLUME_DIR}/core/logs:/opt/jumpserver/logs
networks:
- net
1 change: 0 additions & 1 deletion compose/docker-compose-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ services:
start_period: 30s
volumes:
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
- ${VOLUME_DIR}/core/logs:/opt/jumpserver/logs
networks:
- net
32 changes: 20 additions & 12 deletions compose/docker-compose-xpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,60 @@ services:
ports:
- ${MAGNUS_POSTGRESQL_PORT:-54320}:54320
- ${MAGNUS_ORACLE_PORTS:-30000-30030}:${MAGNUS_ORACLE_PORTS:-30000-30030}
chen:
image: registry.fit2cloud.com/jumpserver/chen:${VERSION}

kael:
image: registry.fit2cloud.com/jumpserver/kael:${VERSION}

web:
image: registry.fit2cloud.com/jumpserver/web:${VERSION}

omnidb:
image: registry.fit2cloud.com/jumpserver/omnidb:${VERSION}
container_name: jms_omnidb
razor:
image: registry.fit2cloud.com/jumpserver/razor:${VERSION}
container_name: jms_razor
ulimits:
core: 0
restart: always
tty: true
env_file:
- ${CONFIG_FILE}
ports:
- ${RDP_PORT}:3389
volumes:
- ${VOLUME_DIR}/omnidb/data:/opt/omnidb/data
- ${VOLUME_DIR}/razor/data:/opt/razor/data
- ${CONFIG_DIR}/nginx/cert:/opt/razor/cert
depends_on:
core:
condition: service_healthy
healthcheck:
test: "ps axu | grep -v 'grep' | grep 'omnidb'"
test: "ps axu | grep -v 'grep' | grep 'razor'"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
- net

razor:
image: registry.fit2cloud.com/jumpserver/razor:${VERSION}
container_name: jms_razor
xrdp:
image: registry.fit2cloud.com/jumpserver/xrdp:${VERSION}
container_name: jms_xrdp
ulimits:
core: 0
restart: always
tty: true
env_file:
- ${CONFIG_FILE}
ports:
- ${RDP_PORT}:3389
- ${XRDP_PORT:-3390}:3390
volumes:
- ${VOLUME_DIR}/razor/data:/opt/razor/data
- ${CONFIG_DIR}/nginx/cert:/opt/razor/cert
- ${VOLUME_DIR}/xrdp/data:/opt/xrdp/data
- ${CONFIG_DIR}/nginx/cert:/opt/xrdp/cert
depends_on:
core:
condition: service_healthy
healthcheck:
test: "ps axu | grep -v 'grep' | grep 'razor'"
test: "nc -z 127.0.0.1 3390 || exit 1"
interval: 10s
timeout: 5s
retries: 3
Expand Down
1 change: 1 addition & 0 deletions config-example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ JUMPSERVER_ENABLE_FONT_SMOOTHING=true
# XPack 包, 开源版本设置无效
#
RDP_PORT=3389
XRDP_PORT=3390

################################## 其他配置 ##################################
# 终端使用宿主 HOSTNAME 标识, 首次安装自动生成
Expand Down
Empty file removed config_init/koko/config.yml
Empty file.
4 changes: 1 addition & 3 deletions scripts/3_load_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ function load_image_files() {
filename=${filename_windows}
fi
if [[ ! -f ${IMAGE_DIR}/${filename} ]]; then
if [[ ! ${filename} =~ xpack* && ! ${filename} =~ omnidb* && ! ${filename} =~ razor* ]]; then
echo_red "$(gettext 'Docker image not found'): ${IMAGE_DIR}/${filename}"
fi
echo_red "$(gettext 'Docker image not found'): ${IMAGE_DIR}/${filename}"
continue
fi

Expand Down
17 changes: 17 additions & 0 deletions scripts/7_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function upgrade_config() {
docker stop jms_lb &>/dev/null
docker rm jms_lb &>/dev/null
fi
if docker ps -a | grep jms_omnidb &>/dev/null; then
docker stop jms_omnidb &>/dev/null
docker rm jms_omnidb &>/dev/null
fi
current_version=$(get_config CURRENT_VERSION)
if [ -z "${current_version}" ]; then
set_config CURRENT_VERSION "${VERSION}"
Expand Down Expand Up @@ -101,6 +105,11 @@ function upgrade_config() {
MAGNUS_ORACLE_PORTS=30000-30030
set_config MAGNUS_ORACLE_PORTS "${MAGNUS_ORACLE_PORTS}"
fi
xrdp_port=$(get_config XRDP_PORT)
if [ -z "${xrdp_port}" ]; then
XRDP_PORT=3390
set_config XRDP_PORT "${XRDP_PORT}"
fi
fi
}

Expand Down Expand Up @@ -137,6 +146,13 @@ function migrate_config_v1_5_to_v2_0() {
fi
}

function migrate_data_folder() {
volume_dir=$(get_config VOLUME_DIR)
if [[ -d "${volume_dir}/core/logs" ]] && [[ ! -d "${volume_dir}/core/data/logs" ]]; then
mv "${volume_dir}/core/logs" "${volume_dir}/core/data/logs"
fi
}

function migrate_config() {
prepare_config
}
Expand Down Expand Up @@ -189,6 +205,7 @@ function db_migrations() {
exit 1
fi
fi
migrate_data_folder
if ! perform_db_migrations; then
log_error "$(gettext 'Failed to change the table structure')!"
confirm="n"
Expand Down
2 changes: 1 addition & 1 deletion scripts/8_uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function remove_jumpserver() {
fi
echo
fi
if [ -f "/usr/local/bin/docker-compose"]; then
if [ -f "/usr/local/bin/docker-compose" ]; then
echo -e "$(gettext 'Cleaning up') /usr/local/bin/docker-compose"
rm -f /usr/local/bin/docker-compose
fi
Expand Down
8 changes: 4 additions & 4 deletions scripts/const.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ if [[ "$(uname -m)" == "loongarch64" ]]; then
fi
export DOCKER_MD5

export DOCKER_COMPOSE_VERSION=v2.17.3
export DOCKER_COMPOSE_VERSION=v2.19.1
export DOCKER_COMPOSE_MIRROR="https://download.jumpserver.org/docker/compose/releases/download"
export DOCKER_COMPOSE_BIN_URL="${DOCKER_COMPOSE_MIRROR}/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-$(uname -m)"
if [[ "$(uname -m)" == "x86_64" ]]; then
DOCKER_COMPOSE_MD5=18de31bb2d442cc76a0baa8e5eb4a34f
DOCKER_COMPOSE_MD5=43b50098b28c13232a9191760cbae5df
fi
if [[ "$(uname -m)" == "aarch64" ]]; then
DOCKER_COMPOSE_MD5=21e8dd3557573d8367357ba3238ca506
DOCKER_COMPOSE_MD5=bbe2efeaa423fab01f8d193e97903e59
fi
if [[ "$(uname -m)" == "loongarch64" ]]; then
DOCKER_COMPOSE_MD5=45c275eb50bf7eb022b28a5cce86eb19
DOCKER_COMPOSE_MD5=ce9e4ebbe578f7bbae979eabdd69d014
fi
export DOCKER_COMPOSE_MD5
10 changes: 7 additions & 3 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,19 @@ function get_images() {
echo "registry.fit2cloud.com/jumpserver/koko:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/lion:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/magnus:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/omnidb:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/chen:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/kael:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/razor:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/web:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/video-worker:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/xrdp:${VERSION}"
else
echo "jumpserver/core:${VERSION}"
echo "jumpserver/koko:${VERSION}"
echo "jumpserver/lion:${VERSION}"
echo "jumpserver/magnus:${VERSION}"
echo "jumpserver/chen:${VERSION}"
echo "jumpserver/kael:${VERSION}"
echo "jumpserver/web:${VERSION}"
fi
}
Expand Down Expand Up @@ -239,7 +243,7 @@ function log_error() {

function get_docker_compose_services() {
ignore_db="$1"
services="core koko lion magnus web"
services="core koko lion magnus chen kael web"
use_task=$(get_config USE_TASK)
if [[ "${use_task}" != "0" ]]; then
services+=" celery"
Expand Down Expand Up @@ -267,7 +271,7 @@ function get_docker_compose_services() {
fi
use_xpack=$(get_config_or_env USE_XPACK)
if [[ "${use_xpack}" == "1" ]]; then
services+=" omnidb razor"
services+=" razor xrdp"
fi
use_video=$(get_config USE_VIDEO)
if [[ "${use_xpack}" == "1" && "${use_video}" == "1" ]]; then
Expand Down

0 comments on commit 0044468

Please sign in to comment.