From 139238248797928b966797362d4830881c7163ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 8 Apr 2024 09:49:59 +0800 Subject: [PATCH 01/36] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ocker-compose-celery.yml => celery-ce.yml} | 1 - ...compose-celery-xpack.yml => celery-ee.yml} | 0 .../{docker-compose-chen.yml => chen-ce.yml} | 5 +- compose/chen-ee.yml | 3 + .../{docker-compose-core.yml => core-ce.yml} | 3 +- ...ker-compose-core-xpack.yml => core-ee.yml} | 0 compose/docker-compose-init-db-xpack.yml | 3 - compose/docker-compose-kael.yml | 22 ---- compose/docker-compose-magnus-xpack.yml | 6 - compose/{docker-compose-es.yml => es.yml} | 0 ...docker-compose-init-db.yml => init-db.yml} | 1 - .../{docker-compose-koko.yml => koko-ce.yml} | 7 +- compose/koko-ee.yml | 5 + compose/{docker-compose-lb.yml => lb.yml} | 0 .../{docker-compose-lion.yml => lion-ce.yml} | 5 +- compose/lion-ee.yml | 3 + .../{docker-compose-magnus.yml => magnus.yml} | 4 +- ...docker-compose-mariadb.yml => mariadb.yml} | 0 .../{docker-compose-minio.yml => minio.yml} | 0 .../{docker-compose-mysql.yml => mysql.yml} | 0 ...-compose-network_v6.yml => network-v6.yml} | 0 ...docker-compose-network.yml => network.yml} | 0 .../{docker-compose-panda.yml => panda.yml} | 1 - .../{docker-compose-razor.yml => razor.yml} | 1 - .../{docker-compose-redis.yml => redis.yml} | 0 ...pose-video-worker.yml => video-worker.yml} | 1 - .../{docker-compose-video.yml => video.yml} | 1 - .../{docker-compose-web.yml => web-ce.yml} | 7 +- compose/web-ee.yml | 3 + compose/{docker-compose-xrdp.yml => xrdp.yml} | 1 - config-example.txt | 18 ++- scripts/1_config_jumpserver.sh | 5 +- scripts/4_install_jumpserver.sh | 11 +- scripts/utils.sh | 111 +++++++++--------- 34 files changed, 100 insertions(+), 128 deletions(-) rename compose/{docker-compose-celery.yml => celery-ce.yml} (97%) rename compose/{docker-compose-celery-xpack.yml => celery-ee.yml} (100%) rename compose/{docker-compose-chen.yml => chen-ce.yml} (76%) create mode 100644 compose/chen-ee.yml rename compose/{docker-compose-core.yml => core-ce.yml} (85%) rename compose/{docker-compose-core-xpack.yml => core-ee.yml} (100%) delete mode 100644 compose/docker-compose-init-db-xpack.yml delete mode 100644 compose/docker-compose-kael.yml delete mode 100644 compose/docker-compose-magnus-xpack.yml rename compose/{docker-compose-es.yml => es.yml} (100%) rename compose/{docker-compose-init-db.yml => init-db.yml} (96%) rename compose/{docker-compose-koko.yml => koko-ce.yml} (68%) create mode 100644 compose/koko-ee.yml rename compose/{docker-compose-lb.yml => lb.yml} (100%) rename compose/{docker-compose-lion.yml => lion-ce.yml} (72%) create mode 100644 compose/lion-ee.yml rename compose/{docker-compose-magnus.yml => magnus.yml} (78%) rename compose/{docker-compose-mariadb.yml => mariadb.yml} (100%) rename compose/{docker-compose-minio.yml => minio.yml} (100%) rename compose/{docker-compose-mysql.yml => mysql.yml} (100%) rename compose/{docker-compose-network_v6.yml => network-v6.yml} (100%) rename compose/{docker-compose-network.yml => network.yml} (100%) rename compose/{docker-compose-panda.yml => panda.yml} (97%) rename compose/{docker-compose-razor.yml => razor.yml} (97%) rename compose/{docker-compose-redis.yml => redis.yml} (100%) rename compose/{docker-compose-video-worker.yml => video-worker.yml} (97%) rename compose/{docker-compose-video.yml => video.yml} (97%) rename compose/{docker-compose-web.yml => web-ce.yml} (81%) create mode 100644 compose/web-ee.yml rename compose/{docker-compose-xrdp.yml => xrdp.yml} (97%) diff --git a/compose/docker-compose-celery.yml b/compose/celery-ce.yml similarity index 97% rename from compose/docker-compose-celery.yml rename to compose/celery-ce.yml index a5921097..a37e0a6b 100644 --- a/compose/docker-compose-celery.yml +++ b/compose/celery-ce.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true command: start task env_file: - ${CONFIG_FILE} diff --git a/compose/docker-compose-celery-xpack.yml b/compose/celery-ee.yml similarity index 100% rename from compose/docker-compose-celery-xpack.yml rename to compose/celery-ee.yml diff --git a/compose/docker-compose-chen.yml b/compose/chen-ce.yml similarity index 76% rename from compose/docker-compose-chen.yml rename to compose/chen-ce.yml index fbf6d2fb..e0f47d85 100644 --- a/compose/docker-compose-chen.yml +++ b/compose/chen-ce.yml @@ -1,19 +1,18 @@ services: chen: - image: ${REGISTRY:-docker.io}/jumpserver/chen:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/chen-ce:${VERSION} container_name: jms_chen hostname: jms_chen ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: - ${VOLUME_DIR}/chen/data:/opt/chen/data - ${CONFIG_DIR}/certs:/opt/chen/data/certs healthcheck: - test: "curl -f 127.0.0.1:8082/chen" + test: "check http://localhost:8082/chen/" interval: 10s timeout: 5s retries: 3 diff --git a/compose/chen-ee.yml b/compose/chen-ee.yml new file mode 100644 index 00000000..e3b1015f --- /dev/null +++ b/compose/chen-ee.yml @@ -0,0 +1,3 @@ +services: + chen: + image: ${REGISTRY:-docker.io}/jumpserver/chen-ee:${VERSION} \ No newline at end of file diff --git a/compose/docker-compose-core.yml b/compose/core-ce.yml similarity index 85% rename from compose/docker-compose-core.yml rename to compose/core-ce.yml index d684c26c..5ef22afc 100644 --- a/compose/docker-compose-core.yml +++ b/compose/core-ce.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true command: start web env_file: - ${CONFIG_FILE} @@ -14,7 +13,7 @@ services: - ${CONFIG_DIR}/certs:/opt/jumpserver/data/certs - ${VOLUME_DIR}/core/data:/opt/jumpserver/data healthcheck: - test: "curl -fsL http://localhost:8080/api/health/ > /dev/null" + test: "check http://localhost:8080/api/health/" interval: 10s timeout: 5s retries: 3 diff --git a/compose/docker-compose-core-xpack.yml b/compose/core-ee.yml similarity index 100% rename from compose/docker-compose-core-xpack.yml rename to compose/core-ee.yml diff --git a/compose/docker-compose-init-db-xpack.yml b/compose/docker-compose-init-db-xpack.yml deleted file mode 100644 index b6a33364..00000000 --- a/compose/docker-compose-init-db-xpack.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - core: - image: ${REGISTRY:-docker.io}/jumpserver/core-ee:${VERSION} diff --git a/compose/docker-compose-kael.yml b/compose/docker-compose-kael.yml deleted file mode 100644 index c91ab3c4..00000000 --- a/compose/docker-compose-kael.yml +++ /dev/null @@ -1,22 +0,0 @@ -services: - kael: - image: ${REGISTRY:-docker.io}/jumpserver/kael:${VERSION} - container_name: jms_kael - hostname: jms_kael - ulimits: - core: 0 - restart: always - tty: true - env_file: - - ${CONFIG_FILE} - volumes: - - ${CONFIG_DIR}/certs:/opt/kael/data/certs - - ${VOLUME_DIR}/kael/data:/opt/kael/data - healthcheck: - test: "curl -fsL http://localhost:8083/kael/health/ > /dev/null" - interval: 10s - timeout: 5s - retries: 3 - start_period: 60s - networks: - - net \ No newline at end of file diff --git a/compose/docker-compose-magnus-xpack.yml b/compose/docker-compose-magnus-xpack.yml deleted file mode 100644 index 069136eb..00000000 --- a/compose/docker-compose-magnus-xpack.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - magnus: - ports: - - ${MAGNUS_POSTGRESQL_PORT:-54320}:54320 - - ${MAGNUS_SQLSERVER_PORT:-14330}:14330 - - ${MAGNUS_ORACLE_PORTS:-30000-30030}:${MAGNUS_ORACLE_PORTS:-30000-30030} diff --git a/compose/docker-compose-es.yml b/compose/es.yml similarity index 100% rename from compose/docker-compose-es.yml rename to compose/es.yml diff --git a/compose/docker-compose-init-db.yml b/compose/init-db.yml similarity index 96% rename from compose/docker-compose-init-db.yml rename to compose/init-db.yml index 991ad635..caec6c6a 100644 --- a/compose/docker-compose-init-db.yml +++ b/compose/init-db.yml @@ -3,7 +3,6 @@ services: image: ${REGISTRY:-docker.io}/jumpserver/core-ce:${VERSION} container_name: jms_core hostname: jms_core - tty: true command: sleep env_file: - ${CONFIG_FILE} diff --git a/compose/docker-compose-koko.yml b/compose/koko-ce.yml similarity index 68% rename from compose/docker-compose-koko.yml rename to compose/koko-ce.yml index b5a6fe72..3622d809 100644 --- a/compose/docker-compose-koko.yml +++ b/compose/koko-ce.yml @@ -1,22 +1,19 @@ services: koko: - image: ${REGISTRY:-docker.io}/jumpserver/koko:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/koko-ce:${VERSION} container_name: jms_koko hostname: jms_koko ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} - ports: - - ${SSH_PORT}:2222 volumes: - ${CONFIG_DIR}/certs:/opt/koko/data/certs - ${VOLUME_DIR}/koko/data:/opt/koko/data privileged: true healthcheck: - test: "curl -fsL http://localhost:5000/koko/health/ > /dev/null" + test: "check http://localhost:5000/koko/health/" interval: 10s timeout: 5s retries: 3 diff --git a/compose/koko-ee.yml b/compose/koko-ee.yml new file mode 100644 index 00000000..a46dfdd4 --- /dev/null +++ b/compose/koko-ee.yml @@ -0,0 +1,5 @@ +services: + koko: + image: ${REGISTRY:-docker.io}/jumpserver/koko-ee:${VERSION} + ports: + - ${SSH_PORT}:2222 \ No newline at end of file diff --git a/compose/docker-compose-lb.yml b/compose/lb.yml similarity index 100% rename from compose/docker-compose-lb.yml rename to compose/lb.yml diff --git a/compose/docker-compose-lion.yml b/compose/lion-ce.yml similarity index 72% rename from compose/docker-compose-lion.yml rename to compose/lion-ce.yml index 31a7a2e3..081c1ae8 100644 --- a/compose/docker-compose-lion.yml +++ b/compose/lion-ce.yml @@ -1,19 +1,18 @@ services: lion: - image: ${REGISTRY:-docker.io}/jumpserver/lion:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/lion-ce:${VERSION} container_name: jms_lion hostname: jms_lion ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: - ${CONFIG_DIR}/certs:/opt/lion/data/certs - ${VOLUME_DIR}/lion/data:/opt/lion/data healthcheck: - test: "curl -fsL http://localhost:8081/lion/health/ > /dev/null" + test: "check http://localhost:8081/lion/health/" interval: 10s timeout: 5s retries: 3 diff --git a/compose/lion-ee.yml b/compose/lion-ee.yml new file mode 100644 index 00000000..e0135fb0 --- /dev/null +++ b/compose/lion-ee.yml @@ -0,0 +1,3 @@ +services: + lion: + image: ${REGISTRY:-docker.io}/jumpserver/lion-ee:${VERSION} \ No newline at end of file diff --git a/compose/docker-compose-magnus.yml b/compose/magnus.yml similarity index 78% rename from compose/docker-compose-magnus.yml rename to compose/magnus.yml index 833e85b3..7911f670 100644 --- a/compose/docker-compose-magnus.yml +++ b/compose/magnus.yml @@ -6,13 +6,15 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: - ${MAGNUS_MYSQL_PORT:-33061}:33061 - ${MAGNUS_MARIADB_PORT:-33062}:33062 - ${MAGNUS_REDIS_PORT:-63790}:63790 + - ${MAGNUS_POSTGRESQL_PORT:-54320}:54320 + - ${MAGNUS_SQLSERVER_PORT:-14330}:14330 + - ${MAGNUS_ORACLE_PORTS:-30000-30030}:${MAGNUS_ORACLE_PORTS:-30000-30030} volumes: - ${CONFIG_DIR}/certs:/opt/magnus/data/certs - ${VOLUME_DIR}/magnus/data:/opt/magnus/data diff --git a/compose/docker-compose-mariadb.yml b/compose/mariadb.yml similarity index 100% rename from compose/docker-compose-mariadb.yml rename to compose/mariadb.yml diff --git a/compose/docker-compose-minio.yml b/compose/minio.yml similarity index 100% rename from compose/docker-compose-minio.yml rename to compose/minio.yml diff --git a/compose/docker-compose-mysql.yml b/compose/mysql.yml similarity index 100% rename from compose/docker-compose-mysql.yml rename to compose/mysql.yml diff --git a/compose/docker-compose-network_v6.yml b/compose/network-v6.yml similarity index 100% rename from compose/docker-compose-network_v6.yml rename to compose/network-v6.yml diff --git a/compose/docker-compose-network.yml b/compose/network.yml similarity index 100% rename from compose/docker-compose-network.yml rename to compose/network.yml diff --git a/compose/docker-compose-panda.yml b/compose/panda.yml similarity index 97% rename from compose/docker-compose-panda.yml rename to compose/panda.yml index 8f0cc794..1b26bceb 100644 --- a/compose/docker-compose-panda.yml +++ b/compose/panda.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/docker-compose-razor.yml b/compose/razor.yml similarity index 97% rename from compose/docker-compose-razor.yml rename to compose/razor.yml index f3fd4dc6..67e4b502 100644 --- a/compose/docker-compose-razor.yml +++ b/compose/razor.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: diff --git a/compose/docker-compose-redis.yml b/compose/redis.yml similarity index 100% rename from compose/docker-compose-redis.yml rename to compose/redis.yml diff --git a/compose/docker-compose-video-worker.yml b/compose/video-worker.yml similarity index 97% rename from compose/docker-compose-video-worker.yml rename to compose/video-worker.yml index c79fe93c..b1e35b71 100644 --- a/compose/docker-compose-video-worker.yml +++ b/compose/video-worker.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: diff --git a/compose/docker-compose-video.yml b/compose/video.yml similarity index 97% rename from compose/docker-compose-video.yml rename to compose/video.yml index cc59c52b..547df76b 100644 --- a/compose/docker-compose-video.yml +++ b/compose/video.yml @@ -7,7 +7,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/docker-compose-web.yml b/compose/web-ce.yml similarity index 81% rename from compose/docker-compose-web.yml rename to compose/web-ce.yml index 538fba0b..216651f2 100644 --- a/compose/docker-compose-web.yml +++ b/compose/web-ce.yml @@ -1,12 +1,11 @@ services: web: - image: ${REGISTRY:-docker.io}/jumpserver/web:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/web-ce:${VERSION} container_name: jms_web hostname: jms_web ulimits: core: 0 restart: always - tty: true environment: HTTP_PORT: ${HTTP_PORT:-80} USE_LB: ${USE_LB:-1} @@ -17,7 +16,7 @@ services: KOKO_ENABLED: ${KOKO_ENABLED:-1} LION_ENABLED: ${LION_ENABLED:-1} CHEN_ENABLED: ${CHEN_ENABLED:-1} - KAEL_ENABLED: ${KAEL_ENABLED:-1} + KAEL_ENABLED: ${KAEL_ENABLED:-0} RAZOR_ENABLED: ${RAZOR_ENABLED:-0} ports: - ${HTTP_PORT:-80}:${HTTP_PORT:-80} @@ -25,7 +24,7 @@ services: - ${VOLUME_DIR}/core/data:/opt/jumpserver/data - ${VOLUME_DIR}/nginx/data/logs:/var/log/nginx healthcheck: - test: "curl -k -fsL http://localhost:51980/api/health/ > /dev/null" + test: "check http://localhost:51980/api/health/" interval: 10s timeout: 5s retries: 3 diff --git a/compose/web-ee.yml b/compose/web-ee.yml new file mode 100644 index 00000000..f7d07308 --- /dev/null +++ b/compose/web-ee.yml @@ -0,0 +1,3 @@ +services: + web: + image: ${REGISTRY:-docker.io}/jumpserver/web-ee:${VERSION} \ No newline at end of file diff --git a/compose/docker-compose-xrdp.yml b/compose/xrdp.yml similarity index 97% rename from compose/docker-compose-xrdp.yml rename to compose/xrdp.yml index d53d6449..1020e163 100644 --- a/compose/docker-compose-xrdp.yml +++ b/compose/xrdp.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: diff --git a/config-example.txt b/config-example.txt index a748a93a..8d762d9a 100644 --- a/config-example.txt +++ b/config-example.txt @@ -86,13 +86,6 @@ REDIS_PASSWORD= # 对外提供服务端口, 如果与现有服务冲突请自行修改 # HTTP_PORT=80 -SSH_PORT=2222 -MAGNUS_MYSQL_PORT=33061 -MAGNUS_MARIADB_PORT=33062 -MAGNUS_REDIS_PORT=63790 -MAGNUS_POSTGRESQL_PORT=54320 -MAGNUS_SQLSERVER_PORT=14330 -MAGNUS_ORACLE_PORTS=30000-30030 ################################# HTTPS 配置 ################################# # 参考 https://docs.jumpserver.org/zh/v3/installation/proxy/ 配置 @@ -132,10 +125,8 @@ DOMAINS= # CELERY_ENABLED=0 # KOKO_ENABLED=0 # LION_ENABLED=0 -# MAGNUS_ENABLED=0 # CHEN_ENABLED=0 -# KAEL_ENABLED=0 -# PANDA_ENABLED=0 +# WEB_ENABLED=0 # Lion 开启字体平滑, 优化体验 # @@ -144,8 +135,15 @@ JUMPSERVER_ENABLE_FONT_SMOOTHING=true ################################# XPack 配置 ################################# # XPack 包, 开源版本设置无效 # +SSH_PORT=2222 RDP_PORT=3389 XRDP_PORT=3390 +MAGNUS_MYSQL_PORT=33061 +MAGNUS_MARIADB_PORT=33062 +MAGNUS_REDIS_PORT=63790 +MAGNUS_POSTGRESQL_PORT=54320 +MAGNUS_SQLSERVER_PORT=14330 +MAGNUS_ORACLE_PORTS=30000-30030 ################################## 其他配置 ################################## # 终端使用宿主 HOSTNAME 标识, 首次安装自动生成 diff --git a/scripts/1_config_jumpserver.sh b/scripts/1_config_jumpserver.sh index aae3d4a7..96a82d29 100644 --- a/scripts/1_config_jumpserver.sh +++ b/scripts/1_config_jumpserver.sh @@ -158,9 +158,10 @@ function set_service() { if [[ "${confirm}" == "y" ]]; then read_from_input http_port "$(gettext 'JumpServer web port')" "" "${http_port}" set_config HTTP_PORT "${http_port}" - read_from_input ssh_port "$(gettext 'JumpServer ssh port')" "" "${ssh_port}" - set_config SSH_PORT "${ssh_port}" + if [[ "${use_xpack}" == "1" ]]; then + read_from_input ssh_port "$(gettext 'JumpServer ssh port')" "" "${ssh_port}" + set_config SSH_PORT "${ssh_port}" read_from_input rdp_port "$(gettext 'JumpServer rdp port')" "" "${rdp_port}" set_config RDP_PORT "${rdp_port}" fi diff --git a/scripts/4_install_jumpserver.sh b/scripts/4_install_jumpserver.sh index 83c201da..c004ca82 100644 --- a/scripts/4_install_jumpserver.sh +++ b/scripts/4_install_jumpserver.sh @@ -27,6 +27,7 @@ function post_install() { https_port=$(get_config HTTPS_PORT) server_name=$(get_config SERVER_NAME) ssh_port=$(get_config SSH_PORT) + use_xpack=$(get_config_or_env USE_XPACK) echo_yellow "1. $(gettext 'You can use the following command to start, and then visit')" echo "cd ${PROJECT_DIR}" @@ -48,11 +49,13 @@ function post_install() { echo "$(gettext 'Default username'): admin $(gettext 'Default password'): admin" - echo_yellow "\n4. SSH/SFTP $(gettext 'access')" - echo "ssh -p${ssh_port} admin@${host}" - echo "sftp -P${ssh_port} admin@${host}" + if [[ "${use_xpack}" == "1" ]]; then + echo_yellow "\n4. SSH/SFTP $(gettext 'access')" + echo "ssh -p${ssh_port} admin@${host}" + echo "sftp -P${ssh_port} admin@${host}" + fi - echo_yellow "\n5. $(gettext 'More information')" + echo_yellow "\n $(gettext 'More information')" echo "$(gettext 'Official Website'): https://www.jumpserver.org/" echo "$(gettext 'Documentation'): https://docs.jumpserver.org/" echo -e "\n" diff --git a/scripts/utils.sh b/scripts/utils.sh index c1a160ac..4f4e125c 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -118,9 +118,9 @@ function get_mysql_images() { function get_mysql_images_file() { mysql_data_exists=$(check_mysql_data) if [[ "${mysql_data_exists}" == "1" ]]; then - mysql_images_file=compose/docker-compose-mysql.yml + mysql_images_file=compose/mysql.yml else - mysql_images_file=compose/docker-compose-mariadb.yml + mysql_images_file=compose/mariadb.yml fi echo "${mysql_images_file}" } @@ -137,24 +137,21 @@ function get_images() { done if [[ "$use_xpack" == "1" ]];then echo "registry.fit2cloud.com/jumpserver/core-ee:${VERSION}" - echo "registry.fit2cloud.com/jumpserver/koko:${VERSION}" - echo "registry.fit2cloud.com/jumpserver/lion:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/koko-ee:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/lion-ee:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/chen-ee:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/web-ee:${VERSION}" echo "registry.fit2cloud.com/jumpserver/magnus:${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}" echo "registry.fit2cloud.com/jumpserver/panda:${VERSION}" else echo "jumpserver/core-ce:${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}" + echo "jumpserver/koko-ce:${VERSION}" + echo "jumpserver/lion-ce:${VERSION}" + echo "jumpserver/chen-ce:${VERSION}" + echo "jumpserver/web-ce:${VERSION}" fi } @@ -250,11 +247,9 @@ function get_docker_compose_services() { celery_enabled=$(get_config CELERY_ENABLED) koko_enabled=$(get_config KOKO_ENABLED) lion_enabled=$(get_config LION_ENABLED) - magnus_enabled=$(get_config MAGNUS_ENABLED) chen_enabled=$(get_config CHEN_ENABLED) - kael_enabled=$(get_config KAEL_ENABLED) web_enabled=$(get_config WEB_ENABLED) - services="core celery koko lion magnus chen kael web" + services="core celery koko lion chen web" if [[ "${core_enabled}" == "0" ]]; then services="${services//core/}" fi @@ -267,15 +262,9 @@ function get_docker_compose_services() { if [[ "${lion_enabled}" == "0" ]]; then services="${services//lion/}" fi - if [[ "${magnus_enabled}" == "0" ]]; then - services="${services//magnus/}" - fi if [[ "${chen_enabled}" == "0" ]]; then services="${services//chen/}" fi - if [[ "${kael_enabled}" == "0" ]]; then - services="${services//kael/}" - fi if [[ "${web_enabled}" == "0" ]]; then services="${services//web/}" fi @@ -297,11 +286,15 @@ function get_docker_compose_services() { fi use_xpack=$(get_config_or_env USE_XPACK) if [[ "${use_xpack}" == "1" ]]; then - services+=" razor xrdp video panda" + services+=" magnus razor xrdp video panda" + magnus_enabled=$(get_config MAGNUS_ENABLED) razor_enabled=$(get_config RAZOR_ENABLED) xrdp_enabled=$(get_config XRDP_ENABLED) video_enabled=$(get_config VIDEO_ENABLED) panda_enabled=$(get_config PANDA_ENABLED) + if [[ "${magnus_enabled}" == "0" ]]; then + services="${services//magnus/}" + fi if [[ "${razor_enabled}" == "0" ]]; then services="${services//razor/}" fi @@ -326,71 +319,77 @@ function get_docker_compose_cmd_line() { mysql_images_file=$(get_mysql_images_file) cmd="docker-compose" if [[ "${use_ipv6}" != "1" ]]; then - cmd+=" -f compose/docker-compose-network.yml" + cmd+=" -f compose/network.yml" else - cmd+=" -f compose/docker-compose-network_v6.yml" + cmd+=" -f compose/network-v6.yml" fi services=$(get_docker_compose_services "$ignore_db") if [[ "${services}" =~ core ]]; then - cmd+=" -f compose/docker-compose-core.yml" + cmd+=" -f compose/core-ce.yml" if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/docker-compose-core-xpack.yml" + cmd+=" -f compose/core-ee.yml" fi fi if [[ "${services}" =~ celery ]]; then - cmd+=" -f compose/docker-compose-celery.yml" + cmd+=" -f compose/celery-ce.yml" if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/docker-compose-celery-xpack.yml" + cmd+=" -f compose/celery-ee.yml" fi fi if [[ "${services}" =~ koko ]]; then - cmd+=" -f compose/docker-compose-koko.yml" + cmd+=" -f compose/koko-ce.yml" + if [[ "${use_xpack}" == '1' ]]; then + cmd+=" -f compose/koko-ee.yml" + fi fi if [[ "${services}" =~ lion ]]; then - cmd+=" -f compose/docker-compose-lion.yml" - fi - if [[ "${services}" =~ magnus ]]; then - cmd+=" -f compose/docker-compose-magnus.yml" + cmd+=" -f compose/lion-ce.yml" if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/docker-compose-magnus-xpack.yml" + cmd+=" -f compose/lion-ee.yml" fi fi if [[ "${services}" =~ chen ]]; then - cmd+=" -f compose/docker-compose-chen.yml" - fi - if [[ "${services}" =~ kael ]]; then - cmd+=" -f compose/docker-compose-kael.yml" + cmd+=" -f compose/chen-ce.yml" + if [[ "${use_xpack}" == '1' ]]; then + cmd+=" -f compose/chen-ee.yml" + fi fi if [[ "${services}" =~ web ]]; then - cmd+=" -f compose/docker-compose-web.yml" + cmd+=" -f compose/web-ce.yml" + if [[ "${use_xpack}" == '1' ]]; then + cmd+=" -f compose/web-ee.yml" + fi fi if [[ "${services}" =~ mysql ]]; then cmd+=" -f ${mysql_images_file}" fi if [[ "${services}" =~ redis ]]; then - cmd+=" -f compose/docker-compose-redis.yml" + cmd+=" -f compose/redis.yml" fi if [[ "${services}" =~ es ]]; then - cmd+=" -f compose/docker-compose-es.yml" + cmd+=" -f compose/es.yml" fi if [[ "${services}" =~ minio ]]; then - cmd+=" -f compose/docker-compose-minio.yml" + cmd+=" -f compose/minio.yml" fi if [[ -n "${https_port}" ]]; then - cmd+=" -f compose/docker-compose-lb.yml" + cmd+=" -f compose/lb.yml" fi if [[ "${use_xpack}" == '1' ]]; then + if [[ "${services}" =~ magnus ]]; then + cmd+=" -f compose/magnus.yml" + fi if [[ "${services}" =~ razor ]]; then - cmd+=" -f compose/docker-compose-razor.yml" + cmd+=" -f compose/razor.yml" fi if [[ "${services}" =~ xrdp ]]; then - cmd+=" -f compose/docker-compose-xrdp.yml" + cmd+=" -f compose/xrdp.yml" fi if [[ "${services}" =~ video ]]; then - cmd+=" -f compose/docker-compose-video.yml" + cmd+=" -f compose/video.yml" fi if [[ "${services}" =~ panda ]]; then - cmd+=" -f compose/docker-compose-panda.yml" + cmd+=" -f compose/panda.yml" fi fi echo "${cmd}" @@ -404,11 +403,11 @@ function get_video_worker_cmd_line() { use_ipv6=$(get_config USE_IPV6) cmd="docker-compose" if [[ "${use_ipv6}" != "1" ]]; then - cmd+=" -f compose/docker-compose-network.yml" + cmd+=" -f compose/network.yml" else - cmd+=" -f compose/docker-compose-network_v6.yml" + cmd+=" -f compose/network-v6.yml" fi - cmd+=" -f compose/docker-compose-video-worker.yml" + cmd+=" -f compose/video-worker.yml" echo "${cmd}" } @@ -547,21 +546,21 @@ function get_db_migrate_compose_cmd() { use_ipv6=$(get_config USE_IPV6) use_xpack=$(get_config_or_env USE_XPACK) - cmd="docker-compose -f compose/docker-compose-init-db.yml" + cmd="docker-compose -f compose/init-db.yml" if [[ "${use_xpack}" == "1" ]]; then - cmd+=" -f compose/docker-compose-init-db-xpack.yml" + cmd+=" -f compose/core-ee.yml" fi if [[ "${mysql_host}" == "mysql" ]]; then mysql_images_file=$(get_mysql_images_file) cmd+=" -f ${mysql_images_file}" fi if [[ "${redis_host}" == "redis" ]]; then - cmd+=" -f compose/docker-compose-redis.yml" + cmd+=" -f compose/redis.yml" fi if [[ "${use_ipv6}" != "1" ]]; then - cmd+=" -f compose/docker-compose-network.yml" + cmd+=" -f compose/network.yml" else - cmd+=" -f compose/docker-compose-network_v6.yml" + cmd+=" -f compose/network-v6.yml" fi echo "$cmd" } From 65d27249041539a6531c933aa3e2e197ba735276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 10 Apr 2024 11:47:16 +0800 Subject: [PATCH 02/36] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=20lite=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=91=BD=E5=90=8D=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/celery-ee.yml | 3 -- compose/{celery-ce.yml => celery.yml} | 2 +- compose/chen-ee.yml | 3 -- compose/{chen-ce.yml => chen.yml} | 2 +- compose/core-ce.yml | 2 +- compose/core-ee.yml | 3 -- compose/init-db.yml | 2 +- compose/koko-ee.yml | 5 --- compose/{koko-ce.yml => koko.yml} | 2 +- compose/lion-ee.yml | 3 -- compose/{lion-ce.yml => lion.yml} | 2 +- compose/magnus.yml | 2 +- compose/web-ee.yml | 3 -- compose/{web-ce.yml => web.yml} | 2 +- scripts/utils.sh | 53 ++++++++------------------- 15 files changed, 24 insertions(+), 65 deletions(-) delete mode 100644 compose/celery-ee.yml rename compose/{celery-ce.yml => celery.yml} (88%) delete mode 100644 compose/chen-ee.yml rename compose/{chen-ce.yml => chen.yml} (87%) delete mode 100644 compose/core-ee.yml delete mode 100644 compose/koko-ee.yml rename compose/{koko-ce.yml => koko.yml} (87%) delete mode 100644 compose/lion-ee.yml rename compose/{lion-ce.yml => lion.yml} (87%) delete mode 100644 compose/web-ee.yml rename compose/{web-ce.yml => web.yml} (93%) diff --git a/compose/celery-ee.yml b/compose/celery-ee.yml deleted file mode 100644 index 324ebc2b..00000000 --- a/compose/celery-ee.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - celery: - image: ${REGISTRY:-docker.io}/jumpserver/core-ee:${VERSION} \ No newline at end of file diff --git a/compose/celery-ce.yml b/compose/celery.yml similarity index 88% rename from compose/celery-ce.yml rename to compose/celery.yml index a37e0a6b..221233a0 100644 --- a/compose/celery-ce.yml +++ b/compose/celery.yml @@ -1,6 +1,6 @@ services: celery: - image: ${REGISTRY:-docker.io}/jumpserver/core-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/core:${VERSION} container_name: jms_celery hostname: jms_celery ulimits: diff --git a/compose/chen-ee.yml b/compose/chen-ee.yml deleted file mode 100644 index e3b1015f..00000000 --- a/compose/chen-ee.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - chen: - image: ${REGISTRY:-docker.io}/jumpserver/chen-ee:${VERSION} \ No newline at end of file diff --git a/compose/chen-ce.yml b/compose/chen.yml similarity index 87% rename from compose/chen-ce.yml rename to compose/chen.yml index e0f47d85..ed138ae4 100644 --- a/compose/chen-ce.yml +++ b/compose/chen.yml @@ -1,6 +1,6 @@ services: chen: - image: ${REGISTRY:-docker.io}/jumpserver/chen-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/chen:${VERSION} container_name: jms_chen hostname: jms_chen ulimits: diff --git a/compose/core-ce.yml b/compose/core-ce.yml index 5ef22afc..c380abcb 100644 --- a/compose/core-ce.yml +++ b/compose/core-ce.yml @@ -1,6 +1,6 @@ services: core: - image: ${REGISTRY:-docker.io}/jumpserver/core-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/core:${VERSION} container_name: jms_core hostname: jms_core ulimits: diff --git a/compose/core-ee.yml b/compose/core-ee.yml deleted file mode 100644 index 934cc478..00000000 --- a/compose/core-ee.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - core: - image: ${REGISTRY:-docker.io}/jumpserver/core-ee:${VERSION} \ No newline at end of file diff --git a/compose/init-db.yml b/compose/init-db.yml index caec6c6a..20c00fae 100644 --- a/compose/init-db.yml +++ b/compose/init-db.yml @@ -1,6 +1,6 @@ services: core: - image: ${REGISTRY:-docker.io}/jumpserver/core-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/core:${VERSION} container_name: jms_core hostname: jms_core command: sleep diff --git a/compose/koko-ee.yml b/compose/koko-ee.yml deleted file mode 100644 index a46dfdd4..00000000 --- a/compose/koko-ee.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - koko: - image: ${REGISTRY:-docker.io}/jumpserver/koko-ee:${VERSION} - ports: - - ${SSH_PORT}:2222 \ No newline at end of file diff --git a/compose/koko-ce.yml b/compose/koko.yml similarity index 87% rename from compose/koko-ce.yml rename to compose/koko.yml index 3622d809..ef896d8b 100644 --- a/compose/koko-ce.yml +++ b/compose/koko.yml @@ -1,6 +1,6 @@ services: koko: - image: ${REGISTRY:-docker.io}/jumpserver/koko-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/koko:${VERSION} container_name: jms_koko hostname: jms_koko ulimits: diff --git a/compose/lion-ee.yml b/compose/lion-ee.yml deleted file mode 100644 index e0135fb0..00000000 --- a/compose/lion-ee.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - lion: - image: ${REGISTRY:-docker.io}/jumpserver/lion-ee:${VERSION} \ No newline at end of file diff --git a/compose/lion-ce.yml b/compose/lion.yml similarity index 87% rename from compose/lion-ce.yml rename to compose/lion.yml index 081c1ae8..5c20fbad 100644 --- a/compose/lion-ce.yml +++ b/compose/lion.yml @@ -1,6 +1,6 @@ services: lion: - image: ${REGISTRY:-docker.io}/jumpserver/lion-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/lion:${VERSION} container_name: jms_lion hostname: jms_lion ulimits: diff --git a/compose/magnus.yml b/compose/magnus.yml index 7911f670..b1e65fc0 100644 --- a/compose/magnus.yml +++ b/compose/magnus.yml @@ -1,6 +1,6 @@ services: magnus: - image: ${REGISTRY:-docker.io}/jumpserver/magnus:${VERSION} + image: ${REGISTRY:-registry.fit2cloud.com}/jumpserver/magnus:${VERSION} container_name: jms_magnus hostname: jms_magnus ulimits: diff --git a/compose/web-ee.yml b/compose/web-ee.yml deleted file mode 100644 index f7d07308..00000000 --- a/compose/web-ee.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - web: - image: ${REGISTRY:-docker.io}/jumpserver/web-ee:${VERSION} \ No newline at end of file diff --git a/compose/web-ce.yml b/compose/web.yml similarity index 93% rename from compose/web-ce.yml rename to compose/web.yml index 216651f2..f3fdc992 100644 --- a/compose/web-ce.yml +++ b/compose/web.yml @@ -1,6 +1,6 @@ services: web: - image: ${REGISTRY:-docker.io}/jumpserver/web-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/web:${VERSION} container_name: jms_web hostname: jms_web ulimits: diff --git a/scripts/utils.sh b/scripts/utils.sh index 4f4e125c..396215fe 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -136,22 +136,22 @@ function get_images() { echo "${image}" done if [[ "$use_xpack" == "1" ]];then - echo "registry.fit2cloud.com/jumpserver/core-ee:${VERSION}" - echo "registry.fit2cloud.com/jumpserver/koko-ee:${VERSION}" - echo "registry.fit2cloud.com/jumpserver/lion-ee:${VERSION}" - echo "registry.fit2cloud.com/jumpserver/chen-ee:${VERSION}" - echo "registry.fit2cloud.com/jumpserver/web-ee:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/core:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/koko:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/lion:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/chen:${VERSION}" + echo "registry.fit2cloud.com/jumpserver/web:${VERSION}" echo "registry.fit2cloud.com/jumpserver/magnus:${VERSION}" echo "registry.fit2cloud.com/jumpserver/razor:${VERSION}" echo "registry.fit2cloud.com/jumpserver/video-worker:${VERSION}" echo "registry.fit2cloud.com/jumpserver/xrdp:${VERSION}" echo "registry.fit2cloud.com/jumpserver/panda:${VERSION}" else - echo "jumpserver/core-ce:${VERSION}" - echo "jumpserver/koko-ce:${VERSION}" - echo "jumpserver/lion-ce:${VERSION}" - echo "jumpserver/chen-ce:${VERSION}" - echo "jumpserver/web-ce:${VERSION}" + echo "jumpserver/core:${VERSION}" + echo "jumpserver/koko:${VERSION}" + echo "jumpserver/lion:${VERSION}" + echo "jumpserver/chen:${VERSION}" + echo "jumpserver/web:${VERSION}" fi } @@ -325,40 +325,22 @@ function get_docker_compose_cmd_line() { fi services=$(get_docker_compose_services "$ignore_db") if [[ "${services}" =~ core ]]; then - cmd+=" -f compose/core-ce.yml" - if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/core-ee.yml" - fi + cmd+=" -f compose/core.yml" fi if [[ "${services}" =~ celery ]]; then - cmd+=" -f compose/celery-ce.yml" - if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/celery-ee.yml" - fi + cmd+=" -f compose/celery.yml" fi if [[ "${services}" =~ koko ]]; then - cmd+=" -f compose/koko-ce.yml" - if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/koko-ee.yml" - fi + cmd+=" -f compose/koko.yml" fi if [[ "${services}" =~ lion ]]; then - cmd+=" -f compose/lion-ce.yml" - if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/lion-ee.yml" - fi + cmd+=" -f compose/lion.yml" fi if [[ "${services}" =~ chen ]]; then - cmd+=" -f compose/chen-ce.yml" - if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/chen-ee.yml" - fi + cmd+=" -f compose/chen.yml" fi if [[ "${services}" =~ web ]]; then - cmd+=" -f compose/web-ce.yml" - if [[ "${use_xpack}" == '1' ]]; then - cmd+=" -f compose/web-ee.yml" - fi + cmd+=" -f compose/web.yml" fi if [[ "${services}" =~ mysql ]]; then cmd+=" -f ${mysql_images_file}" @@ -547,9 +529,6 @@ function get_db_migrate_compose_cmd() { use_xpack=$(get_config_or_env USE_XPACK) cmd="docker-compose -f compose/init-db.yml" - if [[ "${use_xpack}" == "1" ]]; then - cmd+=" -f compose/core-ee.yml" - fi if [[ "${mysql_host}" == "mysql" ]]; then mysql_images_file=$(get_mysql_images_file) cmd+=" -f ${mysql_images_file}" From 53377b6556cb115dd68f805ca1b5801ddbbbd8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 10 Apr 2024 12:48:34 +0800 Subject: [PATCH 03/36] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20core=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/{core-ce.yml => core.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename compose/{core-ce.yml => core.yml} (100%) diff --git a/compose/core-ce.yml b/compose/core.yml similarity index 100% rename from compose/core-ce.yml rename to compose/core.yml From 38cb077dee5003da2b82802dc048205dfcfd6ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Sat, 13 Apr 2024 07:13:07 +0800 Subject: [PATCH 04/36] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20docker=2026.?= =?UTF-8?q?0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index ac9bc8c7..d365f312 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,20 +26,20 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.0.0 +export DOCKER_VERSION=26.0.1 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" export DOCKER_BIN_URL="${DOCKER_MIRROR}/$(uname -m)/docker-${DOCKER_VERSION}.tgz" if [[ "$(uname -m)" == "x86_64" ]]; then - DOCKER_MD5=908fb24b8e3712199b30d4b381af9bba + DOCKER_MD5=b07c6cd2dbf8b24fc8568b7e12628046 fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_MD5=b4868578258823e4b6ba1b83048dc5c1 + DOCKER_MD5=14403979e557929b1810c2a4e49ce945 fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_MD5=fb04660cdb594e2628361a0591078958 + DOCKER_MD5=103e6eafbb29a25050d2b7cc581c1395 fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_MD5=f417e4e6480c630ad3e527706610aa82 + DOCKER_MD5=393c0eed241c026c3dc0dca41b4ab55e fi export DOCKER_MD5 From 4b7b6a5124e5af2cbc9b4b60577d7e66c556296f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 23 Apr 2024 13:10:59 +0800 Subject: [PATCH 05/36] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20docker=2026.?= =?UTF-8?q?0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index d365f312..f08d1e12 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,20 +26,20 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.0.1 +export DOCKER_VERSION=26.0.2 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" export DOCKER_BIN_URL="${DOCKER_MIRROR}/$(uname -m)/docker-${DOCKER_VERSION}.tgz" if [[ "$(uname -m)" == "x86_64" ]]; then - DOCKER_MD5=b07c6cd2dbf8b24fc8568b7e12628046 + DOCKER_MD5=87fae4f7785fb2c2cc15a36596369dae fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_MD5=14403979e557929b1810c2a4e49ce945 + DOCKER_MD5=d961d3bb86b21ba7cdeb8fd22d880961 fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_MD5=103e6eafbb29a25050d2b7cc581c1395 + DOCKER_MD5=3146b33d0ee4a3d2f2482bcbdcaf9620 fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_MD5=393c0eed241c026c3dc0dca41b4ab55e + DOCKER_MD5=333afd5610ac810be45af9deb735bb34 fi export DOCKER_MD5 From 4a51f48f6e7508152131ee05375a98aeb6476ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 24 Apr 2024 04:30:30 +0800 Subject: [PATCH 06/36] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20docker=2026.?= =?UTF-8?q?1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index f08d1e12..a91fbe83 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,36 +26,36 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.0.2 +export DOCKER_VERSION=26.1.0 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" export DOCKER_BIN_URL="${DOCKER_MIRROR}/$(uname -m)/docker-${DOCKER_VERSION}.tgz" if [[ "$(uname -m)" == "x86_64" ]]; then - DOCKER_MD5=87fae4f7785fb2c2cc15a36596369dae + DOCKER_MD5=344e9cc48a523725fc1b3b2ce0d9fb30 fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_MD5=d961d3bb86b21ba7cdeb8fd22d880961 + DOCKER_MD5=81ff95d539a16a7382819d026d64d918 fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_MD5=3146b33d0ee4a3d2f2482bcbdcaf9620 + DOCKER_MD5=0071150b3931cf6bc2d9e5d23dc112c7 fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_MD5=333afd5610ac810be45af9deb735bb34 + DOCKER_MD5=09bd1754c83e683e7caf826c5fb788c3 fi export DOCKER_MD5 -export DOCKER_COMPOSE_VERSION=v2.26.1 +export DOCKER_COMPOSE_VERSION=v2.27.0 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=d0e38e2a1ec580a77feea34f466df81c + DOCKER_COMPOSE_MD5=891a283d0e11bbff04b8347d7611500a fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_COMPOSE_MD5=13e42b2e23dc23c9ac3a37932aa0e28a + DOCKER_COMPOSE_MD5=798dde95d63ebff0e92d986848848967 fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_COMPOSE_MD5=e38fad868cbcc2b3e2ef33d14ab28fe9 + DOCKER_COMPOSE_MD5=83f554dafd26e6892d1a4c73ea95bc12 fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_COMPOSE_MD5=665143c87c8486d51df44da22313ad73 + DOCKER_COMPOSE_MD5=f7cbe603e2a0b8921f392549a6480a1a fi export DOCKER_COMPOSE_MD5 From ae56ac9803f91c952611e28780ac11cdbfd96923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Sun, 28 Apr 2024 17:25:28 +0800 Subject: [PATCH 07/36] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=20PostgreSQL?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cn-quick_start.sh | 12 +- compose/es.yml | 1 + compose/mariadb.yml | 4 +- compose/minio.yml | 1 + compose/mysql.yml | 4 +- compose/postgres.yml | 20 + compose/redis.yml | 3 +- compose/web.yml | 1 + config-example.txt | 14 +- jmsctl.sh | 6 +- locale/en/LC_MESSAGES/jumpserver-installer.po | 556 +++++++------ .../zh_CN/LC_MESSAGES/jumpserver-installer.mo | Bin 10583 -> 11291 bytes .../zh_CN/LC_MESSAGES/jumpserver-installer.po | 759 +++++++++--------- quick_start.sh | 12 +- scripts/0_prepare.sh | 4 +- scripts/1_config_jumpserver.sh | 187 +++-- scripts/2_install_docker.sh | 72 +- scripts/3_load_images.sh | 4 +- scripts/4_install_jumpserver.sh | 7 +- scripts/5_db_backup.sh | 43 +- scripts/6_db_restore.sh | 40 +- scripts/7_upgrade.sh | 175 ++-- scripts/8_uninstall.sh | 108 ++- scripts/const.sh | 2 +- scripts/utils.sh | 279 ++++--- 25 files changed, 1255 insertions(+), 1059 deletions(-) create mode 100644 compose/postgres.yml diff --git a/cn-quick_start.sh b/cn-quick_start.sh index 3c1c6459..c3542458 100644 --- a/cn-quick_start.sh +++ b/cn-quick_start.sh @@ -5,17 +5,17 @@ VERSION=dev DOWNLOAD_URL=https://resource.fit2cloud.com function install_soft() { - if command -v dnf > /dev/null; then + if command -v dnf &>/dev/null; then dnf -q -y install "$1" - elif command -v yum > /dev/null; then + elif command -v yum &>/dev/null; then yum -q -y install "$1" - elif command -v apt > /dev/null; then + elif command -v apt &>/dev/null; then apt-get -qqy install "$1" - elif command -v zypper > /dev/null; then + elif command -v zypper &>/dev/null; then zypper -q -n install "$1" - elif command -v apk > /dev/null; then + elif command -v apk &>/dev/null; then apk add -q "$1" - command -v gettext >/dev/null || { + command -v gettext &>/dev/null || { apk add -q gettext-dev python3 } else diff --git a/compose/es.yml b/compose/es.yml index d17c7f27..13d8c19c 100644 --- a/compose/es.yml +++ b/compose/es.yml @@ -11,6 +11,7 @@ services: - ${VOLUME_DIR}/elasticsearch/data:/usr/share/elasticsearch/data - ${VOLUME_DIR}/elasticsearch/logs:/usr/share/elasticsearch/logs environment: + TZ: ${TZ:-Asia/Shanghai} cluster.name: docker-cluster discovery.type: single-node network.host: 0.0.0.0 diff --git a/compose/mariadb.yml b/compose/mariadb.yml index 889ad609..7002208b 100644 --- a/compose/mariadb.yml +++ b/compose/mariadb.yml @@ -1,11 +1,11 @@ services: mysql: - image: jumpserver/mariadb:10.6 + image: mariadb:10.6 container_name: jms_mysql - hostname: jms_mysql restart: always command: --character-set-server=utf8 --collation-server=utf8_general_ci environment: + TZ: ${TZ:-Asia/Shanghai} DB_PORT: $DB_PORT MARIADB_ROOT_PASSWORD: $DB_PASSWORD MARIADB_DATABASE: $DB_NAME diff --git a/compose/minio.yml b/compose/minio.yml index 1dca767e..b76c384f 100644 --- a/compose/minio.yml +++ b/compose/minio.yml @@ -12,6 +12,7 @@ services: - ${VOLUME_DIR}/minio/data:/data - ${CONFIG_DIR}/minio/config:/root/.minio environment: + TZ: ${TZ:-Asia/Shanghai} MINIO_ROOT_USER: minio MINIO_ROOT_PASSWORD: $BOOTSTRAP_TOKEN healthcheck: diff --git a/compose/mysql.yml b/compose/mysql.yml index 4786936d..5f5b0cd9 100644 --- a/compose/mysql.yml +++ b/compose/mysql.yml @@ -1,11 +1,11 @@ services: mysql: - image: jumpserver/mysql:5.7 + image: mysql:5.7-debian container_name: jms_mysql - hostname: jms_mysql restart: always command: --character-set-server=utf8 environment: + TZ: ${TZ:-Asia/Shanghai} DB_PORT: $DB_PORT MYSQL_ROOT_PASSWORD: $DB_PASSWORD MYSQL_DATABASE: $DB_NAME diff --git a/compose/postgres.yml b/compose/postgres.yml new file mode 100644 index 00000000..9b394f68 --- /dev/null +++ b/compose/postgres.yml @@ -0,0 +1,20 @@ +services: + postgresql: + image: postgres:16.2-bullseye + container_name: jms_postgresql + restart: always + environment: + TZ: ${TZ:-Asia/Shanghai} + POSTGRES_DB: $DB_NAME + POSTGRES_USER: $DB_USER + POSTGRES_PASSWORD: $DB_PASSWORD + volumes: + - ${VOLUME_DIR}/postgresql/data:/var/lib/postgresql/data + healthcheck: + test: "pg_isready" + interval: 10s + timeout: 5s + retries: 3 + start_period: 30s + networks: + - net \ No newline at end of file diff --git a/compose/redis.yml b/compose/redis.yml index 38cd7a55..b23290ca 100644 --- a/compose/redis.yml +++ b/compose/redis.yml @@ -1,11 +1,12 @@ services: redis: - image: jumpserver/redis:6.2 + image: redis:7.0-bullseye container_name: jms_redis hostname: jms_redis restart: always command: ["redis-server", "/etc/redis.conf", "--requirepass", "$REDIS_PASSWORD"] environment: + TZ: ${TZ:-Asia/Shanghai} REDIS_PORT: $REDIS_PORT REDIS_PASSWORD: $REDIS_PASSWORD volumes: diff --git a/compose/web.yml b/compose/web.yml index f3fdc992..2c282043 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -7,6 +7,7 @@ services: core: 0 restart: always environment: + TZ: ${TZ:-Asia/Shanghai} HTTP_PORT: ${HTTP_PORT:-80} USE_LB: ${USE_LB:-1} USE_IPV6: ${USE_IPV6:-0} diff --git a/config-example.txt b/config-example.txt index 8d762d9a..86d8827d 100644 --- a/config-example.txt +++ b/config-example.txt @@ -49,13 +49,14 @@ DOCKER_SUBNET=192.168.250.0/24 USE_IPV6=0 DOCKER_SUBNET_IPV6=fc00:1010:1111:200::/64 -################################# MySQL 配置 ################################## -# 外置 MySQL 需要输入正确的 MySQL 信息, 内置 MySQL 系统会自动处理 +################################# DB 配置 ################################## +# 外置数据库需要输入正确的数据库信息, 内置数据库系统会自动处理 # (*) 密码部分不得包含单引号和双引号 # -DB_HOST=mysql -DB_PORT=3306 -DB_USER=root +DB_ENGINE=postgresql +DB_HOST=postgresql +DB_PORT=5432 +DB_USER=postgres DB_PASSWORD= DB_NAME=jumpserver @@ -157,4 +158,5 @@ USE_LB=1 # 当前运行的 JumpServer 版本号, 安装和升级完成后自动生成 # -CURRENT_VERSION= +TZ=Asia/Shanghai +CURRENT_VERSION= \ No newline at end of file diff --git a/jmsctl.sh b/jmsctl.sh index b101d225..4645f055 100755 --- a/jmsctl.sh +++ b/jmsctl.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" cd "${PROJECT_DIR}" || exit 1 @@ -61,7 +61,7 @@ function usage() { echo " load_image $(gettext 'Loading docker image')" echo " backup_db $(gettext 'Backup database')" echo " restore_db [file] $(gettext 'Data recovery through database backup file')" - echo " raw $(gettext 'Execute the original docker-compose command')" + echo " raw $(gettext 'Execute the original docker compose command')" echo " tail [service] $(gettext 'View log')" echo } @@ -127,7 +127,7 @@ function check_update() { exit 1 fi echo -e "$(gettext 'The current version is'): ${current_version}" - Install_DIR="$(cd "$(dirname "${PROJECT_DIR}")" >/dev/null 2>&1 && pwd)" + Install_DIR="$(cd "$(dirname "${PROJECT_DIR}")" &>/dev/null && pwd)" if [[ ! -d "${Install_DIR}/jumpserver-installer-${latest_version}" ]]; then if [[ ! -f "${Install_DIR}/jumpserver-installer-${latest_version}.tar.gz" ]]; then timeout 60s wget -qO "${Install_DIR}/jumpserver-installer-${latest_version}.tar.gz" "https://github.com/jumpserver/installer/releases/download/${latest_version}/jumpserver-installer-${latest_version}.tar.gz" || { diff --git a/locale/en/LC_MESSAGES/jumpserver-installer.po b/locale/en/LC_MESSAGES/jumpserver-installer.po index dd0c0be2..d23c853a 100644 --- a/locale/en/LC_MESSAGES/jumpserver-installer.po +++ b/locale/en/LC_MESSAGES/jumpserver-installer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 07:21+0000\n" +"POT-Creation-Date: 2024-04-29 12:19+0800\n" "PO-Revision-Date: 2021-01-21 19:15+0800\n" "Last-Translator: Bai \n" "Language-Team: Language locale/en/LC\n" @@ -16,509 +16,543 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: jmsctl.sh:15 -msgid "Configuration file not found" +#: scripts/0_prepare.sh:14 +msgid "Starting to download Docker engine" msgstr "" -#: jmsctl.sh:16 -msgid "If you are upgrading from v1.5.x, please copy the config.txt To" +#: scripts/0_prepare.sh:16 +msgid "Download docker fails, check the network is normal" msgstr "" -#: jmsctl.sh:21 -msgid "There is a problem with the soft connection, Please update it again" +#: scripts/0_prepare.sh:21 +msgid "Using Docker cache" msgstr "" -#: jmsctl.sh:40 -msgid "JumpServer Deployment Management Script" +#: scripts/0_prepare.sh:36 +msgid "Starting to download Docker Compose binary" msgstr "" -#: jmsctl.sh:47 -msgid "Install JumpServer" +#: scripts/0_prepare.sh:38 +msgid "Download docker-compose fails, check the network is normal" msgstr "" -#: jmsctl.sh:48 -msgid "Upgrade JumpServer" +#: scripts/0_prepare.sh:43 +msgid "Using Docker Compose cache" msgstr "" -#: jmsctl.sh:49 -msgid "Check for updates JumpServer" +#: scripts/0_prepare.sh:55 +msgid "Docker is not running, please install and start" msgstr "" -#: jmsctl.sh:50 -msgid "Reconfiguration JumpServer" +#: scripts/0_prepare.sh:81 +msgid "The image has been saved, skipping" msgstr "" -#: jmsctl.sh:53 -msgid "Start JumpServer" +#: scripts/0_prepare.sh:85 +msgid "Save image" msgstr "" -#: jmsctl.sh:54 -msgid "Stop JumpServer" +#: scripts/0_prepare.sh:95 +msgid "Preparing Docker offline package" msgstr "" -#: jmsctl.sh:55 -msgid "Close JumpServer" +#: scripts/0_prepare.sh:99 +msgid "Preparing image offline package" msgstr "" -#: jmsctl.sh:56 -msgid "Restart JumpServer" +#: scripts/1_config_jumpserver.sh:8 +msgid "Configure Private Key" msgstr "" -#: jmsctl.sh:57 -msgid "Check JumpServer" +#: scripts/1_config_jumpserver.sh:28 +msgid "Configure Persistent Directory" msgstr "" -#: jmsctl.sh:58 -msgid "Offline JumpServer" +#: scripts/1_config_jumpserver.sh:31 +msgid "Do you need custom persistent store, will use the default directory" msgstr "" -#: jmsctl.sh:59 scripts/8_uninstall.sh:63 -msgid "Uninstall JumpServer" +#: scripts/1_config_jumpserver.sh:34 +msgid "" +"To modify the persistent directory such as logs video, you can select your " +"largest disk and create a directory in it, such as" msgstr "" -#: jmsctl.sh:62 -msgid "Loading docker image" +#: scripts/1_config_jumpserver.sh:35 +msgid "" +"Note: you can not change it after installation, otherwise the database may " +"be lost" msgstr "" -#: jmsctl.sh:63 scripts/7_upgrade.sh:298 -msgid "Backup database" +#: scripts/1_config_jumpserver.sh:39 +msgid "Persistent storage directory" msgstr "" -#: jmsctl.sh:64 -msgid "Data recovery through database backup file" +#: scripts/1_config_jumpserver.sh:72 +msgid "Please enter DB server IP" msgstr "" -#: jmsctl.sh:65 -msgid "Execute the original docker-compose command" +#: scripts/1_config_jumpserver.sh:74 +msgid "Can not use localhost as DB server IP" msgstr "" -#: jmsctl.sh:66 -msgid "View log" +#: scripts/1_config_jumpserver.sh:77 +msgid "Please enter DB server port" msgstr "" -#: jmsctl.sh:127 -msgid "The current version is up to date" +#: scripts/1_config_jumpserver.sh:79 +msgid "Please enter DB database name" msgstr "" -#: jmsctl.sh:132 -msgid "The latest version is" +#: scripts/1_config_jumpserver.sh:81 +msgid "Please enter DB username" msgstr "" -#: jmsctl.sh:136 -msgid "The current version is" +#: scripts/1_config_jumpserver.sh:83 +msgid "Please enter DB password" msgstr "" -#: jmsctl.sh:181 jmsctl.sh:187 -msgid "Unsupported Operating System Error" +#: scripts/1_config_jumpserver.sh:106 +msgid "Configure DB" msgstr "" -#: jmsctl.sh:182 -msgid "macOS installer please see" +#: scripts/1_config_jumpserver.sh:116 +msgid "Do you want to use external MySQL" msgstr "" -#: jmsctl.sh:188 -msgid "Windows installer please see" +#: scripts/1_config_jumpserver.sh:128 +msgid "Do you want to use external PostgreSQL" msgstr "" -#: scripts/4_install_jumpserver.sh:10 -msgid "" -"The current Linux system does not support systemd management. Please deploy " -"docker by yourself before running this script again" +#: scripts/1_config_jumpserver.sh:136 scripts/6_db_restore.sh:46 +#: scripts/5_db_backup.sh:45 +msgid "Invalid DB Engine selection" msgstr "" -#: scripts/4_install_jumpserver.sh:14 -msgid "" -"The current Linux system does not support systemd management. Please deploy " -"docker-compose by yourself before running this script again" +#: scripts/1_config_jumpserver.sh:144 +msgid "Please enter Redis server IP" msgstr "" -#: scripts/4_install_jumpserver.sh:21 -msgid "The Installation is Complete" +#: scripts/1_config_jumpserver.sh:146 +msgid "Can not use localhost as Redis server IP" msgstr "" -#: scripts/4_install_jumpserver.sh:37 -msgid "You can use the following command to start, and then visit" +#: scripts/1_config_jumpserver.sh:149 +msgid "Please enter Redis server port" msgstr "" -#: scripts/4_install_jumpserver.sh:41 -msgid "Other management commands" +#: scripts/1_config_jumpserver.sh:151 scripts/1_config_jumpserver.sh:164 +msgid "Please enter Redis password" msgstr "" -#: scripts/4_install_jumpserver.sh:46 -msgid "For more commands, you can enter ./jmsctl.sh --help to understand" +#: scripts/1_config_jumpserver.sh:160 +msgid "Please enter Redis Sentinel hosts" msgstr "" -#: scripts/4_install_jumpserver.sh:48 -msgid "Web access" +#: scripts/1_config_jumpserver.sh:162 +msgid "Please enter Redis Sentinel password" msgstr "" -#: scripts/4_install_jumpserver.sh:55 -msgid "Default username" +#: scripts/1_config_jumpserver.sh:186 +msgid "Configure Redis" msgstr "" -#: scripts/4_install_jumpserver.sh:55 -msgid "Default password" +#: scripts/1_config_jumpserver.sh:188 +msgid "Please enter Redis Engine" msgstr "" -#: scripts/4_install_jumpserver.sh:57 -msgid "access" +#: scripts/1_config_jumpserver.sh:197 +msgid "Do you want to use external Redis" msgstr "" -#: scripts/4_install_jumpserver.sh:61 -msgid "More information" +#: scripts/1_config_jumpserver.sh:208 +msgid "Invalid Redis Engine selection" msgstr "" -#: scripts/4_install_jumpserver.sh:62 -msgid "Official Website" +#: scripts/1_config_jumpserver.sh:214 +msgid "Configure External Access" msgstr "" -#: scripts/4_install_jumpserver.sh:63 -msgid "Documentation" +#: scripts/1_config_jumpserver.sh:220 +msgid "Do you need to customize the JumpServer external port" msgstr "" -#: scripts/4_install_jumpserver.sh:73 -msgid "Install and Configure Docker" +#: scripts/1_config_jumpserver.sh:222 +msgid "JumpServer web port" msgstr "" -#: scripts/4_install_jumpserver.sh:77 scripts/7_upgrade.sh:295 -msgid "Loading Docker Image" +#: scripts/1_config_jumpserver.sh:226 +msgid "JumpServer ssh port" msgstr "" -#: scripts/4_install_jumpserver.sh:81 -msgid "Install and Configure JumpServer" +#: scripts/1_config_jumpserver.sh:228 +msgid "JumpServer rdp port" msgstr "" -#: scripts/7_upgrade.sh:92 scripts/1_config_jumpserver.sh:158 -msgid "Please enter the access IP or domain name of JumpServer" +#: scripts/1_config_jumpserver.sh:235 +msgid "Init JumpServer Database" msgstr "" -#: scripts/7_upgrade.sh:186 -msgid "Back up to" +#: scripts/1_config_jumpserver.sh:237 scripts/7_upgrade.sh:256 +#: scripts/utils.sh:565 +msgid "Failed to change the table structure" msgstr "" -#: scripts/7_upgrade.sh:193 -msgid "Failed to backup the database. Continue to upgrade" +#: scripts/2_install_docker.sh:25 +msgid "Docker program does not exist" msgstr "" -#: scripts/7_upgrade.sh:199 -msgid "Skip database backup" +#: scripts/2_install_docker.sh:80 scripts/2_install_docker.sh:173 +msgid "Permission denied. pass..." +msgstr "" + +#: scripts/2_install_docker.sh:155 +msgid "Do you want to support IPv6" +msgstr "" + +#: scripts/2_install_docker.sh:205 +msgid "Install Docker" +msgstr "" + +#: scripts/2_install_docker.sh:208 +msgid "Configure Docker" +msgstr "" + +#: scripts/2_install_docker.sh:210 +msgid "Start Docker" +msgstr "" + +#: scripts/3_load_images.sh:19 +msgid "Docker image not found" msgstr "" -#: scripts/7_upgrade.sh:206 +#: scripts/3_load_images.sh:36 +msgid "Docker image loaded, skipping" +msgstr "" + +#: scripts/6_db_restore.sh:15 scripts/8_uninstall.sh:62 +msgid "Make sure you have a backup of data, this operation is not reversible" +msgstr "" + +#: scripts/6_db_restore.sh:18 +msgid "file does not exist" +msgstr "" + +#: scripts/6_db_restore.sh:24 +msgid "Start restoring database" +msgstr "" + +#: scripts/6_db_restore.sh:52 msgid "" -"Detected that the JumpServer container is running. Do you want to close the " -"container and continue to upgrade" +"Database recovery failed. Please check whether the database file is complete " +"or try to recover manually" msgstr "" -#: scripts/7_upgrade.sh:219 scripts/1_config_jumpserver.sh:183 -#: scripts/utils.sh:522 -msgid "Failed to change the table structure" +#: scripts/6_db_restore.sh:55 +msgid "Database recovered successfully" msgstr "" -#: scripts/7_upgrade.sh:221 -msgid "Failed to change the table structure. Continue to upgrade" +#: scripts/6_db_restore.sh:66 +msgid "Format error" msgstr "" -#: scripts/7_upgrade.sh:232 -msgid "Do you need to clean up the old version image" +#: scripts/6_db_restore.sh:70 +msgid "The backup file does not exist" msgstr "" -#: scripts/7_upgrade.sh:245 -msgid "Do you need upgrade Docker binaries" +#: scripts/7_upgrade.sh:223 +msgid "Back up to" msgstr "" -#: scripts/7_upgrade.sh:265 -msgid "Do you need upgrade Docker Compose" +#: scripts/7_upgrade.sh:230 +msgid "Failed to backup the database. Continue to upgrade" msgstr "" -#: scripts/7_upgrade.sh:283 -msgid "Are you sure you want to update the current version to" +#: scripts/7_upgrade.sh:236 +msgid "Skip database backup" msgstr "" -#: scripts/7_upgrade.sh:301 -msgid "Backup Configuration File" +#: scripts/7_upgrade.sh:243 +msgid "" +"Detected that the JumpServer container is running. Do you want to close the " +"container and continue to upgrade" msgstr "" -#: scripts/7_upgrade.sh:304 -msgid "Apply database changes" +#: scripts/7_upgrade.sh:258 +msgid "Failed to change the table structure. Continue to upgrade" msgstr "" -#: scripts/7_upgrade.sh:305 -msgid "Changing database schema may take a while, please wait patiently" +#: scripts/7_upgrade.sh:271 +msgid "Do you need to clean up the old version image" +msgstr "" + +#: scripts/7_upgrade.sh:284 +msgid "Do you need upgrade Docker binaries" msgstr "" #: scripts/7_upgrade.sh:308 -msgid "Cleanup Image" +msgid "Do you need upgrade Docker Compose" msgstr "" -#: scripts/7_upgrade.sh:311 -msgid "Upgrade Docker" +#: scripts/7_upgrade.sh:326 +msgid "Are you sure you want to update the current version to" msgstr "" -#: scripts/7_upgrade.sh:316 -msgid "Upgrade successfully. You can now restart the program" +#: scripts/7_upgrade.sh:338 scripts/4_install_jumpserver.sh:75 +msgid "Loading Docker Image" msgstr "" -#: scripts/2_install_docker.sh:25 -msgid "Docker program does not exist" +#: scripts/7_upgrade.sh:341 jmsctl.sh:62 +msgid "Backup database" msgstr "" -#: scripts/2_install_docker.sh:129 -msgid "Do you want to support IPv6" +#: scripts/7_upgrade.sh:344 +msgid "Backup Configuration File" msgstr "" -#: scripts/2_install_docker.sh:175 -msgid "Install Docker" +#: scripts/7_upgrade.sh:347 +msgid "Apply database changes" msgstr "" -#: scripts/2_install_docker.sh:178 -msgid "Configure Docker" +#: scripts/7_upgrade.sh:348 +msgid "Changing database schema may take a while, please wait patiently" msgstr "" -#: scripts/2_install_docker.sh:180 -msgid "Start Docker" +#: scripts/7_upgrade.sh:351 +msgid "Cleanup Image" msgstr "" -#: scripts/1_config_jumpserver.sh:8 -msgid "Configure Private Key" +#: scripts/7_upgrade.sh:354 +msgid "Upgrade Docker" msgstr "" -#: scripts/1_config_jumpserver.sh:28 -msgid "Configure Persistent Directory" +#: scripts/7_upgrade.sh:360 +msgid "Upgrade successfully. You can now restart the program" msgstr "" -#: scripts/1_config_jumpserver.sh:31 -msgid "Do you need custom persistent store, will use the default directory" +#: scripts/8_uninstall.sh:18 scripts/8_uninstall.sh:32 +#: scripts/8_uninstall.sh:37 scripts/8_uninstall.sh:45 +#: scripts/8_uninstall.sh:54 scripts/8_uninstall.sh:69 +#: scripts/8_uninstall.sh:73 +msgid "Cleaning up" msgstr "" -#: scripts/1_config_jumpserver.sh:34 -msgid "" -"To modify the persistent directory such as logs video, you can select your " -"largest disk and create a directory in it, such as" +#: scripts/8_uninstall.sh:27 +msgid "Do you need to clean up the Docker binaries" msgstr "" -#: scripts/1_config_jumpserver.sh:35 -msgid "" -"Note: you can not change it after installation, otherwise the database may " -"be lost" +#: scripts/8_uninstall.sh:43 scripts/8_uninstall.sh:52 +msgid "Do you need to clean up the Docker Compose binaries" msgstr "" -#: scripts/1_config_jumpserver.sh:39 -msgid "Persistent storage directory" +#: scripts/8_uninstall.sh:66 +msgid "Are you clean up JumpServer files" msgstr "" -#: scripts/1_config_jumpserver.sh:55 -msgid "Please enter MySQL server IP" +#: scripts/8_uninstall.sh:80 +msgid "Do you need to clean up the Docker image" msgstr "" -#: scripts/1_config_jumpserver.sh:60 -msgid "Please enter MySQL server port" +#: scripts/8_uninstall.sh:87 +msgid "Cleanup complete" msgstr "" -#: scripts/1_config_jumpserver.sh:62 -msgid "Please enter MySQL database name" +#: scripts/8_uninstall.sh:91 jmsctl.sh:58 +msgid "Uninstall JumpServer" msgstr "" -#: scripts/1_config_jumpserver.sh:64 -msgid "Please enter MySQL username" +#: scripts/utils.sh:198 +msgid "no default" msgstr "" -#: scripts/1_config_jumpserver.sh:66 -msgid "Please enter MySQL password" +#: scripts/utils.sh:200 +msgid "default" msgstr "" -#: scripts/1_config_jumpserver.sh:91 -msgid "Configure MySQL" +#: scripts/utils.sh:248 +msgid "complete" msgstr "" -#: scripts/1_config_jumpserver.sh:97 -msgid "Do you want to use external MySQL" +#: scripts/utils.sh:260 +msgid "fail" msgstr "" -#: scripts/1_config_jumpserver.sh:107 -msgid "Please enter Redis server IP" +#: scripts/utils.sh:385 +msgid "command not found, Please install it first" msgstr "" -#: scripts/1_config_jumpserver.sh:112 -msgid "Please enter Redis server port" +#: scripts/utils.sh:417 +msgid "Check Configuration File" msgstr "" -#: scripts/1_config_jumpserver.sh:114 -msgid "Please enter Redis password" +#: scripts/utils.sh:418 +msgid "Path to Configuration file" msgstr "" -#: scripts/1_config_jumpserver.sh:132 -msgid "Configure Redis" +#: scripts/utils.sh:634 +msgid "Failed to pull image" msgstr "" -#: scripts/1_config_jumpserver.sh:142 -msgid "Do you want to use external Redis" +#: scripts/4_install_jumpserver.sh:10 +msgid "" +"The current Linux system does not support systemd management. Please deploy " +"docker by yourself before running this script again" msgstr "" -#: scripts/1_config_jumpserver.sh:151 -msgid "Configure External Access" +#: scripts/4_install_jumpserver.sh:14 +msgid "" +"The current Linux system does not support systemd management. Please deploy " +"docker-compose by yourself before running this script again" msgstr "" -#: scripts/1_config_jumpserver.sh:167 -msgid "Do you need to customize the JumpServer external port" +#: scripts/4_install_jumpserver.sh:21 +msgid "The Installation is Complete" msgstr "" -#: scripts/1_config_jumpserver.sh:169 -msgid "JumpServer web port" +#: scripts/4_install_jumpserver.sh:32 +msgid "You can use the following command to start, and then visit" msgstr "" -#: scripts/1_config_jumpserver.sh:171 -msgid "JumpServer ssh port" +#: scripts/4_install_jumpserver.sh:36 +msgid "Other management commands" msgstr "" -#: scripts/1_config_jumpserver.sh:174 -msgid "JumpServer rdp port" +#: scripts/4_install_jumpserver.sh:41 +msgid "For more commands, you can enter ./jmsctl.sh --help to understand" msgstr "" -#: scripts/1_config_jumpserver.sh:181 -msgid "Init JumpServer Database" +#: scripts/4_install_jumpserver.sh:43 +msgid "Web access" msgstr "" -#: scripts/8_uninstall.sh:8 scripts/6_db_restore.sh:16 -msgid "Make sure you have a backup of data, this operation is not reversible" +#: scripts/4_install_jumpserver.sh:50 +msgid "Default username" msgstr "" -#: scripts/8_uninstall.sh:12 -msgid "Are you clean up JumpServer files" +#: scripts/4_install_jumpserver.sh:50 +msgid "Default password" msgstr "" -#: scripts/8_uninstall.sh:19 scripts/8_uninstall.sh:21 -#: scripts/8_uninstall.sh:23 scripts/8_uninstall.sh:45 -#: scripts/8_uninstall.sh:50 scripts/8_uninstall.sh:56 -msgid "Cleaning up" +#: scripts/4_install_jumpserver.sh:53 +msgid "access" msgstr "" -#: scripts/8_uninstall.sh:30 -msgid "Do you need to clean up the Docker image" +#: scripts/4_install_jumpserver.sh:58 +msgid "More information" msgstr "" -#: scripts/8_uninstall.sh:40 -msgid "Do you need to clean up the Docker binaries" +#: scripts/4_install_jumpserver.sh:59 +msgid "Official Website" msgstr "" -#: scripts/8_uninstall.sh:59 -msgid "Cleanup complete" +#: scripts/4_install_jumpserver.sh:60 +msgid "Documentation" msgstr "" -#: scripts/3_load_images.sh:19 -msgid "Docker image not found" +#: scripts/4_install_jumpserver.sh:70 +msgid "Install and Configure Docker" msgstr "" -#: scripts/3_load_images.sh:36 -msgid "Docker image loaded, skipping" +#: scripts/4_install_jumpserver.sh:79 +msgid "Install and Configure JumpServer" msgstr "" -#: scripts/5_db_backup.sh:22 +#: scripts/5_db_backup.sh:19 msgid "Backing up" msgstr "" -#: scripts/5_db_backup.sh:33 +#: scripts/5_db_backup.sh:51 scripts/5_db_backup.sh:52 msgid "Backup failed" msgstr "" -#: scripts/5_db_backup.sh:37 +#: scripts/5_db_backup.sh:56 msgid "Backup succeeded! The backup file has been saved to" msgstr "" -#: scripts/0_prepare.sh:14 -msgid "Starting to download Docker engine" -msgstr "" - -#: scripts/0_prepare.sh:16 -msgid "Download docker fails, check the network is normal" -msgstr "" - -#: scripts/0_prepare.sh:21 -msgid "Using Docker cache" +#: jmsctl.sh:16 +msgid "If you are upgrading from v1.5.x, please copy the config.txt To" msgstr "" -#: scripts/0_prepare.sh:36 -msgid "Starting to download Docker Compose binary" +#: jmsctl.sh:21 +msgid "There is a problem with the soft connection, Please update it again" msgstr "" -#: scripts/0_prepare.sh:38 -msgid "Download docker-compose fails, check the network is normal" +#: jmsctl.sh:40 +msgid "JumpServer Deployment Management Script" msgstr "" -#: scripts/0_prepare.sh:43 -msgid "Using Docker Compose cache" +#: jmsctl.sh:47 +msgid "Install JumpServer" msgstr "" -#: scripts/0_prepare.sh:56 -msgid "Docker is not running, please install and start" +#: jmsctl.sh:48 +msgid "Upgrade JumpServer" msgstr "" -#: scripts/0_prepare.sh:82 -msgid "Save image" +#: jmsctl.sh:49 +msgid "Check for updates JumpServer" msgstr "" -#: scripts/0_prepare.sh:85 -msgid "The image has been saved, skipping" +#: jmsctl.sh:50 +msgid "Reconfiguration JumpServer" msgstr "" -#: scripts/0_prepare.sh:94 -msgid "Preparing Docker offline package" +#: jmsctl.sh:53 +msgid "Start JumpServer" msgstr "" -#: scripts/0_prepare.sh:98 -msgid "Preparing image offline package" +#: jmsctl.sh:54 +msgid "Stop JumpServer" msgstr "" -#: scripts/utils.sh:167 -msgid "no default" +#: jmsctl.sh:55 +msgid "Restart JumpServer" msgstr "" -#: scripts/utils.sh:169 -msgid "default" +#: jmsctl.sh:56 +msgid "Check JumpServer" msgstr "" -#: scripts/utils.sh:217 -msgid "complete" +#: jmsctl.sh:57 +msgid "Offline JumpServer" msgstr "" -#: scripts/utils.sh:229 -msgid "fail" +#: jmsctl.sh:61 +msgid "Loading docker image" msgstr "" -#: scripts/utils.sh:344 -msgid "command not found, Please install it first" +#: jmsctl.sh:63 +msgid "Data recovery through database backup file" msgstr "" -#: scripts/utils.sh:376 -msgid "Check Configuration File" +#: jmsctl.sh:64 +msgid "Execute the original docker compose command" msgstr "" -#: scripts/utils.sh:377 -msgid "Path to Configuration file" +#: jmsctl.sh:65 +msgid "View log" msgstr "" -#: scripts/6_db_restore.sh:20 -msgid "file does not exist" +#: jmsctl.sh:120 +msgid "The current version is up to date" msgstr "" -#: scripts/6_db_restore.sh:26 -msgid "Start restoring database" +#: jmsctl.sh:125 +msgid "The latest version is" msgstr "" -#: scripts/6_db_restore.sh:34 -msgid "" -"Database recovery failed. Please check whether the database file is complete " -"or try to recover manually" +#: jmsctl.sh:129 +msgid "The current version is" msgstr "" -#: scripts/6_db_restore.sh:37 -msgid "Database recovered successfully" +#: jmsctl.sh:174 jmsctl.sh:180 +msgid "Unsupported Operating System Error" msgstr "" -#: scripts/6_db_restore.sh:48 -msgid "Format error" +#: jmsctl.sh:175 +msgid "macOS installer please see" msgstr "" -#: scripts/6_db_restore.sh:52 -msgid "The backup file does not exist" +#: jmsctl.sh:181 +msgid "Windows installer please see" msgstr "" diff --git a/locale/zh_CN/LC_MESSAGES/jumpserver-installer.mo b/locale/zh_CN/LC_MESSAGES/jumpserver-installer.mo index 7ef466dfb29e58c3e3dd77c2bd52e514e0cf34d3..1d9c9964f7c36263794b2926588d424e540cf368 100644 GIT binary patch delta 3724 zcmaLZdvH|c8OQN=H5zg;BoK&7LQY7cA`otZm4=cKqEeB>XpI7DmgKN(-0X&Il2$A% z2#OV%)H$w7iK7%@7}F8xswkrV(H5tjspEwyme$+oZo-V0QM`?IhJJr%Pai#5i?Ogo)1oEX6K@g-Cu$B^%sFHjHCM?T~sr%b7L zJQX$Ye4L2QI1YPJiQJEuVn3GRD;U5*%x8Slke7aN3wCf}4c6hisLacG$`ouyWxffg z;U91g9>+>0v(jyEE6Gp}G1zU3WHVSO}i^*HLUwQJzSg&6eQj7sP+ zRH+W5GCz*G|0F8G^Vpd>KN)p?A*$pnP?cGax^EZic`u_T^l!BAJJr9GPH|B>fofD{ z&8XeojwEe*yz}>=O8O{j;3rX=>rbdX@CoYs1zgmC6{rDgQA^!|Tkt(32eUdx+R9k! z0Xvb&nLnd8;c;At6Df}p=||mn0JVlkQ3HN}bMPzVpP9Uo4gD)p;lC4VVsAt zt#r<%a|AV$zoWkJ4Q8T`yZK2lS*SJ7Lk%zq^}zYK#AnRasKn!}mr6f?OwzoDS$G0f zxs#~GR2E*Gm>Ek)7s^qu$qdxn(2RP`w%||j8D!&|Ptbh;>!#zesP9*L&hlJ<3}BX^ z-li3(@3o^6UFROhjB)7b0eeupJb}95U)Y47dDjHDt3MV!ACe~P(CjBO7j=Cp>VW~&=IKMta1YMJ zXYmRgLjIXa{2HmE^{5GjkbmYbK2(W47^|W4JRMcwTU>&fOh-4|fGS-8Rq7tp9@v6P zYzJzl2~8MRy@42j!_1D@)IH3gg;sSgIHM1{K1E0e*RDmK? zVlz-BtV0dZf@}-Zi*AXLBANr<@tfZDPf>~HQAYigS6)p0RjQ?&;7v1YuoSm?#{;OD z{slGA+urd>RAM zk7b;?hPahb0%{b;{Zp+!E?Un!2(?v2Cb5xNObj>e89zZTCPZ9CTuGDNT&BWD2HNhS>u{-&g zPguk+2sLe(^=^;q^ zgz4xnnSM&ua*2g*Fa2>H)Dv@vxx{Tm712Wk3AMGv3gTykUf*?uS}pNwqLa`M&s~IC z7ZD+HhDTklvoyU4YAXr-pqxW&BGfhz`f*WfC+0al*LgwYz%lE^Be4sr#|Jn(Ve<^!po~_MC$`k?^Wupr^~`5l%zy+(bM#>C3E( zbaY0dwsS|`w8YxH%YB)Rj1%ax6Az58@%b$0jr?6>{K1gjW_3rb&Yn=n3U>GdiLQcd z-@L`)UVkXqrj+W#fneBXz>wYA9gKv{@U?UzKfIi{b4=V<)DetExz}p5!$G^P%Ifq- zqg7Q^PHy3pv&gZ!uvolaSR_6!JYQswyRen%)Ic}wcy$5V-Ta{oQ2Eydu2dp~@!KNa7f+V)iPkdx}) zmb`Cga{FE_%a7mhrFi&OuUCHLJk`1nRMwC~{1 zOHT6c-KSss@VOUK{fCnM`;(7uIP)EY1N)MFyUuXU>8vOz^)erMwpYjD1$FjRl#LoW SxW8he^V^Ergs<|(jQ;|)8gOp_ delta 3161 zcmZA33rv+|9LMqJD5xnUY9K1gi=rT=n2Mz3{jQjJDKo=7$^lW}$W1hGN2kupdE2Y9 z(#@s0HZOQNip?&TWv$g_uDR^8tR^5^E4pY|nSFofJY?&c|MPjC=Y8Mj{=TyJ$1mdsO#=MGOwdIGjy1g-RxCWDO2M)(m$UoC${S~`WzKb2PTL)vJu|E#Q zOdN|VurnUTcw++QJQ;O-75Qgw@}mbmQO3kzN7Mrj>b{}2J{#4c7u8`E_QEX~i-&Ff z+n7fA6HLTEF&}%-Neum)4WW!NyRe80hj0RRx!;%pI3H7S0}jNan1NqlZ;YY$J~$M6 z;C$3dm05RVPs(ReD|rRe@q5+Nze!-4^l3)o5S)r5u?jVSI$Qr8CR2{>WXuR0iQ}*w znUtx+G59XBw5B!7#u!ZkY6S=IqZJ&D4lcw%3Yls$UGNp_Yu1nP0qVc8-o#0i+jBEx zG1)i=y|#QBxy4*WZOv8ejz6P1j;1jO(@-ll;{n!R7xJml-fgrO4qDHnu77E-|BjiI zyRyL!&O+_!N>oQXPy;xEoI~>#@`(A+)_;v!sh?0Q^mi=lufx%mjnQ6?M>XI>b-Wri zu-&MwI*prgSl94gzJW=UKSe!%6KUJT)4I;kAY6;3sDU)2?u%r3v^A*#GU_lBGjKX; zChKhdUTjCX7B!=@sDWKTosnzU2D|f+CX$4@KMVB+KaLTYgY1G?g8Vb9_)&X-on*2+ z#_U6lyors`A-jtV)+E#0eK-oWbW>0Ro`)P@lW*%Qu^;7)_%I$p&Y`)Ey8o6f-^Z(< zc6x*jm{ePlfqGy(s^fX6x1tEuKo#o2ZK#3nwe=@${d=gxeA!;VjdLh>WdHQs60094 zQm)2Fw5jiqVQ}USYH7N2qSR0Z4#phRY2Ajp?=Z5><^$9~uUUV$^_`q>eScIt?;Y4YMQ&1n492|@5Q8T%KS$GMxG6_7al}bmg;3(8y z&q57!DY6)*3f1n5*5epZ#YHkYonKm;QF|Ck@9JqI8Eipyv=_Ak$4~=#AJyLH zsFnH=IiDtq1I6N)eyH+f)b+*5tiLMO+8b)@4QDZ(`pc*pc>0DL?uII-qXsYqHNXY- zdY-MXMy<#;TfYyPlR1Uj;wz}qw(xb%WP>%C~dNUk?qwsIi7Hb=)(7ze4YWef5;pd2305w&Ys1l&}M# z1E*9JCUmg!$UkArLWgWM5kt%%Du~&H(o$k9@d)839wVv=CB66FP%iY1(L#h@jVQNo zhu_>4QD+7f`pbNd<4mt8S~=HOy2@8-Cisi<3i2yTz2yb|VkfVl(B~BU%bh%bMRBe> zAbNP@%r$doX9b^#ZuSJ9?U?BaUX5`)o`LS|P6vZ0JGb=&f9bNz;~t1j3E${`6q}F~ zdc;}jEi0?^m*$%6LZ6pzeZ}RzQYUoHy&M;B?@x&9ZgUUE^>pjvCc9~IQEBDNe2#bN zQeRn_GcDWkmpZxrB5y&lQ|vABIsUx=Od$A2Tuxi}Os|@>`c1*6nq&XDWSTZ@ZG5w~ zVbA94uh%u4dbwfW^YzWW5ezf4O?sL&$;Ht@v}GHa_cu83SV^BrNl<)Huuq#gnRcl z9ywmW{owy^c3e+NPj`LF#PoZu+}jWJbEEcrQ%$WV-tgR>8|yYX_51hN@7NlAFJ*qj EKf_g@^Z)<= diff --git a/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po b/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po index e71b1d3c..1e8e813b 100644 --- a/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po +++ b/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 07:21+0000\n" +"POT-Creation-Date: 2024-04-29 12:19+0800\n" "PO-Revision-Date: 2021-01-21 19:15+0800\n" "Last-Translator: Bai \n" "Language-Team: Language locale/zh\n" @@ -16,515 +16,558 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: jmsctl.sh:15 -msgid "Configuration file not found" -msgstr "配置文件没有发现" +#: scripts/0_prepare.sh:14 +msgid "Starting to download Docker engine" +msgstr "开始下载 Docker 程序" -#: jmsctl.sh:16 -msgid "If you are upgrading from v1.5.x, please copy the config.txt To" -msgstr "如果你是从 v1.5.x 升级的, 请 copy 之前目录中的 config.txt 到" +#: scripts/0_prepare.sh:16 +msgid "Download docker fails, check the network is normal" +msgstr "下载 docker 失败, 请检查网络是否正常" -#: jmsctl.sh:21 -msgid "There is a problem with the soft connection, Please update it again" -msgstr "软连接存在问题, 重新更新" +#: scripts/0_prepare.sh:21 +msgid "Using Docker cache" +msgstr "使用 Docker 缓存文件" -#: jmsctl.sh:40 -msgid "JumpServer Deployment Management Script" -msgstr "JumpServer 部署管理脚本" +#: scripts/0_prepare.sh:36 +msgid "Starting to download Docker Compose binary" +msgstr "开始下载 Docker Compose 程序" -#: jmsctl.sh:47 -msgid "Install JumpServer" -msgstr "安装 JumpServer" +#: scripts/0_prepare.sh:38 +msgid "Download docker-compose fails, check the network is normal" +msgstr "下载 docker-compose 失败, 请检查网络是否正常" -#: jmsctl.sh:48 -msgid "Upgrade JumpServer" -msgstr "升级 JumpServer" +#: scripts/0_prepare.sh:43 +msgid "Using Docker Compose cache" +msgstr "使用 Docker Compose 缓存文件" -#: jmsctl.sh:49 -msgid "Check for updates JumpServer" -msgstr "检查 JumpServer" +#: scripts/0_prepare.sh:55 +msgid "Docker is not running, please install and start" +msgstr "Docker 没有运行, 请安装并启动" -#: jmsctl.sh:50 -msgid "Reconfiguration JumpServer" -msgstr "重新配置 JumpServer" +#: scripts/0_prepare.sh:81 +msgid "The image has been saved, skipping" +msgstr "已保存过该镜像, 跳过" -#: jmsctl.sh:53 -msgid "Start JumpServer" -msgstr "启动 JumpServer" +#: scripts/0_prepare.sh:85 +msgid "Save image" +msgstr "保存镜像" -#: jmsctl.sh:54 -msgid "Stop JumpServer" -msgstr "停止 JumpServer" +#: scripts/0_prepare.sh:95 +msgid "Preparing Docker offline package" +msgstr "准备 Docker 离线包" -#: jmsctl.sh:55 -msgid "Close JumpServer" -msgstr "关闭 JumpServer" +#: scripts/0_prepare.sh:99 +msgid "Preparing image offline package" +msgstr "准备镜像离线包" -#: jmsctl.sh:56 -msgid "Restart JumpServer" -msgstr "重启 JumpServer" +#: scripts/1_config_jumpserver.sh:8 +msgid "Configure Private Key" +msgstr "配置加密密钥" -#: jmsctl.sh:57 -msgid "Check JumpServer" -msgstr "检查 JumpServer" +#: scripts/1_config_jumpserver.sh:28 +msgid "Configure Persistent Directory" +msgstr "配置持久化目录" -#: jmsctl.sh:58 -msgid "Offline JumpServer" -msgstr "下线 JumpServer" +#: scripts/1_config_jumpserver.sh:31 +msgid "Do you need custom persistent store, will use the default directory" +msgstr "是否需要自定义持久化存储, 默认将使用目录" -#: jmsctl.sh:59 scripts/8_uninstall.sh:63 -msgid "Uninstall JumpServer" -msgstr "卸载 JumpServer" +#: scripts/1_config_jumpserver.sh:34 +msgid "" +"To modify the persistent directory such as logs video, you can select your " +"largest disk and create a directory in it, such as" +msgstr "修改日志录像等持久化的目录,可以找个最大的磁盘,并创建目录,如" -#: jmsctl.sh:62 -msgid "Loading docker image" -msgstr "加载 Docker 镜像" +#: scripts/1_config_jumpserver.sh:35 +msgid "" +"Note: you can not change it after installation, otherwise the database may " +"be lost" +msgstr "注意:安装后不能更改,否则数据库可能会丢失" -#: jmsctl.sh:63 scripts/7_upgrade.sh:298 -msgid "Backup database" -msgstr "备份数据库" +#: scripts/1_config_jumpserver.sh:39 +msgid "Persistent storage directory" +msgstr "持久化存储目录" -#: jmsctl.sh:64 -msgid "Data recovery through database backup file" -msgstr "通过数据库备份文件恢复数据" +#: scripts/1_config_jumpserver.sh:72 +msgid "Please enter DB server IP" +msgstr "请输入数据库的主机地址" -#: jmsctl.sh:65 -msgid "Execute the original docker-compose command" -msgstr "执行原始 docker-compose 命令" +#: scripts/1_config_jumpserver.sh:74 +msgid "Can not use localhost as DB server IP" +msgstr "无法将 localhost 用作数据库服务器 IP" -#: jmsctl.sh:66 -msgid "View log" -msgstr "查看日志" +#: scripts/1_config_jumpserver.sh:77 +msgid "Please enter DB server port" +msgstr "请输入数据库的端口" -#: jmsctl.sh:127 -msgid "The current version is up to date" -msgstr "当前版本已是最新" +#: scripts/1_config_jumpserver.sh:79 +msgid "Please enter DB database name" +msgstr "请输入数据库的数据库" -#: jmsctl.sh:132 -msgid "The latest version is" -msgstr "最新版本是" +#: scripts/1_config_jumpserver.sh:81 +msgid "Please enter DB username" +msgstr "请输入数据库的用户名" -#: jmsctl.sh:136 -msgid "The current version is" -msgstr "当前版本是" +#: scripts/1_config_jumpserver.sh:83 +msgid "Please enter DB password" +msgstr "请输入数据库的密码" -#: jmsctl.sh:181 jmsctl.sh:187 -msgid "Unsupported Operating System Error" -msgstr "错误: 不支持的操作系统" +#: scripts/1_config_jumpserver.sh:106 +msgid "Configure DB" +msgstr "配置数据库" -#: jmsctl.sh:182 -msgid "macOS installer please see" -msgstr "macOS 安装请参考" +#: scripts/1_config_jumpserver.sh:116 +msgid "Do you want to use external MySQL" +msgstr "是否使用外部 MySQL" -#: jmsctl.sh:188 -msgid "Windows installer please see" -msgstr "Windows 安装请参考" +#: scripts/1_config_jumpserver.sh:128 +msgid "Do you want to use external PostgreSQL" +msgstr "是否使用外部 PostgreSQL" -#: scripts/4_install_jumpserver.sh:10 -msgid "" -"The current Linux system does not support systemd management. Please deploy " -"docker by yourself before running this script again" -msgstr "" -"当前 Linux 系统不支持 systemd 管理, 请先自行部署 docker 后再重新运行此脚本" +#: scripts/1_config_jumpserver.sh:136 scripts/6_db_restore.sh:46 +#: scripts/5_db_backup.sh:45 +msgid "Invalid DB Engine selection" +msgstr "无效的 数据库 模式" -#: scripts/4_install_jumpserver.sh:14 -msgid "" -"The current Linux system does not support systemd management. Please deploy " -"docker-compose by yourself before running this script again" -msgstr "" -"当前 Linux 系统不支持 systemd 管理, 请先自行部署 docker-compose 后再重新运行" -"此脚本" +#: scripts/1_config_jumpserver.sh:144 +msgid "Please enter Redis server IP" +msgstr "请输入 Redis 的主机地址" -#: scripts/4_install_jumpserver.sh:21 -msgid "The Installation is Complete" -msgstr "安装完成了" +#: scripts/1_config_jumpserver.sh:146 +msgid "Can not use localhost as Redis server IP" +msgstr "无法将 localhost 用作 Redis 服务器 IP" -#: scripts/4_install_jumpserver.sh:37 -msgid "You can use the following command to start, and then visit" -msgstr "可以使用如下命令启动, 然后访问" +#: scripts/1_config_jumpserver.sh:149 +msgid "Please enter Redis server port" +msgstr "请输入 Redis 的端口" -#: scripts/4_install_jumpserver.sh:41 -msgid "Other management commands" -msgstr "其它一些管理命令" +#: scripts/1_config_jumpserver.sh:151 scripts/1_config_jumpserver.sh:164 +msgid "Please enter Redis password" +msgstr "请输入 Redis 的密码" -#: scripts/4_install_jumpserver.sh:46 -msgid "For more commands, you can enter ./jmsctl.sh --help to understand" -msgstr "更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解" +#: scripts/1_config_jumpserver.sh:160 +msgid "Please enter Redis Sentinel hosts" +msgstr "请输入 Redis Sentinel 的主机地址" -#: scripts/4_install_jumpserver.sh:48 -msgid "Web access" -msgstr "Web 访问" +#: scripts/1_config_jumpserver.sh:162 +msgid "Please enter Redis Sentinel password" +msgstr "请输入 Redis Sentinel 的密码" -#: scripts/4_install_jumpserver.sh:55 -msgid "Default username" -msgstr "默认用户" +#: scripts/1_config_jumpserver.sh:186 +msgid "Configure Redis" +msgstr "配置 Redis" -#: scripts/4_install_jumpserver.sh:55 -msgid "Default password" -msgstr "默认密码" +#: scripts/1_config_jumpserver.sh:188 +msgid "Please enter Redis Engine" +msgstr "请输入 Redis 模式" -#: scripts/4_install_jumpserver.sh:57 -msgid "access" -msgstr "访问" +#: scripts/1_config_jumpserver.sh:197 +msgid "Do you want to use external Redis" +msgstr "是否使用外部 Redis" -#: scripts/4_install_jumpserver.sh:61 -msgid "More information" -msgstr "更多信息" +#: scripts/1_config_jumpserver.sh:208 +msgid "Invalid Redis Engine selection" +msgstr "无效的 Redis 模式" -#: scripts/4_install_jumpserver.sh:62 -msgid "Official Website" -msgstr "我们的官网" +#: scripts/1_config_jumpserver.sh:214 +msgid "Configure External Access" +msgstr "配置外部访问" -#: scripts/4_install_jumpserver.sh:63 -msgid "Documentation" -msgstr "我们的文档" +#: scripts/1_config_jumpserver.sh:220 +msgid "Do you need to customize the JumpServer external port" +msgstr "是否需要配置 JumpServer 对外访问端口" -#: scripts/4_install_jumpserver.sh:73 -msgid "Install and Configure Docker" -msgstr "安装配置 Docker" +#: scripts/1_config_jumpserver.sh:222 +msgid "JumpServer web port" +msgstr "JumpServer web 端口" -#: scripts/4_install_jumpserver.sh:77 scripts/7_upgrade.sh:295 -msgid "Loading Docker Image" -msgstr "加载 Docker 镜像" +#: scripts/1_config_jumpserver.sh:226 +msgid "JumpServer ssh port" +msgstr "JumpServer ssh 端口" -#: scripts/4_install_jumpserver.sh:81 -msgid "Install and Configure JumpServer" -msgstr "安装配置 JumpServer" +#: scripts/1_config_jumpserver.sh:228 +msgid "JumpServer rdp port" +msgstr "JumpServer rdp 端口" + +#: scripts/1_config_jumpserver.sh:235 +msgid "Init JumpServer Database" +msgstr "初始化数据库" + +#: scripts/1_config_jumpserver.sh:237 scripts/7_upgrade.sh:256 +#: scripts/utils.sh:565 +msgid "Failed to change the table structure" +msgstr "表结构变更失败" + +#: scripts/2_install_docker.sh:25 +msgid "Docker program does not exist" +msgstr "Docker 程序不存在" + +#: scripts/2_install_docker.sh:80 scripts/2_install_docker.sh:173 +msgid "Permission denied. pass..." +msgstr "Permission denied. 跳过..." + +#: scripts/2_install_docker.sh:155 +msgid "Do you want to support IPv6" +msgstr "是否需要支持 IPv6" -#: scripts/7_upgrade.sh:92 scripts/1_config_jumpserver.sh:158 -msgid "Please enter the access IP or domain name of JumpServer" -msgstr "请输入 JumpServer 的访问 IP 或者 域名" +#: scripts/2_install_docker.sh:205 +msgid "Install Docker" +msgstr "安装 Docker" + +#: scripts/2_install_docker.sh:208 +msgid "Configure Docker" +msgstr "配置 Docker" + +#: scripts/2_install_docker.sh:210 +msgid "Start Docker" +msgstr "启动 Docker" + +#: scripts/3_load_images.sh:19 +msgid "Docker image not found" +msgstr "镜像文件没有发现" + +#: scripts/3_load_images.sh:36 +msgid "Docker image loaded, skipping" +msgstr "镜像已加载, 跳过" -#: scripts/7_upgrade.sh:186 +#: scripts/6_db_restore.sh:15 scripts/8_uninstall.sh:62 +msgid "Make sure you have a backup of data, this operation is not reversible" +msgstr "请确认已经备份好相关数据, 此操作不可逆" + +#: scripts/6_db_restore.sh:18 +msgid "file does not exist" +msgstr "文件不存在" + +#: scripts/6_db_restore.sh:24 +msgid "Start restoring database" +msgstr "开始还原数据库" + +#: scripts/6_db_restore.sh:52 +msgid "" +"Database recovery failed. Please check whether the database file is complete " +"or try to recover manually" +msgstr "数据库恢复失败. 请检查数据库文件是否完整, 或尝试手动恢复" + +#: scripts/6_db_restore.sh:55 +msgid "Database recovered successfully" +msgstr "数据库恢复成功" + +#: scripts/6_db_restore.sh:66 +msgid "Format error" +msgstr "格式错误" + +#: scripts/6_db_restore.sh:70 +msgid "The backup file does not exist" +msgstr "备份文件不存在" + +#: scripts/7_upgrade.sh:223 msgid "Back up to" msgstr "备份至" -#: scripts/7_upgrade.sh:193 +#: scripts/7_upgrade.sh:230 msgid "Failed to backup the database. Continue to upgrade" msgstr "备份数据库失败, 继续升级吗" -#: scripts/7_upgrade.sh:199 +#: scripts/7_upgrade.sh:236 msgid "Skip database backup" msgstr "跳过备份数据库" -#: scripts/7_upgrade.sh:206 +#: scripts/7_upgrade.sh:243 msgid "" "Detected that the JumpServer container is running. Do you want to close the " "container and continue to upgrade" msgstr "检测到 JumpServer 正在运行, 是否需要关闭并继续升级" -#: scripts/7_upgrade.sh:219 scripts/1_config_jumpserver.sh:183 -#: scripts/utils.sh:522 -msgid "Failed to change the table structure" -msgstr "表结构变更失败" - -#: scripts/7_upgrade.sh:221 +#: scripts/7_upgrade.sh:258 msgid "Failed to change the table structure. Continue to upgrade" msgstr "表结构变更失败, 是否继续" -#: scripts/7_upgrade.sh:232 +#: scripts/7_upgrade.sh:271 msgid "Do you need to clean up the old version image" msgstr "是否需要清理旧版本镜像文件" -#: scripts/7_upgrade.sh:245 +#: scripts/7_upgrade.sh:284 msgid "Do you need upgrade Docker binaries" msgstr "是否升级 Docker binaries" -#: scripts/7_upgrade.sh:265 +#: scripts/7_upgrade.sh:308 msgid "Do you need upgrade Docker Compose" msgstr "是否升级 Docker Compose" -#: scripts/7_upgrade.sh:283 +#: scripts/7_upgrade.sh:326 msgid "Are you sure you want to update the current version to" msgstr "是否将版本更新至" -#: scripts/7_upgrade.sh:301 +#: scripts/7_upgrade.sh:338 scripts/4_install_jumpserver.sh:75 +msgid "Loading Docker Image" +msgstr "加载 Docker 镜像" + +#: scripts/7_upgrade.sh:341 jmsctl.sh:62 +msgid "Backup database" +msgstr "备份数据库" + +#: scripts/7_upgrade.sh:344 msgid "Backup Configuration File" msgstr "备份配置文件" -#: scripts/7_upgrade.sh:304 +#: scripts/7_upgrade.sh:347 msgid "Apply database changes" msgstr "进行数据库变更" -#: scripts/7_upgrade.sh:305 +#: scripts/7_upgrade.sh:348 msgid "Changing database schema may take a while, please wait patiently" msgstr "表结构变更可能需要一段时间, 请耐心等待" -#: scripts/7_upgrade.sh:308 +#: scripts/7_upgrade.sh:351 msgid "Cleanup Image" msgstr "清理镜像" -#: scripts/7_upgrade.sh:311 +#: scripts/7_upgrade.sh:354 msgid "Upgrade Docker" msgstr "升级 Docker" -#: scripts/7_upgrade.sh:316 +#: scripts/7_upgrade.sh:360 msgid "Upgrade successfully. You can now restart the program" msgstr "升级成功, 可以重新启动程序了" -#: scripts/2_install_docker.sh:25 -msgid "Docker program does not exist" -msgstr "Docker 程序不存在" - -#: scripts/2_install_docker.sh:129 -msgid "Do you want to support IPv6" -msgstr "是否需要支持 IPv6" - -#: scripts/2_install_docker.sh:175 -msgid "Install Docker" -msgstr "安装 Docker" - -#: scripts/2_install_docker.sh:178 -msgid "Configure Docker" -msgstr "配置 Docker" - -#: scripts/2_install_docker.sh:180 -msgid "Start Docker" -msgstr "启动 Docker" - -#: scripts/1_config_jumpserver.sh:8 -msgid "Configure Private Key" -msgstr "配置加密密钥" - -#: scripts/1_config_jumpserver.sh:28 -msgid "Configure Persistent Directory" -msgstr "配置持久化目录" - -#: scripts/1_config_jumpserver.sh:31 -msgid "Do you need custom persistent store, will use the default directory" -msgstr "是否需要自定义持久化存储, 默认将使用目录" +#: scripts/8_uninstall.sh:18 scripts/8_uninstall.sh:32 +#: scripts/8_uninstall.sh:37 scripts/8_uninstall.sh:45 +#: scripts/8_uninstall.sh:54 scripts/8_uninstall.sh:69 +#: scripts/8_uninstall.sh:73 +msgid "Cleaning up" +msgstr "正在清理" -#: scripts/1_config_jumpserver.sh:34 -msgid "" -"To modify the persistent directory such as logs video, you can select your " -"largest disk and create a directory in it, such as" -msgstr "修改日志录像等持久化的目录,可以找个最大的磁盘,并创建目录,如" +#: scripts/8_uninstall.sh:27 +msgid "Do you need to clean up the Docker binaries" +msgstr "是否清理 Docker binaries" -#: scripts/1_config_jumpserver.sh:35 -msgid "" -"Note: you can not change it after installation, otherwise the database may " -"be lost" -msgstr "注意:安装后不能更改,否则数据库可能会丢失" +#: scripts/8_uninstall.sh:43 scripts/8_uninstall.sh:52 +msgid "Do you need to clean up the Docker Compose binaries" +msgstr "是否清理 Docker Compose binaries" -#: scripts/1_config_jumpserver.sh:39 -msgid "Persistent storage directory" -msgstr "持久化存储目录" +#: scripts/8_uninstall.sh:66 +msgid "Are you clean up JumpServer files" +msgstr "确认清理 JumpServer 相关文件" -#: scripts/1_config_jumpserver.sh:55 -msgid "Please enter MySQL server IP" -msgstr "请输入 mysql 的主机地址" +#: scripts/8_uninstall.sh:80 +msgid "Do you need to clean up the Docker image" +msgstr "是否清理 Docker 镜像" -#: scripts/1_config_jumpserver.sh:60 -msgid "Please enter MySQL server port" -msgstr "请输入 mysql 的端口" +#: scripts/8_uninstall.sh:87 +msgid "Cleanup complete" +msgstr "清理完成" -#: scripts/1_config_jumpserver.sh:62 -msgid "Please enter MySQL database name" -msgstr "请输入 mysql 的数据库" +#: scripts/8_uninstall.sh:91 jmsctl.sh:58 +msgid "Uninstall JumpServer" +msgstr "卸载 JumpServer" -#: scripts/1_config_jumpserver.sh:64 -msgid "Please enter MySQL username" -msgstr "请输入 mysql 的用户名" +#: scripts/utils.sh:198 +msgid "no default" +msgstr "无默认值" -#: scripts/1_config_jumpserver.sh:66 -msgid "Please enter MySQL password" -msgstr "请输入 mysql 的密码" +#: scripts/utils.sh:200 +msgid "default" +msgstr "默认为" -#: scripts/1_config_jumpserver.sh:91 -msgid "Configure MySQL" -msgstr "配置 MySQL" +#: scripts/utils.sh:248 +msgid "complete" +msgstr "完成" -#: scripts/1_config_jumpserver.sh:97 -msgid "Do you want to use external MySQL" -msgstr "是否使用外部 MySQL" +#: scripts/utils.sh:260 +msgid "fail" +msgstr "失败" -#: scripts/1_config_jumpserver.sh:107 -msgid "Please enter Redis server IP" -msgstr "请输入 Redis 的主机地址" +#: scripts/utils.sh:385 +msgid "command not found, Please install it first" +msgstr "未找到命令, 请先安装" -#: scripts/1_config_jumpserver.sh:112 -msgid "Please enter Redis server port" -msgstr "请输入 Redis 的端口" +#: scripts/utils.sh:417 +msgid "Check Configuration File" +msgstr "检查配置文件" -#: scripts/1_config_jumpserver.sh:114 -msgid "Please enter Redis password" -msgstr "请输入 Redis 的密码" +#: scripts/utils.sh:418 +msgid "Path to Configuration file" +msgstr "配置文件位置" -#: scripts/1_config_jumpserver.sh:132 -msgid "Configure Redis" -msgstr "配置 Redis" +#: scripts/utils.sh:634 +msgid "Failed to pull image" +msgstr "拉取镜像失败" -#: scripts/1_config_jumpserver.sh:142 -msgid "Do you want to use external Redis" -msgstr "是否使用外部 Redis" +#: scripts/4_install_jumpserver.sh:10 +msgid "" +"The current Linux system does not support systemd management. Please deploy " +"docker by yourself before running this script again" +msgstr "" +"当前 Linux 系统不支持 systemd 管理, 请先自行部署 docker 后再重新运行此脚本" -#: scripts/1_config_jumpserver.sh:151 -msgid "Configure External Access" -msgstr "配置外部访问" +#: scripts/4_install_jumpserver.sh:14 +msgid "" +"The current Linux system does not support systemd management. Please deploy " +"docker-compose by yourself before running this script again" +msgstr "" +"当前 Linux 系统不支持 systemd 管理, 请先自行部署 docker-compose 后再重新运行" +"此脚本" -#: scripts/1_config_jumpserver.sh:167 -msgid "Do you need to customize the JumpServer external port" -msgstr "是否需要配置 JumpServer 对外访问端口" +#: scripts/4_install_jumpserver.sh:21 +msgid "The Installation is Complete" +msgstr "安装完成了" -#: scripts/1_config_jumpserver.sh:169 -msgid "JumpServer web port" -msgstr "JumpServer web 端口" +#: scripts/4_install_jumpserver.sh:32 +msgid "You can use the following command to start, and then visit" +msgstr "可以使用如下命令启动, 然后访问" -#: scripts/1_config_jumpserver.sh:171 -msgid "JumpServer ssh port" -msgstr "JumpServer ssh 端口" +#: scripts/4_install_jumpserver.sh:36 +msgid "Other management commands" +msgstr "其它一些管理命令" -#: scripts/1_config_jumpserver.sh:174 -msgid "JumpServer rdp port" -msgstr "JumpServer rdp 端口" +#: scripts/4_install_jumpserver.sh:41 +msgid "For more commands, you can enter ./jmsctl.sh --help to understand" +msgstr "更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解" -#: scripts/1_config_jumpserver.sh:181 -msgid "Init JumpServer Database" -msgstr "初始化数据库" +#: scripts/4_install_jumpserver.sh:43 +msgid "Web access" +msgstr "Web 访问" -#: scripts/8_uninstall.sh:8 scripts/6_db_restore.sh:16 -msgid "Make sure you have a backup of data, this operation is not reversible" -msgstr "请确认已经备份好相关数据, 此操作不可逆" +#: scripts/4_install_jumpserver.sh:50 +msgid "Default username" +msgstr "默认用户" -#: scripts/8_uninstall.sh:12 -msgid "Are you clean up JumpServer files" -msgstr "确认清理 JumpServer 相关文件" +#: scripts/4_install_jumpserver.sh:50 +msgid "Default password" +msgstr "默认密码" -#: scripts/8_uninstall.sh:19 scripts/8_uninstall.sh:21 -#: scripts/8_uninstall.sh:23 scripts/8_uninstall.sh:45 -#: scripts/8_uninstall.sh:50 scripts/8_uninstall.sh:56 -msgid "Cleaning up" -msgstr "正在清理" +#: scripts/4_install_jumpserver.sh:53 +msgid "access" +msgstr "访问" -#: scripts/8_uninstall.sh:30 -msgid "Do you need to clean up the Docker image" -msgstr "是否清理 Docker 镜像" +#: scripts/4_install_jumpserver.sh:58 +msgid "More information" +msgstr "更多信息" -#: scripts/8_uninstall.sh:40 -msgid "Do you need to clean up the Docker binaries" -msgstr "是否清理 Docker binaries" +#: scripts/4_install_jumpserver.sh:59 +msgid "Official Website" +msgstr "我们的官网" -#: scripts/8_uninstall.sh:59 -msgid "Cleanup complete" -msgstr "清理完成" +#: scripts/4_install_jumpserver.sh:60 +msgid "Documentation" +msgstr "我们的文档" -#: scripts/3_load_images.sh:19 -msgid "Docker image not found" -msgstr "镜像文件没有发现" +#: scripts/4_install_jumpserver.sh:70 +msgid "Install and Configure Docker" +msgstr "安装配置 Docker" -#: scripts/3_load_images.sh:36 -msgid "Docker image loaded, skipping" -msgstr "镜像已加载, 跳过" +#: scripts/4_install_jumpserver.sh:79 +msgid "Install and Configure JumpServer" +msgstr "安装配置 JumpServer" -#: scripts/5_db_backup.sh:22 +#: scripts/5_db_backup.sh:19 msgid "Backing up" msgstr "正在备份" -#: scripts/5_db_backup.sh:33 +#: scripts/5_db_backup.sh:51 scripts/5_db_backup.sh:52 msgid "Backup failed" msgstr "备份失败" -#: scripts/5_db_backup.sh:37 +#: scripts/5_db_backup.sh:56 msgid "Backup succeeded! The backup file has been saved to" msgstr "备份成功! 备份文件已存放至" -#: scripts/0_prepare.sh:14 -msgid "Starting to download Docker engine" -msgstr "开始下载 Docker 程序" +#: jmsctl.sh:16 +msgid "If you are upgrading from v1.5.x, please copy the config.txt To" +msgstr "如果你是从 v1.5.x 升级的, 请 copy 之前目录中的 config.txt 到" -#: scripts/0_prepare.sh:16 -msgid "Download docker fails, check the network is normal" -msgstr "下载 docker 失败, 请检查网络是否正常" +#: jmsctl.sh:21 +msgid "There is a problem with the soft connection, Please update it again" +msgstr "软连接存在问题, 重新更新" -#: scripts/0_prepare.sh:21 -msgid "Using Docker cache" -msgstr "使用 Docker 缓存文件" +#: jmsctl.sh:40 +msgid "JumpServer Deployment Management Script" +msgstr "JumpServer 部署管理脚本" -#: scripts/0_prepare.sh:36 -msgid "Starting to download Docker Compose binary" -msgstr "开始下载 Docker Compose 程序" +#: jmsctl.sh:47 +msgid "Install JumpServer" +msgstr "安装 JumpServer" -#: scripts/0_prepare.sh:38 -msgid "Download docker-compose fails, check the network is normal" -msgstr "下载 docker-compose 失败, 请检查网络是否正常" +#: jmsctl.sh:48 +msgid "Upgrade JumpServer" +msgstr "升级 JumpServer" -#: scripts/0_prepare.sh:43 -msgid "Using Docker Compose cache" -msgstr "使用 Docker Compose 缓存文件" +#: jmsctl.sh:49 +msgid "Check for updates JumpServer" +msgstr "检查 JumpServer" -#: scripts/0_prepare.sh:56 -msgid "Docker is not running, please install and start" -msgstr "Docker 没有运行, 请安装并启动" +#: jmsctl.sh:50 +msgid "Reconfiguration JumpServer" +msgstr "重新配置 JumpServer" -#: scripts/0_prepare.sh:82 -msgid "Save image" -msgstr "保存镜像" +#: jmsctl.sh:53 +msgid "Start JumpServer" +msgstr "启动 JumpServer" -#: scripts/0_prepare.sh:85 -msgid "The image has been saved, skipping" -msgstr "已保存过该镜像, 跳过" +#: jmsctl.sh:54 +msgid "Stop JumpServer" +msgstr "停止 JumpServer" -#: scripts/0_prepare.sh:94 -msgid "Preparing Docker offline package" -msgstr "准备 Docker 离线包" +#: jmsctl.sh:55 +msgid "Restart JumpServer" +msgstr "重启 JumpServer" -#: scripts/0_prepare.sh:98 -msgid "Preparing image offline package" -msgstr "准备镜像离线包" +#: jmsctl.sh:56 +msgid "Check JumpServer" +msgstr "检查 JumpServer" -#: scripts/utils.sh:167 -msgid "no default" -msgstr "无默认值" +#: jmsctl.sh:57 +msgid "Offline JumpServer" +msgstr "下线 JumpServer" -#: scripts/utils.sh:169 -msgid "default" -msgstr "默认为" +#: jmsctl.sh:61 +msgid "Loading docker image" +msgstr "加载 Docker 镜像" -#: scripts/utils.sh:217 -msgid "complete" -msgstr "完成" +#: jmsctl.sh:63 +msgid "Data recovery through database backup file" +msgstr "通过数据库备份文件恢复数据" -#: scripts/utils.sh:229 -msgid "fail" -msgstr "失败" +#: jmsctl.sh:64 +msgid "Execute the original docker compose command" +msgstr "执行原始 docker compose 命令" -#: scripts/utils.sh:344 -msgid "command not found, Please install it first" -msgstr "未找到命令, 请先安装" +#: jmsctl.sh:65 +msgid "View log" +msgstr "查看日志" -#: scripts/utils.sh:376 -msgid "Check Configuration File" -msgstr "检查配置文件" +#: jmsctl.sh:120 +msgid "The current version is up to date" +msgstr "当前版本已是最新" -#: scripts/utils.sh:377 -msgid "Path to Configuration file" -msgstr "配置文件位置" +#: jmsctl.sh:125 +msgid "The latest version is" +msgstr "最新版本是" -#: scripts/6_db_restore.sh:20 -msgid "file does not exist" -msgstr "文件不存在" +#: jmsctl.sh:129 +msgid "The current version is" +msgstr "当前版本是" -#: scripts/6_db_restore.sh:26 -msgid "Start restoring database" -msgstr "开始还原数据库" +#: jmsctl.sh:174 jmsctl.sh:180 +msgid "Unsupported Operating System Error" +msgstr "错误: 不支持的操作系统" -#: scripts/6_db_restore.sh:34 -msgid "" -"Database recovery failed. Please check whether the database file is complete " -"or try to recover manually" -msgstr "数据库恢复失败. 请检查数据库文件是否完整, 或尝试手动恢复" +#: jmsctl.sh:175 +msgid "macOS installer please see" +msgstr "macOS 安装请参考" -#: scripts/6_db_restore.sh:37 -msgid "Database recovered successfully" -msgstr "数据库恢复成功" +#: jmsctl.sh:181 +msgid "Windows installer please see" +msgstr "Windows 安装请参考" -#: scripts/6_db_restore.sh:48 -msgid "Format error" -msgstr "格式错误" +#~ msgid "Close JumpServer" +#~ msgstr "关闭 JumpServer" -#: scripts/6_db_restore.sh:52 -msgid "The backup file does not exist" -msgstr "备份文件不存在" +#~ msgid "Please enter the access IP or domain name of JumpServer" +#~ msgstr "请输入 JumpServer 的访问 IP 或者 域名" + +#~ msgid "Configure MySQL" +#~ msgstr "配置 MySQL" #~ msgid "There are updates available currently. Do you want to update" #~ msgstr "检测到 Docker 版本有更新, 是否更新" diff --git a/quick_start.sh b/quick_start.sh index fed667e0..88b4e82b 100644 --- a/quick_start.sh +++ b/quick_start.sh @@ -5,17 +5,17 @@ VERSION=dev DOWNLOAD_URL=https://github.com function install_soft() { - if command -v dnf > /dev/null; then + if command -v dnf &>/dev/null; then dnf -q -y install "$1" - elif command -v yum > /dev/null; then + elif command -v yum &>/dev/null; then yum -q -y install "$1" - elif command -v apt > /dev/null; then + elif command -v apt &>/dev/null; then apt-get -qqy install "$1" - elif command -v zypper > /dev/null; then + elif command -v zypper &>/dev/null; then zypper -q -n install "$1" - elif command -v apk > /dev/null; then + elif command -v apk &>/dev/null; then apk add -q "$1" - command -v gettext >/dev/null || { + command -v gettext &>/dev/null || { apk add -q gettext-dev python3 } else diff --git a/scripts/0_prepare.sh b/scripts/0_prepare.sh index d8a5d044..c4e74bb0 100644 --- a/scripts/0_prepare.sh +++ b/scripts/0_prepare.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" @@ -51,7 +51,7 @@ function prepare_compose_bin() { } function prepare_image_files() { - if ! pgrep -f "docker" >/dev/null; then + if ! pgrep -f "docker"&>/dev/null; then echo "$(gettext 'Docker is not running, please install and start') ..." exit 1 fi diff --git a/scripts/1_config_jumpserver.sh b/scripts/1_config_jumpserver.sh index 96a82d29..1ccee8f7 100644 --- a/scripts/1_config_jumpserver.sh +++ b/scripts/1_config_jumpserver.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" @@ -18,7 +18,7 @@ function set_secret_key() { set_config BOOTSTRAP_TOKEN "${bootstrap_key}" echo "BOOTSTRAP_TOKEN: ${bootstrap_key}" fi - if command -v hostname >/dev/null; then + if command -v hostname&>/dev/null; then SERVER_HOSTNAME=$(hostname) set_config SERVER_HOSTNAME "${SERVER_HOSTNAME}" fi @@ -50,63 +50,100 @@ function set_volume_dir() { set_config VOLUME_DIR ${volume_dir} } -function set_external_mysql() { - mysql_host=$(get_config DB_HOST) - read_from_input mysql_host "$(gettext 'Please enter MySQL server IP')" "" "${mysql_host}" - if [[ "${mysql_host}" == "127.0.0.1" || "${mysql_host}" == "localhost" ]]; then - mysql_host=$(hostname -I | cut -d ' ' -f1) - fi - mysql_port=$(get_config DB_PORT) - read_from_input mysql_port "$(gettext 'Please enter MySQL server port')" "" "${mysql_port}" - mysql_db=$(get_config DB_NAME) - read_from_input mysql_db "$(gettext 'Please enter MySQL database name')" "" "${mysql_db}" - mysql_user=$(get_config DB_USER) - read_from_input mysql_user "$(gettext 'Please enter MySQL username')" "" "${mysql_user}" - mysql_password=$(get_config DB_PASSWORD) - read_from_input mysql_password "$(gettext 'Please enter MySQL password')" "" "${mysql_password}" - - set_config DB_HOST "${mysql_host}" - set_config DB_PORT "${mysql_port}" - set_config DB_USER "${mysql_user}" - set_config DB_PASSWORD "${mysql_password}" - set_config DB_NAME "${mysql_db}" +function set_db_config() { + local db_engine=$1 + local db_host=$2 + local db_port=$3 + local db_user=$4 + local db_password=$5 + local db_name=$6 + + set_config DB_ENGINE "${db_engine}" + set_config DB_HOST "${db_host}" + set_config DB_PORT "${db_port}" + set_config DB_USER "${db_user}" + set_config DB_PASSWORD "${db_password}" + set_config DB_NAME "${db_name}" } -function set_internal_mysql() { - mysql_password=$(get_config DB_PASSWORD) - if [[ -z "${mysql_password}" ]]; then - DB_PASSWORD=$(random_str 26) - set_config DB_PASSWORD "${DB_PASSWORD}" - fi - mysql_db=$(get_config DB_NAME) - if [[ -z "${mysql_db}" ]]; then - set_config DB_NAME jumpserver +function set_external_db() { + local db_engine=$1 + db_host=$(get_config DB_HOST) + read_from_input db_host "$(gettext 'Please enter DB server IP')" "" "${db_host}" + if [[ "${db_host}" == "127.0.0.1" || "${db_host}" == "localhost" ]]; then + log_error "$(gettext 'Can not use localhost as DB server IP')" fi - set_config DB_HOST mysql - set_config DB_PORT 3306 - set_config DB_USER root + db_port=$(get_config DB_PORT) + read_from_input db_port "$(gettext 'Please enter DB server port')" "" "${db_port}" + db_name=$(get_config DB_NAME) + read_from_input db_name "$(gettext 'Please enter DB database name')" "" "${db_name}" + db_user=$(get_config DB_USER) + read_from_input db_user "$(gettext 'Please enter DB username')" "" "${db_user}" + db_password=$(get_config DB_PASSWORD) + read_from_input db_password "$(gettext 'Please enter DB password')" "" "${db_password}" + + set_db_config "${db_engine}" "${db_host}" "${db_port}" "${db_user}" "${db_password}" "${db_name}" } -function set_mysql() { - echo_yellow "\n3. $(gettext 'Configure MySQL')" - mysql_host=$(get_config DB_HOST) - confirm="n" - if [[ "${mysql_host}" != "mysql" ]]; then - confirm="y" +function set_internal_db() { + local db_engine=$1 + local db_host=$2 + local db_port=$3 + local db_user=$4 + db_password=$(get_config DB_PASSWORD) + if [[ -z "${db_password}" ]]; then + db_password=$(random_str 26) fi - read_from_input confirm "$(gettext 'Do you want to use external MySQL')?" "y/n" "${confirm}" - if [[ "${confirm}" == "y" ]]; then - set_external_mysql - else - set_internal_mysql + db_name=$(get_config DB_NAME) + if [[ -z "${db_name}" ]]; then + db_name=jumpserver fi + + set_db_config "${db_engine}" "${db_host}" "${db_port}" "${db_user}" "${db_password}" "${db_name}" +} + +function set_db() { + echo_yellow "\n3. $(gettext 'Configure DB')" + db_engine=$(get_config DB_ENGINE "mysql") + db_host=$(get_config DB_HOST) + + case "${db_engine}" in + mysql) + confirm="n" + if [[ "${db_host}" != "mysql" ]]; then + confirm="y" + fi + read_from_input confirm "$(gettext 'Do you want to use external MySQL')?" "y/n" "${confirm}" + if [[ "${confirm}" == "y" ]]; then + set_external_db "mysql" + else + set_internal_db "mysql" "mysql" "3306" "root" + fi + ;; + postgresql) + confirm="n" + if [[ "${db_host}" != "postgresql" ]]; then + confirm="y" + fi + read_from_input confirm "$(gettext 'Do you want to use external PostgreSQL')?" "y/n" "${confirm}" + if [[ "${confirm}" == "y" ]]; then + set_external_db "postgresql" + else + set_internal_db "postgresql" "postgresql" "5432" "postgres" + fi + ;; + *) + echo "$(gettext 'Invalid DB Engine selection')" + exit 1 + ;; + esac } function set_external_redis() { redis_host=$(get_config REDIS_HOST) read_from_input redis_host "$(gettext 'Please enter Redis server IP')" "" "${redis_host}" if [[ "${redis_host}" == "127.0.0.1" || "${redis_host}" == "localhost" ]]; then - redis_host=$(hostname -I | cut -d ' ' -f1) + log_error "$(gettext 'Can not use localhost as Redis server IP')" fi redis_port=$(get_config REDIS_PORT) read_from_input redis_port "$(gettext 'Please enter Redis server port')" "" "${redis_port}" @@ -118,33 +155,59 @@ function set_external_redis() { set_config REDIS_PASSWORD "${redis_password}" } +function set_external_redis_sentinel() { + redis_sentinel_hosts=$(get_config REDIS_SENTINEL_HOSTS) + read_from_input redis_sentinel_hosts "$(gettext 'Please enter Redis Sentinel hosts')" "" "${redis_sentinel_hosts}" + redis_sentinel_password=$(get_config REDIS_SENTINEL_PASSWORD) + read_from_input redis_sentinel_password "$(gettext 'Please enter Redis Sentinel password')" "" "${redis_sentinel_password}" + redis_password=$(get_config REDIS_PASSWORD) + read_from_input redis_password "$(gettext 'Please enter Redis password')" "" "${redis_password}" + + disable_config REDIS_HOST + disable_config REDIS_PORT + set_config REDIS_SENTINEL_HOSTS "${redis_sentinel_hosts}" + set_config REDIS_SENTINEL_PASSWORD "${redis_sentinel_password}" + set_config REDIS_PASSWORD "${redis_password}" +} + function set_internal_redis() { redis_password=$(get_config REDIS_PASSWORD) if [[ -z "${redis_password}" ]]; then REDIS_PASSWORD=$(random_str 26) set_config REDIS_PASSWORD "${REDIS_PASSWORD}" fi + disable_config REDIS_SENTINEL_HOSTS + disable_config REDIS_SENTINEL_PASSWORD set_config REDIS_HOST redis set_config REDIS_PORT 6379 } function set_redis() { echo_yellow "\n4. $(gettext 'Configure Redis')" - redis_sentinel_hosts=$(get_config REDIS_SENTINEL_HOSTS) - if [ -n "${redis_sentinel_hosts}" ]; then - return - fi - redis_host=$(get_config REDIS_HOST) - confirm="n" - if [[ "${redis_host}" != "redis" ]]; then - confirm="y" - fi - read_from_input confirm "$(gettext 'Do you want to use external Redis')?" "y/n" "${confirm}" - if [[ "${confirm}" == "y" ]]; then - set_external_redis - else - set_internal_redis - fi + redis_engine="redis" + read_from_input redis_engine "$(gettext 'Please enter Redis Engine')?" "redis/sentinel" "${redis_engine}" + + case "${redis_engine}" in + redis) + redis_host=$(get_config REDIS_HOST) + confirm="n" + if [[ "${redis_host}" != "redis" ]]; then + confirm="y" + fi + read_from_input confirm "$(gettext 'Do you want to use external Redis')?" "y/n" "${confirm}" + if [[ "${confirm}" == "y" ]]; then + set_external_redis + else + set_internal_redis + fi + ;; + sentinel) + set_external_redis_sentinel + ;; + *) + log_error "$(gettext 'Invalid Redis Engine selection')" + ;; + esac } function set_service() { @@ -183,7 +246,7 @@ function main() { if set_volume_dir; then echo_done fi - if set_mysql; then + if set_db; then echo_done fi if set_redis; then diff --git a/scripts/2_install_docker.sh b/scripts/2_install_docker.sh index 3d6b4051..894652b8 100755 --- a/scripts/2_install_docker.sh +++ b/scripts/2_install_docker.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/0_prepare.sh" @@ -46,23 +46,49 @@ function install_compose() { if [[ ! -f ./docker/docker-compose ]]; then prepare_compose_bin fi - old_docker_compose_md5=$(get_file_md5 /usr/local/bin/docker-compose) + old_docker_compose_md5=$(get_file_md5 /usr/local/libexec/docker/cli-plugins/docker-compose) new_docker_compose_md5=$(get_file_md5 ./docker/docker-compose) - if [[ ! -f "/usr/local/bin/docker-compose" || "${old_docker_compose_md5}" != "${new_docker_compose_md5}" ]]; then - \cp -f ./docker/docker-compose /usr/local/bin/ - chmod +x /usr/local/bin/docker-compose + if [[ ! -f "/usr/local/libexec/docker/cli-plugins/docker-compose" || "${old_docker_compose_md5}" != "${new_docker_compose_md5}" ]]; then + if [[ ! -d "/usr/local/libexec/docker/cli-plugins" ]]; then + mkdir -p /usr/local/libexec/docker/cli-plugins + fi + \cp -f ./docker/docker-compose /usr/local/libexec/docker/cli-plugins/ + chmod +x /usr/local/libexec/docker/cli-plugins/docker-compose + fi +} + +function install_compose_home() { + if [[ ! -f ./docker/docker-compose ]]; then + prepare_compose_bin + fi + old_docker_compose_md5=$(get_file_md5 $HOME/.docker/cli-plugins/docker-compose) + new_docker_compose_md5=$(get_file_md5 ./docker/docker-compose) + if [[ ! -f "$HOME/.docker/cli-plugins/docker-compose" || "${old_docker_compose_md5}" != "${new_docker_compose_md5}" ]]; then + if [[ ! -d "$HOME/.docker/cli-plugins" ]]; then + mkdir -p $HOME/.docker/cli-plugins + fi + \cp -f ./docker/docker-compose $HOME/.docker/cli-plugins/ + chmod +x $HOME/.docker/cli-plugins/docker-compose fi } function check_docker_install() { - command -v docker >/dev/null || { - install_docker + docker version &>/dev/null || { + if check_root; then + install_docker + else + log_warn "$(gettext 'Permission denied. pass...')" + fi } } function check_compose_install() { - command -v docker-compose >/dev/null || { - install_compose + docker compose version &>/dev/null || { + if check_root; then + install_compose + else + install_compose_home + fi } echo_done } @@ -71,11 +97,11 @@ function set_docker_config() { key=$1 value=$2 - if command -v python >/dev/null; then + if command -v python&>/dev/null; then docker_command=python - elif command -v python2 >/dev/null; then + elif command -v python2&>/dev/null; then docker_command=python2 - elif command -v python3 >/dev/null; then + elif command -v python3&>/dev/null; then docker_command=python3 else return @@ -137,20 +163,24 @@ function set_network() { } function check_docker_config() { - if [[ ! -f "/etc/docker/daemon.json" ]]; then - config_docker - set_network + if check_root; then + if [[ ! -f "/etc/docker/daemon.json" ]]; then + config_docker + set_network + fi + echo_done + else + log_warn "$(gettext 'Permission denied. pass...')" fi - echo_done } function start_docker() { - if command -v systemctl >/dev/null; then + if command -v systemctl&>/dev/null; then systemctl daemon-reload systemctl enable docker systemctl start docker fi - if ! docker ps >/dev/null 2>&1; then + if ! docker ps &>/dev/null; then echo_failed exit 1 fi @@ -158,13 +188,13 @@ function start_docker() { function check_docker_start() { prepare_set_redhat_firewalld - if ! docker ps >/dev/null 2>&1; then + if ! docker ps &>/dev/null; then start_docker fi } function check_docker_compose() { - if ! docker-compose version >/dev/null 2>&1; then + if ! docker compose version &>/dev/null; then echo_failed exit 1 fi @@ -184,4 +214,4 @@ function main() { if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then main -fi +fi \ No newline at end of file diff --git a/scripts/3_load_images.sh b/scripts/3_load_images.sh index 276a8854..7db94ae4 100755 --- a/scripts/3_load_images.sh +++ b/scripts/3_load_images.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" @@ -23,7 +23,7 @@ function load_image_files() { echo -n "${image} <= ${IMAGE_DIR}/${filename} " md5_filename=$(basename "${image}").md5 md5_path=${IMAGE_DIR}/${md5_filename} - image_id=$(docker inspect -f "{{.ID}}" "${image}" 2>/dev/null || echo "") + image_id=$(docker inspect -f "{{.ID}}" "${image}" 2&>/dev/null || echo "") saved_id="" if [[ -f "${md5_path}" ]]; then diff --git a/scripts/4_install_jumpserver.sh b/scripts/4_install_jumpserver.sh index c004ca82..12ee307b 100644 --- a/scripts/4_install_jumpserver.sh +++ b/scripts/4_install_jumpserver.sh @@ -1,16 +1,16 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" function pre_install() { if ! command -v systemctl &>/dev/null; then - command -v docker >/dev/null || { + docker version &>/dev/null || { log_error "$(gettext 'The current Linux system does not support systemd management. Please deploy docker by yourself before running this script again')" exit 1 } - command -v docker-compose >/dev/null || { + docker compose version &>/dev/null || { log_error "$(gettext 'The current Linux system does not support systemd management. Please deploy docker-compose by yourself before running this script again')" exit 1 } @@ -71,6 +71,7 @@ function main() { if ! bash "${BASE_DIR}/2_install_docker.sh"; then exit 1 fi + echo_green "\n>>> $(gettext 'Loading Docker Image')" if ! bash "${BASE_DIR}/3_load_images.sh"; then exit 1 diff --git a/scripts/5_db_backup.sh b/scripts/5_db_backup.sh index f2b8ef71..9c9ed005 100755 --- a/scripts/5_db_backup.sh +++ b/scripts/5_db_backup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" @@ -8,8 +8,9 @@ VOLUME_DIR=$(get_config VOLUME_DIR) BACKUP_DIR="${VOLUME_DIR}/db_backup" CURRENT_VERSION=$(get_config CURRENT_VERSION) -DATABASE=$(get_config DB_NAME) -DB_FILE=${BACKUP_DIR}/${DATABASE}-${CURRENT_VERSION}-$(date +%F_%T).sql +DB_ENGINE=$(get_config DB_ENGINE "mysql") +DB_HOST=$(get_config DB_HOST) +DB_NAME=$(get_config DB_NAME) function main() { if [[ ! -d ${BACKUP_DIR} ]]; then @@ -17,20 +18,36 @@ function main() { fi echo "$(gettext 'Backing up')..." - mysql_images=$(get_mysql_images) + db_images=$(get_db_images) - if ! docker ps | grep jms_ >/dev/null; then + if ! docker ps | grep jms_&>/dev/null; then create_db_ops_env flag=1 fi - if [[ "${HOST}" == "mysql" ]]; then - while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_mysql)" != "healthy" ]]; do - sleep 5s - done - fi + case "${DB_HOST}" in + mysql|postgresql) + while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_${DB_HOST})" != "healthy" ]]; do + sleep 5s + done + ;; + esac + + case "${DB_ENGINE}" in + mysql) + DB_FILE=${BACKUP_DIR}/${DB_NAME}-${CURRENT_VERSION}-$(date +%F_%T).sql + backup_cmd='mysqldump --skip-add-locks --skip-lock-tables --single-transaction -h$DB_HOST -P$DB_PORT -u$DB_USER -p"$DB_PASSWORD" $DB_NAME > '${DB_FILE} + ;; + postgresql) + DB_FILE=${BACKUP_DIR}/${DB_NAME}-${CURRENT_VERSION}-$(date +%F_%T).dump + backup_cmd='PGPASSWORD=${DB_PASSWORD} pg_dump --format=custom --no-owner -U $DB_USER -h $DB_HOST -p $DB_PORT -d "$DB_NAME" -f '${DB_FILE} + ;; + *) + log_error "$(gettext 'Invalid DB Engine selection')!" + exit 1 + ;; + esac - backup_cmd='mysqldump --skip-add-locks --skip-lock-tables --single-transaction -h$DB_HOST -P$DB_PORT -u$DB_USER -p"$DB_PASSWORD" $DB_NAME > '${DB_FILE} - if ! docker run --rm --env-file=${CONFIG_FILE} -i --network=jms_net -v "${BACKUP_DIR}:${BACKUP_DIR}" "${mysql_images}" bash -c "${backup_cmd}"; then + if ! docker run --rm --env-file=${CONFIG_FILE} -i --network=jms_net -v "${BACKUP_DIR}:${BACKUP_DIR}" "${db_images}" bash -c "${backup_cmd}"; then log_error "$(gettext 'Backup failed')!" log_error "$(gettext 'Backup failed')!" rm -f "${DB_FILE}" @@ -47,4 +64,4 @@ function main() { if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then main -fi +fi \ No newline at end of file diff --git a/scripts/6_db_restore.sh b/scripts/6_db_restore.sh index 22846a11..86389379 100755 --- a/scripts/6_db_restore.sh +++ b/scripts/6_db_restore.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" DB_FILE="$1" BACKUP_DIR=$(dirname "${DB_FILE}") +DB_ENGINE=$(get_config DB_ENGINE "mysql") +DB_HOST=$(get_config DB_HOST) +DB_NAME=$(get_config DB_NAME) + function main() { echo_warn "$(gettext 'Make sure you have a backup of data, this operation is not reversible')! \n" @@ -15,22 +19,36 @@ function main() { exit 1 fi - mysql_images=$(get_mysql_images) + db_images=$(get_db_images) echo "$(gettext 'Start restoring database'): $DB_FILE" - if ! docker ps | grep jms_ >/dev/null; then + if ! docker ps | grep jms_&>/dev/null; then create_db_ops_env flag=1 fi - if [[ "${HOST}" == "mysql" ]]; then - while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_mysql)" != "healthy" ]]; do - sleep 5s - done - fi + case "${DB_HOST}" in + mysql|postgresql) + while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_${DB_HOST})" != "healthy" ]]; do + sleep 5s + done + ;; + esac + + case "${DB_ENGINE}" in + mysql) + restore_cmd='mysql -h$DB_HOST -P$DB_PORT -u$DB_USER -p"$DB_PASSWORD" $DB_NAME < '${DB_FILE} + ;; + postgresql) + restore_cmd='PGPASSWORD=${DB_PASSWORD} pg_restore --if-exists --clean --no-owner -U $DB_USER -h $DB_HOST -p $DB_PORT -d $DB_NAME '${DB_FILE} + ;; + *) + log_error "$(gettext 'Invalid DB Engine selection')!" + exit 1 + ;; + esac - restore_cmd='mysql -h$DB_HOST -P$DB_PORT -u$DB_USER -p"$DB_PASSWORD" $DB_NAME < '${DB_FILE} - if ! docker run --rm --env-file=${CONFIG_FILE} -i --network=jms_net -v "${BACKUP_DIR}:${BACKUP_DIR}" "${mysql_images}" bash -c "${restore_cmd}"; then + if ! docker run --rm --env-file=${CONFIG_FILE} -i --network=jms_net -v "${BACKUP_DIR}:${BACKUP_DIR}" "${db_images}" bash -c "${restore_cmd}"; then log_error "$(gettext 'Database recovery failed. Please check whether the database file is complete or try to recover manually')!" exit 1 else @@ -53,4 +71,4 @@ if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then exit 1 fi main -fi +fi \ No newline at end of file diff --git a/scripts/7_upgrade.sh b/scripts/7_upgrade.sh index 573120d4..931bfe72 100644 --- a/scripts/7_upgrade.sh +++ b/scripts/7_upgrade.sh @@ -1,126 +1,55 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" . "${BASE_DIR}/2_install_docker.sh" target=$1 -function upgrade_config() { - # 如果配置文件有更新, 则添加到新的配置文件 - check_docker_start - if docker ps -a | grep jms_guacamole &>/dev/null; then - docker stop jms_guacamole &>/dev/null - docker rm jms_guacamole &>/dev/null - fi - if docker ps -a | grep jms_lina &>/dev/null; then - docker stop jms_lina &>/dev/null - docker rm jms_lina &>/dev/null - fi - if docker ps -a | grep jms_luna &>/dev/null; then - docker stop jms_luna &>/dev/null - docker rm jms_luna &>/dev/null - fi - if docker ps -a | grep jms_nginx &>/dev/null; then - docker stop jms_nginx &>/dev/null - docker rm jms_nginx &>/dev/null +function check_and_set_config() { + local config_key=$1 + local default_value=$2 + local current_value=$(get_config ${config_key}) + if [ -z "${current_value}" ]; then + set_config ${config_key} "${default_value}" fi +} + +function upgrade_config() { + if check_root; then + check_docker_start + fi + if ! docker ps &>/dev/null; then + log_error "$(gettext 'Docker is not running, please install and start')" + exit 1 + fi + local containers=("jms_guacamole" "jms_lina" "jms_luna" "jms_nginx" "jms_xpack" "jms_lb" "jms_omnidb") + for container in "${containers[@]}"; do + if docker ps -a | grep ${container} &>/dev/null; then + docker stop ${container} &>/dev/null + docker rm ${container} &>/dev/null + fi + done if docker ps -a | grep jms_xpack &>/dev/null; then - docker stop jms_xpack &>/dev/null - docker rm jms_xpack &>/dev/null docker volume rm jms_share-volume &>/dev/null fi - if docker ps -a | grep jms_xrdp &>/dev/null; then - docker stop jms_xrdp &>/dev/null - docker rm jms_xrdp &>/dev/null - fi - if docker ps -a | grep jms_lb &>/dev/null; then - 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}" - fi - client_max_body_size=$(get_config CLIENT_MAX_BODY_SIZE) - if [ -z "${client_max_body_size}" ]; then - CLIENT_MAX_BODY_SIZE=4096m - set_config CLIENT_MAX_BODY_SIZE "${CLIENT_MAX_BODY_SIZE}" - fi - server_hostname=$(get_config SERVER_HOSTNAME) - if [ -z "${server_hostname}" ]; then - SERVER_HOSTNAME="${HOSTNAME}" - set_config SERVER_HOSTNAME "${SERVER_HOSTNAME}" - fi - # 字体平滑 - font_smoothing=$(get_config JUMPSERVER_ENABLE_FONT_SMOOTHING) - if [ -z "${font_smoothing}" ]; then - set_config JUMPSERVER_ENABLE_FONT_SMOOTHING "true" - fi - if grep -q "server nginx" "${CONFIG_DIR}/nginx/lb_http_server.conf"; then - sed -i "s/server nginx/server web/g" "${CONFIG_DIR}/nginx/lb_http_server.conf" - fi - if grep -q "sticky name=jms_route;" "${CONFIG_DIR}/nginx/lb_http_server.conf"; then - sed -i "s/sticky name=jms_route;/ip_hash;/g" "${CONFIG_DIR}/nginx/lb_http_server.conf" - fi - # MAGNUS 数据库 - magnus_ports=$(get_config MAGNUS_PORTS) - if [ -n "${magnus_ports}" ]; then - sed -i "s/MAGNUS_PORTS/MAGNUS_ORACLE_PORTS/g" ${CONFIG_FILE} - fi - magnus_mysql_port=$(get_config MAGNUS_MYSQL_PORT) - if [ -z "${magnus_mysql_port}" ]; then - MAGNUS_MYSQL_PORT=33061 - set_config MAGNUS_MYSQL_PORT "${MAGNUS_MYSQL_PORT}" - fi - magnus_mariadb_port=$(get_config MAGNUS_MARIADB_PORT) - if [ -z "${magnus_mariadb_port}" ]; then - MAGNUS_MARIADB_PORT=33062 - set_config MAGNUS_MARIADB_PORT "${MAGNUS_MARIADB_PORT}" - fi - magnus_redis_port=$(get_config MAGNUS_REDIS_PORT) - if [ -z "${magnus_redis_port}" ]; then - MAGNUS_REDIS_PORT=63790 - set_config MAGNUS_REDIS_PORT "${MAGNUS_REDIS_PORT}" - fi - use_lb=$(get_config USE_LB) - if [ -z "${use_lb}" ]; then - USE_LB=1 - set_config USE_LB "${USE_LB}" - fi + check_and_set_config "CURRENT_VERSION" "${VERSION}" + check_and_set_config "CLIENT_MAX_BODY_SIZE" "4096m" + check_and_set_config "SERVER_HOSTNAME" "${HOSTNAME}" + check_and_set_config "JUMPSERVER_ENABLE_FONT_SMOOTHING" "true" + check_and_set_config "USE_LB" "1" # XPACK use_xpack=$(get_config_or_env USE_XPACK) if [[ "${use_xpack}" == "1" ]]; then - rdp_port=$(get_config RDP_PORT) - if [[ -z "${rdp_port}" ]]; then - RDP_PORT=3389 - set_config RDP_PORT "${RDP_PORT}" - fi - xrdp_port=$(get_config XRDP_PORT) - if [ -z "${xrdp_port}" ]; then - XRDP_PORT=3390 - set_config XRDP_PORT "${XRDP_PORT}" - fi - magnus_postgresql_port=$(get_config MAGNUS_POSTGRESQL_PORT) - if [ -z "${magnus_postgresql_port}" ]; then - MAGNUS_POSTGRESQL_PORT=54320 - set_config MAGNUS_POSTGRESQL_PORT "${MAGNUS_POSTGRESQL_PORT}" - fi - magnus_sqlserver_port=$(get_config MAGNUS_SQLSERVER_PORT) - if [ -z "${magnus_sqlserver_port}" ]; then - MAGNUS_SQLSERVER_PORT=14330 - set_config MAGNUS_SQLSERVER_PORT "${MAGNUS_SQLSERVER_PORT}" - fi - magnus_oracle_ports=$(get_config MAGNUS_ORACLE_PORTS) - if [ -z "${magnus_oracle_ports}" ]; then - MAGNUS_ORACLE_PORTS=30000-30030 - set_config MAGNUS_ORACLE_PORTS "${MAGNUS_ORACLE_PORTS}" - fi + check_and_set_config "RDP_PORT" "3389" + check_and_set_config "XRDP_PORT" "3390" + check_and_set_config "MAGNUS_MYSQL_PORT" "33061" + check_and_set_config "MAGNUS_MARIADB_PORT" "33062" + check_and_set_config "MAGNUS_REDIS_PORT" "63790" + check_and_set_config "MAGNUS_POSTGRESQL_PORT" "54320" + check_and_set_config "MAGNUS_SQLSERVER_PORT" "14330" + check_and_set_config "MAGNUS_ORACLE_PORTS" "30000-30030" fi } @@ -238,7 +167,7 @@ function backup_db() { } function db_migrations() { - if docker ps | grep -E "core|koko|lion" >/dev/null; then + if docker ps | grep -E "core|koko|lion"&>/dev/null; then confirm="y" read_from_input confirm "$(gettext 'Detected that the JumpServer container is running. Do you want to close the container and continue to upgrade')?" "y/n" "${confirm}" if [[ "${confirm}" == "y" ]]; then @@ -265,18 +194,20 @@ function db_migrations() { function clean_images() { current_version=$(get_config CURRENT_VERSION) if [[ "${current_version}" != "${to_version}" ]]; then - confirm="y" - read_from_input confirm "$(gettext 'Do you need to clean up the old version image')?" "y/n" "${confirm}" - if [[ "${confirm}" == "y" ]]; then - echo - docker images --format "{{.Repository}}:{{.Tag}}" | grep "jumpserver/" | grep "${current_version}" | xargs docker rmi -f + old_images=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep "jumpserver/" | grep "${current_version}") + if [[ -n "${old_images}" ]]; then + confirm="y" + read_from_input confirm "$(gettext 'Do you need to clean up the old version image')?" "y/n" "${confirm}" + if [[ "${confirm}" == "y" ]]; then + echo "${old_images}" | xargs docker rmi -f + fi fi fi } function upgrade_docker() { - if [[ -f "/usr/local/bin/docker" ]]; then - if [[ ! "$(/usr/local/bin/docker -v | grep ${DOCKER_VERSION})" ]]; then + if check_root && [[ -f "/usr/local/bin/docker" ]]; then + if ! /usr/local/bin/docker -v | grep ${DOCKER_VERSION} &>/dev/null; then echo -e "$(docker -v) \033[33m-->\033[0m Docker version \033[32m${DOCKER_VERSION}\033[0m" confirm="n" read_from_input confirm "$(gettext 'Do you need upgrade Docker binaries')?" "y/n" "${confirm}" @@ -294,17 +225,20 @@ function upgrade_docker() { fi fi fi - if [[ -f "/usr/local/bin/docker-compose" ]]; then - if [[ ! "$(/usr/local/bin/docker-compose version | grep ${DOCKER_COMPOSE_VERSION})" ]]; then +} + +function upgrade_compose() { + if check_root && [[ -f "/usr/local/libexec/docker/cli-plugins/docker-compose" || -f "$HOME/.docker/cli-plugins/docker-compose" ]]; then + if ! docker compose version | grep ${DOCKER_COMPOSE_VERSION} &>/dev/null; then echo - echo -e "$(docker-compose version) \033[33m-->\033[0m Docker Compose version \033[32m${DOCKER_COMPOSE_VERSION}\033[0m" + echo -e "$(docker compose version) \033[33m-->\033[0m Docker Compose version \033[32m${DOCKER_COMPOSE_VERSION}\033[0m" confirm="n" read_from_input confirm "$(gettext 'Do you need upgrade Docker Compose')?" "y/n" "${confirm}" if [[ "${confirm}" == "y" ]]; then echo cd "${BASE_DIR}" || exit 1 - install_compose check_compose_install + check_docker_compose fi fi fi @@ -347,6 +281,7 @@ function main() { echo_yellow "\n7. $(gettext 'Upgrade Docker')" upgrade_docker + upgrade_compose installation_log "upgrade" diff --git a/scripts/8_uninstall.sh b/scripts/8_uninstall.sh index e34246c3..6c431db1 100644 --- a/scripts/8_uninstall.sh +++ b/scripts/8_uninstall.sh @@ -1,27 +1,85 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" +function stop_services() { + docker compose version &>/dev/null || return + if [ -f "${CONFIG_FILE}" ]; then + cd "${PROJECT_DIR?}" || exit 1 + bash ./jmsctl.sh down + sleep 2s + echo + fi +} + +function remove_jmsctl() { + if check_root && [ -f "/usr/bin/jmsctl" ]; then + echo -e "$(gettext 'Cleaning up') /usr/bin/jmsctl" + rm -f /usr/bin/jmsctl + fi +} + +function remove_docker() { + if check_root && [ -f "/etc/systemd/system/docker.service" ]; then + echo + confirm="n" + read_from_input confirm "$(gettext 'Do you need to clean up the Docker binaries')?" "y/n" "${confirm}" + if [[ "${confirm}" == "y" ]]; then + systemctl stop docker + systemctl disable docker + systemctl daemon-reload + echo -e "$(gettext 'Cleaning up') /usr/local/bin/docker" + rm -f /usr/local/bin/docker* + rm -f /usr/local/bin/container* + rm -f /usr/local/bin/ctr + rm -f /usr/local/bin/runc + echo -e "$(gettext 'Cleaning up') /etc/systemd/system/docker.service" + rm -f /etc/systemd/system/docker.service + fi + fi +} + +function remove_compose() { + if check_root && [ -f "/usr/local/libexec/docker/cli-plugins/docker-compose" ]; then + echo + confirm="n" + read_from_input confirm "$(gettext 'Do you need to clean up the Docker Compose binaries')?" "y/n" "${confirm}" + if [[ "${confirm}" == "y" ]]; then + echo -e "$(gettext 'Cleaning up') /usr/local/libexec/docker/cli-plugins/docker-compose" + rm -f /usr/local/libexec/docker/cli-plugins/docker-compose + fi + fi + if [ -f "$HOME/.docker/cli-plugins/docker-compose" ]; then + echo + confirm="n" + read_from_input confirm "$(gettext 'Do you need to clean up the Docker Compose binaries')?" "y/n" "${confirm}" + if [[ "${confirm}" == "y" ]]; then + echo -e "$(gettext 'Cleaning up') $HOME/.docker/cli-plugins/docker-compose" + rm -f $HOME/.docker/cli-plugins/docker-compose + fi + fi +} + function remove_jumpserver() { + if [ ! -f "${CONFIG_FILE}" ]; then + return + fi + echo echo_warn "$(gettext 'Make sure you have a backup of data, this operation is not reversible')! \n" images=$(get_images) volume_dir=$(get_config VOLUME_DIR) confirm="n" read_from_input confirm "$(gettext 'Are you clean up JumpServer files')?" "y/n" "${confirm}" if [[ "${confirm}" == "y" ]]; then - if [[ -f "${CONFIG_FILE}" ]]; then - cd "${PROJECT_DIR}" || exit 1 - bash ./jmsctl.sh down - sleep 2s - echo + if [[ -d "${volume_dir}" ]]; then echo -e "$(gettext 'Cleaning up') ${volume_dir}" - rm -rf "${volume_dir}" + rm -rf "${volume_dir?}" + fi + if [[ -d "${CONFIG_DIR}" ]]; then echo -e "$(gettext 'Cleaning up') ${CONFIG_DIR}" - rm -rf "${CONFIG_DIR}" - echo -e "$(gettext 'Cleaning up') /usr/bin/jmsctl" - rm -f /usr/bin/jmsctl + rm -rf "${CONFIG_DIR?}" rm -f .env compose/.env fi fi @@ -34,35 +92,17 @@ function remove_jumpserver() { echo done fi - if [ -f "/etc/systemd/system/docker.service" ]; then - echo - confirm="n" - read_from_input confirm "$(gettext 'Do you need to clean up the Docker binaries')?" "y/n" "${confirm}" - if [[ "${confirm}" == "y" ]]; then - systemctl stop docker - systemctl disable docker - systemctl daemon-reload - echo -e "$(gettext 'Cleaning up') /usr/local/bin/docker" - rm -f /usr/local/bin/docker* - rm -f /usr/local/bin/container* - rm -f /usr/local/bin/ctr - rm -f /usr/local/bin/runc - echo -e "$(gettext 'Cleaning up') /etc/systemd/system/docker.service" - rm -f /etc/systemd/system/docker.service - fi - echo - fi - 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 echo_green "$(gettext 'Cleanup complete')!" } function main() { echo_yellow "\n>>> $(gettext 'Uninstall JumpServer')" - remove_jumpserver + stop_services installation_log "uninstall" + remove_jmsctl + remove_jumpserver + remove_compose + remove_docker } -main +main \ No newline at end of file diff --git a/scripts/const.sh b/scripts/const.sh index a91fbe83..3e11d075 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" export SCRIPT_DIR="$BASE_DIR" PROJECT_DIR=$(dirname "${SCRIPT_DIR}") diff --git a/scripts/utils.sh b/scripts/utils.sh index 396215fe..efc8ba21 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -1,10 +1,14 @@ #!/usr/bin/env bash # -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/const.sh" +function check_root() { + [[ "$(id -u)" == 0 ]] +} + function is_confirm() { read -r confirmed if [[ "${confirmed}" == "y" || "${confirmed}" == "Y" || ${confirmed} == "" ]]; then @@ -20,7 +24,7 @@ function random_str() { len=24 fi uuid="" - if command -v dmidecode &>/dev/null; then + if check_root && command -v dmidecode &>/dev/null; then if [[ ${len} -gt 24 ]]; then uuid=$(dmidecode -t 1 | grep UUID | awk '{print $2}' | sha256sum | awk '{print $1}' | head -c ${len}) fi @@ -94,43 +98,70 @@ function set_config() { sed -i "s,^[ \t]*${key}=.*$,${key}=${value},g" "${CONFIG_FILE}" } -function check_mysql_data() { +function disable_config() { + key=$1 + + has=$(has_config "${key}") + if [[ ${has} == "1" ]]; then + sed -i "s,^[ \t]*${key}=.*$,# ${key}=,g" "${CONFIG_FILE}" + fi +} + +function check_db_data() { + db_type=$1 if [[ ! -f "${CONFIG_FILE}" ]]; then return fi volume_dir=$(get_config VOLUME_DIR) db_name=$(get_config DB_NAME) - if [[ -d "${volume_dir}/mysql/data/${db_name}" ]]; then + if [[ -d "${volume_dir}/${db_type}/data/${db_name}" ]]; then echo "1" fi } -function get_mysql_images() { - mysql_data_exists=$(check_mysql_data) - if [[ "${mysql_data_exists}" == "1" ]]; then - mysql_images=jumpserver/mysql:5.7 - else - mysql_images=jumpserver/mariadb:10.6 - fi - echo "${mysql_images}" +function get_db_info() { + info_type=$1 + mysql_data_exists=$(check_db_data "mysql") + mariadb_data_exists=$(check_db_data "mariadb") + + case "${info_type}" in + "image") + if [[ "${mysql_data_exists}" == "1" ]]; then + echo "mysql:5.7" + elif [[ "${mariadb_data_exists}" == "1" ]]; then + echo "mariadb:10.6" + else + echo "postgres:16.2-bullseye" + fi + ;; + "file") + if [[ "${mysql_data_exists}" == "1" ]]; then + echo "compose/mysql.yml" + elif [[ "${mariadb_data_exists}" == "1" ]]; then + echo "compose/mariadb.yml" + else + echo "compose/postgres.yml" + fi + ;; + *) + exit 1 ;; + esac } -function get_mysql_images_file() { - mysql_data_exists=$(check_mysql_data) - if [[ "${mysql_data_exists}" == "1" ]]; then - mysql_images_file=compose/mysql.yml - else - mysql_images_file=compose/mariadb.yml - fi - echo "${mysql_images_file}" +function get_db_images() { + get_db_info "image" +} + +function get_db_images_file() { + get_db_info "file" } function get_images() { use_xpack=$(get_config_or_env USE_XPACK) - mysql_images=$(get_mysql_images) + db_images=$(get_db_images) images=( - "jumpserver/redis:6.2" - "${mysql_images}" + "redis:7.0-bullseye" + "${db_images}" ) for image in "${images[@]}"; do echo "${image}" @@ -243,71 +274,43 @@ function log_error() { function get_docker_compose_services() { ignore_db="$1" - core_enabled=$(get_config CORE_ENABLED) - celery_enabled=$(get_config CELERY_ENABLED) - koko_enabled=$(get_config KOKO_ENABLED) - lion_enabled=$(get_config LION_ENABLED) - chen_enabled=$(get_config CHEN_ENABLED) - web_enabled=$(get_config WEB_ENABLED) - services="core celery koko lion chen web" - if [[ "${core_enabled}" == "0" ]]; then - services="${services//core/}" - fi - if [[ "${celery_enabled}" == "0" ]]; then - services="${services//celery/}" - fi - if [[ "${koko_enabled}" == "0" ]]; then - services="${services//koko/}" - fi - if [[ "${lion_enabled}" == "0" ]]; then - services="${services//lion/}" - fi - if [[ "${chen_enabled}" == "0" ]]; then - services="${services//chen/}" - fi - if [[ "${web_enabled}" == "0" ]]; then - services="${services//web/}" - fi - mysql_host=$(get_config DB_HOST) - if [[ "${mysql_host}" == "mysql" && "${ignore_db}" != "ignore_db" ]]; then - services+=" mysql" - fi + db_engine=$(get_config DB_ENGINE "mysql") + db_host=$(get_config DB_HOST) redis_host=$(get_config REDIS_HOST) - if [[ "${redis_host}" == "redis" && "${ignore_db}" != "ignore_db" ]]; then - services+=" redis" - fi use_es=$(get_config USE_ES) - if [[ "${use_es}" == "1" ]]; then - services+=" es" - fi use_minio=$(get_config USE_MINIO) - if [[ "${use_minio}" == "1" ]]; then - services+=" minio" - fi use_xpack=$(get_config_or_env USE_XPACK) + + services="core celery koko lion chen web" + + if [[ "${ignore_db}" != "ignore_db" ]]; then + case "${db_engine}" in + mysql) + [[ "${db_host}" == "mysql" ]] && services+=" mysql" + ;; + postgresql) + [[ "${db_host}" == "postgresql" ]] && services+=" postgresql" + ;; + esac + [[ "${redis_host}" == "redis" ]] && services+=" redis" + fi + + for service in core celery koko lion chen web; do + enabled=$(get_config "${service^^}_ENABLED") + [[ "${enabled}" == "0" ]] && services="${services//${service}/}" + done + + [[ "${use_es}" == "1" ]] && services+=" es" + [[ "${use_minio}" == "1" ]] && services+=" minio" + if [[ "${use_xpack}" == "1" ]]; then services+=" magnus razor xrdp video panda" - magnus_enabled=$(get_config MAGNUS_ENABLED) - razor_enabled=$(get_config RAZOR_ENABLED) - xrdp_enabled=$(get_config XRDP_ENABLED) - video_enabled=$(get_config VIDEO_ENABLED) - panda_enabled=$(get_config PANDA_ENABLED) - if [[ "${magnus_enabled}" == "0" ]]; then - services="${services//magnus/}" - fi - if [[ "${razor_enabled}" == "0" ]]; then - services="${services//razor/}" - fi - if [[ "${xrdp_enabled}" == "0" ]]; then - services="${services//xrdp/}" - fi - if [[ "${video_enabled}" == "0" ]]; then - services="${services//video/}" - fi - if [[ "${panda_enabled}" == "0" ]]; then - services="${services//panda/}" - fi + for service in magnus razor xrdp video panda; do + enabled=$(get_config "${service^^}_ENABLED") + [[ "${enabled}" == "0" ]] && services="${services//${service}/}" + done fi + echo "${services}" } @@ -316,64 +319,47 @@ function get_docker_compose_cmd_line() { use_ipv6=$(get_config USE_IPV6) use_xpack=$(get_config_or_env USE_XPACK) https_port=$(get_config HTTPS_PORT) - mysql_images_file=$(get_mysql_images_file) - cmd="docker-compose" + db_images_file=$(get_db_images_file) + cmd="docker compose" if [[ "${use_ipv6}" != "1" ]]; then cmd+=" -f compose/network.yml" else cmd+=" -f compose/network-v6.yml" fi services=$(get_docker_compose_services "$ignore_db") - if [[ "${services}" =~ core ]]; then - cmd+=" -f compose/core.yml" - fi - if [[ "${services}" =~ celery ]]; then - cmd+=" -f compose/celery.yml" - fi - if [[ "${services}" =~ koko ]]; then - cmd+=" -f compose/koko.yml" - fi - if [[ "${services}" =~ lion ]]; then - cmd+=" -f compose/lion.yml" - fi - if [[ "${services}" =~ chen ]]; then - cmd+=" -f compose/chen.yml" - fi - if [[ "${services}" =~ web ]]; then - cmd+=" -f compose/web.yml" - fi - if [[ "${services}" =~ mysql ]]; then - cmd+=" -f ${mysql_images_file}" - fi - if [[ "${services}" =~ redis ]]; then - cmd+=" -f compose/redis.yml" + + for service in core celery koko lion chen web redis; do + if [[ "${services}" =~ ${service} ]]; then + cmd+=" -f compose/${service}.yml" + fi + done + + if [[ "${services}" =~ "mysql" || "${services}" =~ "postgresql" ]]; then + cmd+=" -f ${db_images_file}" fi - if [[ "${services}" =~ es ]]; then + + use_es=$(get_config USE_ES) + if [[ "${use_es}" == "1" ]]; then cmd+=" -f compose/es.yml" fi - if [[ "${services}" =~ minio ]]; then + + use_minio=$(get_config USE_MINIO) + if [[ "${use_minio}" == "1" ]]; then cmd+=" -f compose/minio.yml" fi + if [[ -n "${https_port}" ]]; then cmd+=" -f compose/lb.yml" fi + if [[ "${use_xpack}" == '1' ]]; then - if [[ "${services}" =~ magnus ]]; then - cmd+=" -f compose/magnus.yml" - fi - if [[ "${services}" =~ razor ]]; then - cmd+=" -f compose/razor.yml" - fi - if [[ "${services}" =~ xrdp ]]; then - cmd+=" -f compose/xrdp.yml" - fi - if [[ "${services}" =~ video ]]; then - cmd+=" -f compose/video.yml" - fi - if [[ "${services}" =~ panda ]]; then - cmd+=" -f compose/panda.yml" - fi + for service in magnus razor xrdp video panda; do + if [[ "${services}" =~ ${service} ]]; then + cmd+=" -f compose/${service}.yml" + fi + done fi + echo "${cmd}" } @@ -383,7 +369,7 @@ function get_video_worker_cmd_line() { return fi use_ipv6=$(get_config USE_IPV6) - cmd="docker-compose" + cmd="docker compose" if [[ "${use_ipv6}" != "1" ]]; then cmd+=" -f compose/network.yml" else @@ -395,7 +381,7 @@ function get_video_worker_cmd_line() { function prepare_check_required_pkg() { for i in curl wget tar iptables gettext; do - command -v $i >/dev/null || { + command -v $i &>/dev/null || { echo_red "$i: $(gettext 'command not found, Please install it first') $i" flag=1 } @@ -408,10 +394,10 @@ function prepare_check_required_pkg() { } function prepare_set_redhat_firewalld() { - if command -v firewall-cmd >/dev/null; then - if firewall-cmd --state >/dev/null 2>&1; then + if command -v firewall-cmd&>/dev/null; then + if firewall-cmd --state &>/dev/null; then docker_subnet=$(get_config DOCKER_SUBNET) - if ! firewall-cmd --list-rich-rule | grep "${docker_subnet}" >/dev/null; then + if ! firewall-cmd --list-rich-rule | grep "${docker_subnet}"&>/dev/null; then firewall-cmd --zone=public --add-rich-rule="rule family=ipv4 source address=${docker_subnet} accept" >/dev/null firewall-cmd --permanent --zone=public --add-rich-rule="rule family=ipv4 source address=${docker_subnet} accept" >/dev/null fi @@ -421,7 +407,7 @@ function prepare_set_redhat_firewalld() { function prepare_config() { cd "${PROJECT_DIR}" || exit 1 - if [[ "$OS" != 'Darwin' ]];then + if check_root; then echo -e "#!/usr/bin/env bash\n#" > /usr/bin/jmsctl echo -e "cd ${PROJECT_DIR}" >> /usr/bin/jmsctl echo -e './jmsctl.sh $@' >> /usr/bin/jmsctl @@ -523,15 +509,15 @@ function image_has_prefix() { } function get_db_migrate_compose_cmd() { - mysql_host=$(get_config DB_HOST) + db_host=$(get_config DB_HOST) redis_host=$(get_config REDIS_HOST) use_ipv6=$(get_config USE_IPV6) use_xpack=$(get_config_or_env USE_XPACK) - cmd="docker-compose -f compose/init-db.yml" - if [[ "${mysql_host}" == "mysql" ]]; then - mysql_images_file=$(get_mysql_images_file) - cmd+=" -f ${mysql_images_file}" + cmd="docker compose -f compose/init-db.yml" + if [[ "${db_host}" == "mysql" ]] || [[ "${db_host}" == "postgresql" ]]; then + db_images_file=$(get_db_images_file) + cmd+=" -f ${db_images_file}" fi if [[ "${redis_host}" == "redis" ]]; then cmd+=" -f compose/redis.yml" @@ -557,15 +543,18 @@ function down_db_ops_env() { } function perform_db_migrations() { - mysql_host=$(get_config DB_HOST) + db_host=$(get_config DB_HOST) redis_host=$(get_config REDIS_HOST) create_db_ops_env - if [[ "${mysql_host}" == "mysql" ]]; then - while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_mysql)" != "healthy" ]]; do - sleep 5s - done - fi + case "${db_host}" in + mysql|postgresql) + while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_${db_host})" != "healthy" ]]; do + sleep 5s + done + ;; + esac + if [[ "${redis_host}" == "redis" ]]; then while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_redis)" != "healthy" ]]; do sleep 5s @@ -609,7 +598,7 @@ function pull_image() { IMAGE_PULL_POLICY=$(get_config_or_env 'IMAGE_PULL_POLICY') - if docker image inspect -f '{{ .Id }}' "$image" &> /dev/null; then + if docker image inspect -f '{{ .Id }}' "$image" &>/dev/null; then exits=0 else exits=1 @@ -636,12 +625,12 @@ function check_images() { failed=0 for image in ${images_to}; do - if ! docker image inspect -f '{{ .Id }}' "$image" &> /dev/null; then + if ! docker image inspect -f '{{ .Id }}' "$image" &>/dev/null; then pull_image "$image" fi done for image in ${images_to}; do - if ! docker image inspect -f '{{ .Id }}' "$image" &> /dev/null; then + if ! docker image inspect -f '{{ .Id }}' "$image" &>/dev/null; then echo_red "$(gettext 'Failed to pull image') ${image}" failed=1 fi @@ -677,11 +666,11 @@ function installation_log() { install_type=$1 version=$(get_current_version) url="https://community.fit2cloud.com/installation-analytics?product=${product}&type=${install_type}&version=${version}" - curl --connect-timeout 5 -m 10 -k $url > /dev/null 2>&1 + curl --connect-timeout 5 -m 10 -k $url &>/dev/null } function get_host_ip() { - host=$(command -v ip &> /dev/null && ip addr | grep 'state UP' -A2 | grep inet | grep -Ev '(127.0.0.1|inet6|docker)' | awk '{print $2}' | tr -d "addr:" | head -n 1 | cut -d / -f1) + host=$(command -v ip &>/dev/null && ip addr | grep 'state UP' -A2 | grep inet | grep -Ev '(127.0.0.1|inet6|docker)' | awk '{print $2}' | tr -d "addr:" | head -n 1 | cut -d / -f1) if [ ! "${host}" ]; then host=$(hostname -I | cut -d ' ' -f1) fi From 77ac29c8ac461b756ffc85755c335f32d79be9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 29 Apr 2024 17:27:08 +0800 Subject: [PATCH 08/36] =?UTF-8?q?feat:=20=E8=A7=A3=E5=86=B3=20dev=20?= =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/docker-compose-receptor-xpack.yml | 3 - compose/docker-compose-web-xpack.yml | 5 - ...cker-compose-receptor.yml => receptor.yml} | 0 locale/en/LC_MESSAGES/jumpserver-installer.po | 252 ++++++-- .../zh_CN/LC_MESSAGES/jumpserver-installer.mo | Bin 11291 -> 13834 bytes .../zh_CN/LC_MESSAGES/jumpserver-installer.po | 271 +++++--- .../LC_MESSAGES/jumpserver-installer.mo | Bin 12892 -> 13227 bytes .../LC_MESSAGES/jumpserver-installer.po | 582 ++++++++++-------- 8 files changed, 690 insertions(+), 423 deletions(-) delete mode 100644 compose/docker-compose-receptor-xpack.yml delete mode 100644 compose/docker-compose-web-xpack.yml rename compose/{docker-compose-receptor.yml => receptor.yml} (100%) diff --git a/compose/docker-compose-receptor-xpack.yml b/compose/docker-compose-receptor-xpack.yml deleted file mode 100644 index 3871685c..00000000 --- a/compose/docker-compose-receptor-xpack.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - receptor: - image: ${REGISTRY:-docker.io}/jumpserver/core-ee:${VERSION} diff --git a/compose/docker-compose-web-xpack.yml b/compose/docker-compose-web-xpack.yml deleted file mode 100644 index cd763965..00000000 --- a/compose/docker-compose-web-xpack.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - web: - environment: - USE_XPACK: ${USE_XPACK:-0} - RAZOR_ENABLED: ${RAZOR_ENABLED:-1} \ No newline at end of file diff --git a/compose/docker-compose-receptor.yml b/compose/receptor.yml similarity index 100% rename from compose/docker-compose-receptor.yml rename to compose/receptor.yml diff --git a/locale/en/LC_MESSAGES/jumpserver-installer.po b/locale/en/LC_MESSAGES/jumpserver-installer.po index e4c31ec7..c46f8c03 100644 --- a/locale/en/LC_MESSAGES/jumpserver-installer.po +++ b/locale/en/LC_MESSAGES/jumpserver-installer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-29 12:19+0800\n" +"POT-Creation-Date: 2024-04-29 17:11+0800\n" "PO-Revision-Date: 2021-01-21 19:15+0800\n" "Last-Translator: Bai \n" "Language-Team: Language locale/en/LC\n" @@ -40,7 +40,7 @@ msgstr "" msgid "Using Docker Compose cache" msgstr "" -#: scripts/0_prepare.sh:55 +#: scripts/0_prepare.sh:55 scripts/7_upgrade.sh:24 msgid "Docker is not running, please install and start" msgstr "" @@ -193,7 +193,7 @@ msgstr "" msgid "Init JumpServer Database" msgstr "" -#: scripts/1_config_jumpserver.sh:237 scripts/7_upgrade.sh:256 +#: scripts/1_config_jumpserver.sh:237 scripts/7_upgrade.sh:185 #: scripts/utils.sh:565 msgid "Failed to change the table structure" msgstr "" @@ -230,7 +230,7 @@ msgstr "" msgid "Docker image loaded, skipping" msgstr "" -#: scripts/6_db_restore.sh:15 scripts/8_uninstall.sh:62 +#: scripts/6_db_restore.sh:15 scripts/8_uninstall.sh:70 msgid "Make sure you have a backup of data, this operation is not reversible" msgstr "" @@ -260,107 +260,231 @@ msgstr "" msgid "The backup file does not exist" msgstr "" -#: scripts/7_upgrade.sh:223 +#: scripts/7_upgrade.sh:152 msgid "Back up to" msgstr "" -#: scripts/7_upgrade.sh:230 +#: scripts/7_upgrade.sh:159 msgid "Failed to backup the database. Continue to upgrade" msgstr "" -#: scripts/7_upgrade.sh:236 +#: scripts/7_upgrade.sh:165 msgid "Skip database backup" msgstr "" -#: scripts/7_upgrade.sh:243 +#: scripts/7_upgrade.sh:172 msgid "" "Detected that the JumpServer container is running. Do you want to close the " "container and continue to upgrade" msgstr "" -#: scripts/7_upgrade.sh:258 +#: scripts/7_upgrade.sh:187 msgid "Failed to change the table structure. Continue to upgrade" msgstr "" -#: scripts/7_upgrade.sh:271 +#: scripts/7_upgrade.sh:200 msgid "Do you need to clean up the old version image" msgstr "" -#: scripts/7_upgrade.sh:284 +#: scripts/7_upgrade.sh:213 msgid "Do you need upgrade Docker binaries" msgstr "" -#: scripts/7_upgrade.sh:308 +#: scripts/7_upgrade.sh:236 msgid "Do you need upgrade Docker Compose" msgstr "" -#: scripts/7_upgrade.sh:326 +#: scripts/7_upgrade.sh:254 msgid "Are you sure you want to update the current version to" msgstr "" -#: scripts/7_upgrade.sh:338 scripts/4_install_jumpserver.sh:75 +#: scripts/7_upgrade.sh:266 scripts/4_install_jumpserver.sh:75 msgid "Loading Docker Image" msgstr "" -#: scripts/7_upgrade.sh:341 jmsctl.sh:62 +#: scripts/7_upgrade.sh:269 jmsctl.sh:60 msgid "Backup database" msgstr "" -#: scripts/7_upgrade.sh:344 +#: scripts/7_upgrade.sh:272 msgid "Backup Configuration File" msgstr "" -#: scripts/7_upgrade.sh:347 +#: scripts/7_upgrade.sh:275 msgid "Apply database changes" msgstr "" -#: scripts/7_upgrade.sh:348 +#: scripts/7_upgrade.sh:276 msgid "Changing database schema may take a while, please wait patiently" msgstr "" -#: scripts/7_upgrade.sh:351 +#: scripts/7_upgrade.sh:279 msgid "Cleanup Image" msgstr "" -#: scripts/7_upgrade.sh:354 +#: scripts/7_upgrade.sh:282 msgid "Upgrade Docker" msgstr "" -#: scripts/7_upgrade.sh:360 +#: scripts/7_upgrade.sh:288 msgid "Upgrade successfully. You can now restart the program" msgstr "" -#: scripts/8_uninstall.sh:18 scripts/8_uninstall.sh:32 -#: scripts/8_uninstall.sh:37 scripts/8_uninstall.sh:45 -#: scripts/8_uninstall.sh:54 scripts/8_uninstall.sh:69 -#: scripts/8_uninstall.sh:73 +#: scripts/8_uninstall.sh:19 scripts/8_uninstall.sh:33 +#: scripts/8_uninstall.sh:38 scripts/8_uninstall.sh:50 +#: scripts/8_uninstall.sh:59 scripts/8_uninstall.sh:77 +#: scripts/8_uninstall.sh:81 msgid "Cleaning up" msgstr "" -#: scripts/8_uninstall.sh:27 +#: scripts/8_uninstall.sh:28 msgid "Do you need to clean up the Docker binaries" msgstr "" -#: scripts/8_uninstall.sh:43 scripts/8_uninstall.sh:52 +#: scripts/8_uninstall.sh:48 scripts/8_uninstall.sh:57 msgid "Do you need to clean up the Docker Compose binaries" msgstr "" -#: scripts/8_uninstall.sh:66 +#: scripts/8_uninstall.sh:74 msgid "Are you clean up JumpServer files" msgstr "" -#: scripts/8_uninstall.sh:80 +#: scripts/8_uninstall.sh:88 msgid "Do you need to clean up the Docker image" msgstr "" -#: scripts/8_uninstall.sh:87 +#: scripts/8_uninstall.sh:95 msgid "Cleanup complete" msgstr "" -#: scripts/8_uninstall.sh:91 jmsctl.sh:58 +#: scripts/8_uninstall.sh:99 jmsctl.sh:56 msgid "Uninstall JumpServer" msgstr "" +#: scripts/config.sh:16 +msgid "Configuration ntp sync" +msgstr "" + +#: scripts/config.sh:17 +msgid "Initialize configuration file" +msgstr "" + +#: scripts/config.sh:18 +msgid "Configuration service port" +msgstr "" + +#: scripts/config.sh:19 +msgid "Configuration web ssl" +msgstr "" + +#: scripts/config.sh:20 +msgid "Configuration jumpserver environment" +msgstr "" + +#: scripts/config.sh:35 +msgid "Do you want to restart the service" +msgstr "" + +#: scripts/config.sh:43 +msgid "ntpdate is not installed, please install it first" +msgstr "" + +#: scripts/config.sh:47 +msgid "Please enter NTP SERVER" +msgstr "" + +#: scripts/config.sh:63 scripts/config.sh:121 +msgid "Please enter HTTP PORT" +msgstr "" + +#: scripts/config.sh:66 scripts/config.sh:122 +msgid "Please enter HTTPS PORT" +msgstr "" + +#: scripts/config.sh:72 +msgid "Please enter SSH PORT" +msgstr "" + +#: scripts/config.sh:77 +msgid "Please enter MAGNUS MYSQL PORT" +msgstr "" + +#: scripts/config.sh:80 +msgid "Please enter MAGNUS MARIADB PORT" +msgstr "" + +#: scripts/config.sh:83 +msgid "Please enter MAGNUS REDIS PORT" +msgstr "" + +#: scripts/config.sh:86 +msgid "Please enter MAGNUS POSTGRESQL PORT" +msgstr "" + +#: scripts/config.sh:89 +msgid "Please enter MAGNUS SQLSERVER PORT" +msgstr "" + +#: scripts/config.sh:95 +msgid "Please enter XRDP PORT" +msgstr "" + +#: scripts/config.sh:100 +msgid "Please enter RAZOR PORT" +msgstr "" + +#: scripts/config.sh:105 +msgid "Please enter MAGNUS ORACLE PORTS" +msgstr "" + +#: scripts/config.sh:123 +msgid "Please enter SERVER NAME" +msgstr "" + +#: scripts/config.sh:132 +msgid "Please enter SSL CERTIFICATE FILE Absolute path" +msgstr "" + +#: scripts/config.sh:134 +msgid "SSL CERTIFICATE FILE not exists" +msgstr "" + +#: scripts/config.sh:140 +msgid "Please enter SSL CERTIFICATE KEY FILE Absolute path" +msgstr "" + +#: scripts/config.sh:142 +msgid "SSL CERTIFICATE KEY FILE not exists" +msgstr "" + +#: scripts/config.sh:160 +msgid "Please enter the environment variable key" +msgstr "" + +#: scripts/config.sh:169 +msgid "Please enter the environment variable value" +msgstr "" + +#: scripts/config.sh:172 +msgid "The operation changes are as follows" +msgstr "" + +#: scripts/config.sh:177 +msgid "Do you want to update the environment variable" +msgstr "" + +#: scripts/config.sh:184 +msgid "The environment variable has not changed" +msgstr "" + +#: scripts/config.sh:189 +msgid "Do you want to continue to add environment variables" +msgstr "" + +#: scripts/config.sh:199 jmsctl.sh:15 +msgid "Configuration file not found" +msgstr "" + #: scripts/utils.sh:198 msgid "no default" msgstr "" @@ -469,90 +593,82 @@ msgstr "" msgid "Backup succeeded! The backup file has been saved to" msgstr "" -#: scripts/0_prepare.sh:16 -msgid "Download docker fails, check the network is normal" +#: jmsctl.sh:16 +msgid "If you are upgrading from v1.5.x, please copy the config.txt To" msgstr "" -#: scripts/0_prepare.sh:21 -msgid "Using Docker cache" +#: jmsctl.sh:21 +msgid "There is a problem with the soft connection, Please update it again" msgstr "" -#: scripts/0_prepare.sh:36 -msgid "Starting to download Docker Compose binary" +#: jmsctl.sh:40 +msgid "JumpServer Deployment Management Script" msgstr "" -#: scripts/0_prepare.sh:38 -msgid "Download docker-compose fails, check the network is normal" +#: jmsctl.sh:47 +msgid "Install JumpServer" msgstr "" -#: scripts/0_prepare.sh:43 -msgid "Using Docker Compose cache" +#: jmsctl.sh:50 +msgid "Configuration Tools" msgstr "" -#: scripts/0_prepare.sh:55 -msgid "Docker is not running, please install and start" +#: jmsctl.sh:51 +msgid "Start JumpServer" msgstr "" -#: scripts/0_prepare.sh:81 -msgid "The image has been saved, skipping" +#: jmsctl.sh:52 +msgid "Stop JumpServer" msgstr "" -#: scripts/0_prepare.sh:85 -msgid "Save image" +#: jmsctl.sh:53 +msgid "Restart JumpServer" msgstr "" -#: scripts/0_prepare.sh:95 -msgid "Preparing Docker offline package" +#: jmsctl.sh:54 +msgid "Check JumpServer" msgstr "" #: jmsctl.sh:55 -msgid "Restart JumpServer" +msgid "Offline JumpServer" msgstr "" -#: jmsctl.sh:56 -msgid "Check JumpServer" -msgstr "" - -#: jmsctl.sh:57 -msgid "Offline JumpServer" -msgstr "" - -#: jmsctl.sh:61 +#: jmsctl.sh:59 msgid "Loading docker image" msgstr "" -#: jmsctl.sh:63 +#: jmsctl.sh:61 msgid "Data recovery through database backup file" msgstr "" -#: jmsctl.sh:64 +#: jmsctl.sh:62 msgid "Execute the original docker compose command" msgstr "" -#: jmsctl.sh:65 +#: jmsctl.sh:63 msgid "View log" msgstr "" -#: jmsctl.sh:120 +#: jmsctl.sh:118 msgid "The current version is up to date" msgstr "" -#: jmsctl.sh:125 +#: jmsctl.sh:123 msgid "The latest version is" msgstr "" -#: jmsctl.sh:129 +#: jmsctl.sh:127 msgid "The current version is" msgstr "" -#: jmsctl.sh:174 jmsctl.sh:180 +#: jmsctl.sh:172 jmsctl.sh:178 msgid "Unsupported Operating System Error" msgstr "" -#: jmsctl.sh:175 +#: jmsctl.sh:173 msgid "macOS installer please see" msgstr "" -#: jmsctl.sh:181 +#: jmsctl.sh:179 msgid "Windows installer please see" msgstr "" diff --git a/locale/zh_CN/LC_MESSAGES/jumpserver-installer.mo b/locale/zh_CN/LC_MESSAGES/jumpserver-installer.mo index 1d9c9964f7c36263794b2926588d424e540cf368..59fcfb4d7376975eca68e82984c9af548a25b209 100644 GIT binary patch delta 5621 zcmai%3vg7`8OKiozIbRP2_cAbc?t3`f>K4K5|c>6E4YbNM2idAgw|@4Sr#f1dn*@t?>a^2Vr`q3t?+t8XplA5+@7(kJ zzVCeJWN5l)b0GThfZjU{Wgi-XMqXshCvbcpekh0f8#53-2ZzDe;g8^FP(!jWcQ_Je z^PK~)fJKlYW&ykrR=`oP366np!0EKXe2UftpLjIYO zD;<`>Wqen|Joq`3hocAJ1Y8K^VI7%uZDgo&+A|g+~cH5xos%z~_+DGbvfd;G9W=I+_vCg43ZK@T1egl;Q8GML2PzKF}GPnXV#MDCm znLXLWUlyKlJKlphWxj;iVtTWR1&2U+FwOnG59$n8yY2g+j_`G;d7r!d7HXq(Hqp^d zfQooA)V`4@zp}6qYJ488;E+LlB0M;~@8k3yYw6O;jmpl-t(P@bKEns5bHvbGrsWpFM(1kpSI>)>CY z3|z{t@;C~08}>o1^EQ-YUqT`gHN7n78jXRg=?Fk=^aa#}@1c@xIIB&D6CqJG6;MgH z9$pG}KzX(Y%E0H~t?<|IVwl2Wa_Ca1@i)RtWcqDXdee{(m5fDD8{7}I;0ibqZh*5> zjClddgH+7dSq|by5t{}tgY%&x`2duG%b?zuwQhSO)OFqsbJ*X!NktFEKj1BJIPWBH zidhH~3qUQn)@6gsr(GU|GT<20ymwuG0yY2dP!a6St}-MY>U|giqZ%-giag4P`o0%x z!(~wSb(P!y3+UndgxlYjPK_G`^Wi8s6+Q^@#TUd<t8DE3){C%jSY=cwa zps~cC<1`*J1E)+iR3w_AuFFxVh`bM{!_!b6kLAwIhBrg?Z-konBvfb*LmfpcR8GAM zW#Fe!k@ydkVHwf!jwj=w7ASJL$YnLuZP?;+FI0}a0Qv+zq9!Zqydwm`b(h}sD$K`X@H7Q91;}sC&=lT z)EuXM9MlmMLmky}sQEjfJUZ!~mGls$(sPAI;+wZa->ZqQBIBk9p zW#E6^{%j6dj!c0H`9dg15kE4f>a)aBGD0BHOMM1PY(c&bnjs@Eie>tbaHR#7^7J2}w_)wM3pJc#0Ai3PehcZ|ZQc)ySE^%NUb-5ZAp#o$fUDsh~KGF@TMV%#a{`$DJvjy&S z>&o)m(NB@iuMXv+g-99S3n{_wM0scfx)iA>FMgJ&IXR&#Ito?0Z42NE6usPS=na>+ zbq`d6sZ^l)M9oP?RqsW*!%v{is0Qsri%=m_DRbaF&(xP9o|eS_9n>`qZP)p8OU%RQ zE~I4B-6Zi72?mT`Ka?jOB%a+g>QmisK@ZK{C>>2i$tBbMSeDcnpuPu%b^bG{>~=e! zg8Iv)@)&vq-K>wKvX=Tr#Cv1zLlLAh9;KotvDH`y{v|%E zGE|k-eadp*Vk;aD#INaJ*sE|!C>Zevt9@1^WO>WVl6SIdyj6bh;(#w~@ zt8;LHr|b5f+DZJeJ*9>9kZ)zzUC%qR#v7>i znR!*dN^&w-Vdcjz&bnp3lZBQwlbceKxGAPbKXt==EBxU|_y_%G{W>=$=Fhq=)|gcv z&lDff z8$2`RDlToAm$3VtRs2C52?Ts)yAwPS-ZHzjCB) zXWgmR7u$~RYiq8zw?Edt?RmE&*?(uKrDwrz+}d_{f9K@p27B|q_FuNx+n?#2*7*?3 z8oE98ruNo@?X8E~j`T0Sjt~&m^o+C51)eM;XfScya(qWbGM$ZbFadA2I^^W zy6mS8+0D<}yVoXd<-8BcQ)B%{pNO6_dTxb3xFYdZ`>GZNy~})-z4qm#1!fh`Dz@}; zB(IUwuWQxOvhLJN2b?TyZ{2OTywq{L#eQ{TkHgvzt~(uleE$VUC!UL*H%!iwQzs6$ zKfN*WSe$jJhkoaYuqTd!bBkqJYUM<2O;=QN)n?z{eJ+iyGyc!#oOADU&pH2l?tR!% zw{NlU%Fv*8L)k_|6InsV*jU=156buuV@6;Sj=>z9ipy~T?sa_)BWWMQ!FU!2;kTH9 zH!uOC269cz#T;XNrk2W3Iy!J9eu$dLMdUl?chrUS5eA`1mx*=T6Hx=t#L-xS!?6`L zkzF_e_hT%c!D_sLVT^BzLj4ym!_^#Ei+OkzHS>6`l8hy&nQz5O_$FrJC5*!`W*3hc z7=OHrBGh&t~e>Utlc7W6%O@o(inmP&Mle*#&knU$b+cP%n$)8h8;K&A9$ z)WC0`HrFSpJ#ZWK{UIFGfMZbu=Av$O8MfgM$Q;Z{AJf*1r7rLavN-c8Y7<_<4LF+g zXd?Sj=bb>^!%ozI*Dw?RME=Y~maYCds3&;|YC#pKiPhr_^zEe5m&$3>O3tCaa2NZb zhqHMlm|)aB4@C_Shq~ZQEbtgJ7d7#A?w3;Efh^Koz+k+E%3L>UVoD1Sj?aWs(Sdl> zW0Hn?8cI-)SsPBnlgP$5x6!!(_f73^)b|ryC%a}N1DFET(^QK3UM*^(8=SV!7>kN7 za2U1AZPW?hVKM&d9-r;?pEn<8)4vSw$AhR9UqzB&g1Dc`&=}P9vM>!-AW1dtsPj%> zgpbO3DoRxsk{xr;ZO3q<*-vIF>UbgQg4L+a^8#vxhcO-B!RdGt`7?36jg--R)Pm}e zKeL4oW#TaUa;UsVMH%=D3$P!{(FqGtsjEh%x&^fd+E5eQhgzwPn$UUF0gQfNdos@_qKr!P2hFR#*?U({ec>|56e&nB2W`cL!~eeH9#4%ElevqDMpfL zPPpx_+~app6AdMedX*=PBmYWOAsswvW-Z3zPPg5GTIpw~fiAo4Zq&p=xQZqogE~F| z)t`gPT(R3cSR!@epbvr``Te^p`wlNp!=j!=6wGDV+mak6UzuqK!xNuKh^qi(fxde zP^lvN5u1sJh@PT7Q%*1!Q%B4p9wg#>rlH41=`A37iqcf*HXcVdwUgpWsFi8e+JxH( z_NlXxi*Oa8qTA5lsTmW1%BsqJgff&vIO9Kpv(=yk5_tsKa$Xu4IEB!?N+s43#Y6?M zl2DoF$N8*w>&;k6EO6Tk@lm3Lm`h|4>|x`3mXDc)msmuoXv1uDYW$Pns>kvvx86e{ zmC3{kg8k&|i>L81qKQz^Q>CK4)aumy?~ovW-Dm2l=$A~dQk8+kET`uGm=F0xCNY(G zl1L$1h#Ep=9Z^a=KxnglUOZa}l}4h02%EGdZF|owh}6v z2)$fXYKa;4p+V1ktjxg)Q7bDeR(Y!$8oe!RR+KkaHhJf@tX{LAvaz+Y(ONusik%#m z9cXg#w1yLV%qG;(Yrj>`PgZ8vNzPzzh_W8Wy~UveKPLLfUtv`x(*!b{Y_s& ziXEBwT!8h{_@Q=m()s}VX!7v@>s0CyYiW9VV%LkuZ*AXw}6B diff --git a/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po b/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po index cbe63f3d..27dee36d 100644 --- a/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po +++ b/locale/zh_CN/LC_MESSAGES/jumpserver-installer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-29 12:19+0800\n" +"POT-Creation-Date: 2024-04-29 17:11+0800\n" "PO-Revision-Date: 2021-01-21 19:15+0800\n" "Last-Translator: Bai \n" "Language-Team: Language locale/zh\n" @@ -40,7 +40,7 @@ msgstr "下载 docker-compose 失败, 请检查网络是否正常" msgid "Using Docker Compose cache" msgstr "使用 Docker Compose 缓存文件" -#: scripts/0_prepare.sh:55 +#: scripts/0_prepare.sh:55 scripts/7_upgrade.sh:24 msgid "Docker is not running, please install and start" msgstr "Docker 没有运行, 请安装并启动" @@ -193,7 +193,7 @@ msgstr "JumpServer rdp 端口" msgid "Init JumpServer Database" msgstr "初始化数据库" -#: scripts/1_config_jumpserver.sh:237 scripts/7_upgrade.sh:256 +#: scripts/1_config_jumpserver.sh:237 scripts/7_upgrade.sh:185 #: scripts/utils.sh:565 msgid "Failed to change the table structure" msgstr "表结构变更失败" @@ -230,7 +230,7 @@ msgstr "镜像文件没有发现" msgid "Docker image loaded, skipping" msgstr "镜像已加载, 跳过" -#: scripts/6_db_restore.sh:15 scripts/8_uninstall.sh:62 +#: scripts/6_db_restore.sh:15 scripts/8_uninstall.sh:70 msgid "Make sure you have a backup of data, this operation is not reversible" msgstr "请确认已经备份好相关数据, 此操作不可逆" @@ -260,107 +260,231 @@ msgstr "格式错误" msgid "The backup file does not exist" msgstr "备份文件不存在" -#: scripts/7_upgrade.sh:223 +#: scripts/7_upgrade.sh:152 msgid "Back up to" msgstr "备份至" -#: scripts/7_upgrade.sh:230 +#: scripts/7_upgrade.sh:159 msgid "Failed to backup the database. Continue to upgrade" msgstr "备份数据库失败, 继续升级吗" -#: scripts/7_upgrade.sh:236 +#: scripts/7_upgrade.sh:165 msgid "Skip database backup" msgstr "跳过备份数据库" -#: scripts/7_upgrade.sh:243 +#: scripts/7_upgrade.sh:172 msgid "" "Detected that the JumpServer container is running. Do you want to close the " "container and continue to upgrade" msgstr "检测到 JumpServer 正在运行, 是否需要关闭并继续升级" -#: scripts/7_upgrade.sh:258 +#: scripts/7_upgrade.sh:187 msgid "Failed to change the table structure. Continue to upgrade" msgstr "表结构变更失败, 是否继续" -#: scripts/7_upgrade.sh:271 +#: scripts/7_upgrade.sh:200 msgid "Do you need to clean up the old version image" msgstr "是否需要清理旧版本镜像文件" -#: scripts/7_upgrade.sh:284 +#: scripts/7_upgrade.sh:213 msgid "Do you need upgrade Docker binaries" msgstr "是否升级 Docker binaries" -#: scripts/7_upgrade.sh:308 +#: scripts/7_upgrade.sh:236 msgid "Do you need upgrade Docker Compose" msgstr "是否升级 Docker Compose" -#: scripts/7_upgrade.sh:326 +#: scripts/7_upgrade.sh:254 msgid "Are you sure you want to update the current version to" msgstr "是否将版本更新至" -#: scripts/7_upgrade.sh:338 scripts/4_install_jumpserver.sh:75 +#: scripts/7_upgrade.sh:266 scripts/4_install_jumpserver.sh:75 msgid "Loading Docker Image" msgstr "加载 Docker 镜像" -#: scripts/7_upgrade.sh:341 jmsctl.sh:62 +#: scripts/7_upgrade.sh:269 jmsctl.sh:60 msgid "Backup database" msgstr "备份数据库" -#: scripts/7_upgrade.sh:344 +#: scripts/7_upgrade.sh:272 msgid "Backup Configuration File" msgstr "备份配置文件" -#: scripts/7_upgrade.sh:347 +#: scripts/7_upgrade.sh:275 msgid "Apply database changes" msgstr "进行数据库变更" -#: scripts/7_upgrade.sh:348 +#: scripts/7_upgrade.sh:276 msgid "Changing database schema may take a while, please wait patiently" msgstr "表结构变更可能需要一段时间, 请耐心等待" -#: scripts/7_upgrade.sh:351 +#: scripts/7_upgrade.sh:279 msgid "Cleanup Image" msgstr "清理镜像" -#: scripts/7_upgrade.sh:354 +#: scripts/7_upgrade.sh:282 msgid "Upgrade Docker" msgstr "升级 Docker" -#: scripts/7_upgrade.sh:360 +#: scripts/7_upgrade.sh:288 msgid "Upgrade successfully. You can now restart the program" msgstr "升级成功, 可以重新启动程序了" -#: scripts/8_uninstall.sh:18 scripts/8_uninstall.sh:32 -#: scripts/8_uninstall.sh:37 scripts/8_uninstall.sh:45 -#: scripts/8_uninstall.sh:54 scripts/8_uninstall.sh:69 -#: scripts/8_uninstall.sh:73 +#: scripts/8_uninstall.sh:19 scripts/8_uninstall.sh:33 +#: scripts/8_uninstall.sh:38 scripts/8_uninstall.sh:50 +#: scripts/8_uninstall.sh:59 scripts/8_uninstall.sh:77 +#: scripts/8_uninstall.sh:81 msgid "Cleaning up" msgstr "正在清理" -#: scripts/8_uninstall.sh:27 +#: scripts/8_uninstall.sh:28 msgid "Do you need to clean up the Docker binaries" msgstr "是否清理 Docker binaries" -#: scripts/8_uninstall.sh:43 scripts/8_uninstall.sh:52 +#: scripts/8_uninstall.sh:48 scripts/8_uninstall.sh:57 msgid "Do you need to clean up the Docker Compose binaries" msgstr "是否清理 Docker Compose binaries" -#: scripts/8_uninstall.sh:66 +#: scripts/8_uninstall.sh:74 msgid "Are you clean up JumpServer files" msgstr "确认清理 JumpServer 相关文件" -#: scripts/8_uninstall.sh:80 +#: scripts/8_uninstall.sh:88 msgid "Do you need to clean up the Docker image" msgstr "是否清理 Docker 镜像" -#: scripts/8_uninstall.sh:87 +#: scripts/8_uninstall.sh:95 msgid "Cleanup complete" msgstr "清理完成" -#: scripts/8_uninstall.sh:91 jmsctl.sh:58 +#: scripts/8_uninstall.sh:99 jmsctl.sh:56 msgid "Uninstall JumpServer" msgstr "卸载 JumpServer" +#: scripts/config.sh:16 +msgid "Configuration ntp sync" +msgstr "配置 ntp 同步" + +#: scripts/config.sh:17 +msgid "Initialize configuration file" +msgstr "初始化配置文件" + +#: scripts/config.sh:18 +msgid "Configuration service port" +msgstr "配置服务端口" + +#: scripts/config.sh:19 +msgid "Configuration web ssl" +msgstr "配置 web ssl" + +#: scripts/config.sh:20 +msgid "Configuration jumpserver environment" +msgstr "配置 JumpServer" + +#: scripts/config.sh:35 +msgid "Do you want to restart the service" +msgstr "是否需要重启服务" + +#: scripts/config.sh:43 +msgid "ntpdate is not installed, please install it first" +msgstr "ntpdate 没有安装, 请先安装" + +#: scripts/config.sh:47 +msgid "Please enter NTP SERVER" +msgstr "请输入 NTP 服务器地址" + +#: scripts/config.sh:63 scripts/config.sh:121 +msgid "Please enter HTTP PORT" +msgstr "请输入 HTTP 服务端口" + +#: scripts/config.sh:66 scripts/config.sh:122 +msgid "Please enter HTTPS PORT" +msgstr "请输入 HTTPS 服务端口" + +#: scripts/config.sh:72 +msgid "Please enter SSH PORT" +msgstr "请输入 KOKO SSH 服务端口" + +#: scripts/config.sh:77 +msgid "Please enter MAGNUS MYSQL PORT" +msgstr "请输入 MAGNUS MYSQL 服务端口" + +#: scripts/config.sh:80 +msgid "Please enter MAGNUS MARIADB PORT" +msgstr "请输入 MAGNUS MARIADB 服务端口" + +#: scripts/config.sh:83 +msgid "Please enter MAGNUS REDIS PORT" +msgstr "请输入 MAGNUS REDIS 服务端口" + +#: scripts/config.sh:86 +msgid "Please enter MAGNUS POSTGRESQL PORT" +msgstr "请输入 MAGNUS POSTGRESQL 服务端口" + +#: scripts/config.sh:89 +msgid "Please enter MAGNUS SQLSERVER PORT" +msgstr "请输入 MAGNUS SQLSERVER 服务端口" + +#: scripts/config.sh:95 +msgid "Please enter XRDP PORT" +msgstr "请输入 XRDP 服务端口" + +#: scripts/config.sh:100 +msgid "Please enter RAZOR PORT" +msgstr "请输入 RAZOR 服务端口" + +#: scripts/config.sh:105 +msgid "Please enter MAGNUS ORACLE PORTS" +msgstr "请输入 MAGNUS ORACLE 服务端口范围" + +#: scripts/config.sh:123 +msgid "Please enter SERVER NAME" +msgstr "请输入 Nginx server_name 值" + +#: scripts/config.sh:132 +msgid "Please enter SSL CERTIFICATE FILE Absolute path" +msgstr "请输入 SSL 证书文件绝对路径" + +#: scripts/config.sh:134 +msgid "SSL CERTIFICATE FILE not exists" +msgstr "SSL 证书文件不存在" + +#: scripts/config.sh:140 +msgid "Please enter SSL CERTIFICATE KEY FILE Absolute path" +msgstr "请输入 SSL 证书私钥文件绝对路径" + +#: scripts/config.sh:142 +msgid "SSL CERTIFICATE KEY FILE not exists" +msgstr "SSL 证书私钥文件不存在" + +#: scripts/config.sh:160 +msgid "Please enter the environment variable key" +msgstr "请输入配置文件中的 key" + +#: scripts/config.sh:169 +msgid "Please enter the environment variable value" +msgstr "请输入配置文件中的 value" + +#: scripts/config.sh:172 +msgid "The operation changes are as follows" +msgstr "操作变更如下" + +#: scripts/config.sh:177 +msgid "Do you want to update the environment variable" +msgstr "是否需要继续添加或修改配置" + +#: scripts/config.sh:184 +msgid "The environment variable has not changed" +msgstr "配置没有变更" + +#: scripts/config.sh:189 +msgid "Do you want to continue to add environment variables" +msgstr "是否需要继续添加或修改配置" + +#: scripts/config.sh:199 jmsctl.sh:15 +msgid "Configuration file not found" +msgstr "配置文件没有发现" + #: scripts/utils.sh:198 msgid "no default" msgstr "无默认值" @@ -472,97 +596,86 @@ msgstr "备份失败" msgid "Backup succeeded! The backup file has been saved to" msgstr "备份成功! 备份文件已存放至" -#: scripts/0_prepare.sh:16 -msgid "Download docker fails, check the network is normal" -msgstr "下载 docker 失败, 请检查网络是否正常" - -#: scripts/0_prepare.sh:21 -msgid "Using Docker cache" -msgstr "使用 Docker 缓存文件" +#: jmsctl.sh:16 +msgid "If you are upgrading from v1.5.x, please copy the config.txt To" +msgstr "如果你是从 v1.5.x 升级的, 请 copy 之前目录中的 config.txt 到" -#: scripts/0_prepare.sh:36 -msgid "Starting to download Docker Compose binary" -msgstr "开始下载 Docker Compose 程序" +#: jmsctl.sh:21 +msgid "There is a problem with the soft connection, Please update it again" +msgstr "软连接存在问题, 重新更新" -#: scripts/0_prepare.sh:38 -msgid "Download docker-compose fails, check the network is normal" -msgstr "下载 docker-compose 失败, 请检查网络是否正常" - -#: scripts/0_prepare.sh:43 -msgid "Using Docker Compose cache" -msgstr "使用 Docker Compose 缓存文件" +#: jmsctl.sh:40 +msgid "JumpServer Deployment Management Script" +msgstr "JumpServer 部署管理脚本" -#: scripts/0_prepare.sh:55 -msgid "Docker is not running, please install and start" -msgstr "Docker 没有运行, 请安装并启动" +#: jmsctl.sh:47 +msgid "Install JumpServer" +msgstr "安装 JumpServer" -#: scripts/0_prepare.sh:81 -msgid "The image has been saved, skipping" -msgstr "已保存过该镜像, 跳过" +#: jmsctl.sh:50 +msgid "Configuration Tools" +msgstr "配置工具" -#: scripts/0_prepare.sh:85 -msgid "Save image" -msgstr "保存镜像" +#: jmsctl.sh:51 +msgid "Start JumpServer" +msgstr "启动 JumpServer" -#: scripts/0_prepare.sh:95 -msgid "Preparing Docker offline package" -msgstr "准备 Docker 离线包" +#: jmsctl.sh:52 +msgid "Stop JumpServer" +msgstr "停止 JumpServer" -#: jmsctl.sh:55 -msgid "Restart JumpServer" +#: jmsctl.sh:53 +msgid "Restart JumpServer" msgstr "重启 JumpServer" -#: jmsctl.sh:56 -msgid "Check JumpServer" +#: jmsctl.sh:54 +msgid "Check JumpServer" msgstr "检查 JumpServer" -#: jmsctl.sh:57 -msgid "Offline JumpServer" +#: jmsctl.sh:55 +msgid "Offline JumpServer" msgstr "下线 JumpServer" -#: jmsctl.sh:61 +#: jmsctl.sh:59 msgid "Loading docker image" msgstr "加载 Docker 镜像" -#: jmsctl.sh:63 +#: jmsctl.sh:61 msgid "Data recovery through database backup file" msgstr "通过数据库备份文件恢复数据" -#: jmsctl.sh:64 +#: jmsctl.sh:62 msgid "Execute the original docker compose command" msgstr "执行原始 docker compose 命令" -#: jmsctl.sh:65 +#: jmsctl.sh:63 msgid "View log" msgstr "查看日志" -#: jmsctl.sh:120 +#: jmsctl.sh:118 msgid "The current version is up to date" msgstr "当前版本已是最新" -#: jmsctl.sh:125 +#: jmsctl.sh:123 msgid "The latest version is" msgstr "最新版本是" -#: jmsctl.sh:129 +#: jmsctl.sh:127 msgid "The current version is" msgstr "当前版本是" -#: jmsctl.sh:174 jmsctl.sh:180 +#: jmsctl.sh:172 jmsctl.sh:178 msgid "Unsupported Operating System Error" msgstr "错误: 不支持的操作系统" -#: jmsctl.sh:175 +#: jmsctl.sh:173 msgid "macOS installer please see" msgstr "macOS 安装请参考" -#: jmsctl.sh:181 +#: jmsctl.sh:179 msgid "Windows installer please see" msgstr "Windows 安装请参考" -#~ msgid "Close JumpServer" -#~ msgstr "关闭 JumpServer" - #~ msgid "Please enter the access IP or domain name of JumpServer" #~ msgstr "请输入 JumpServer 的访问 IP 或者 域名" diff --git a/locale/zh_Hant/LC_MESSAGES/jumpserver-installer.mo b/locale/zh_Hant/LC_MESSAGES/jumpserver-installer.mo index e6418045706b08e2961dfe2510f7858b984c6089..c983ac591425d1760147681182022b507e4dc883 100644 GIT binary patch delta 3770 zcmZwJe@vBC9LMoms)+{s7`amRc7zFg441 zlti~|m5rnyvpb8>Z2i+}^h3+$)|%CdAIqARt@UfG_vhY2t=1Xe=XIXvInQ&>`JVG! z{j9RxA3Q%KdcUC@A}%L>iZg>ImY8o>ppaIei)PRb>z>y z%b@_zVG#}*Y|JoRfa%5rjhD(GE^I9B6Z{DJk!G&+pj|n`j7t~vua0BNpSd7srkr|cZc+R)r zSZu>wJcCp4PaKU?h8Qyjm*ZsIg1UYTN7BDJOJxFnk4kaIP-C)iHtKv0j>282nYZCY zeA8aPh{{|d>B`5EI0F}=2DsB+KaR>^A5Ovn zPS(w6WUM9+wKOH@K`&ReRor8t4VoXP88(bdHsOz`_s1}Ly)P5< zFbA)91&vunMKd_U@HB%HsFZzy`VssUmC7jctzDmt{8X4RsOtr&&$S4zLqDqH=TPlC zQSIKheroN-6#6$mQBj96^v-XF$*|_3Ix0q`Y>7RuKz;9Zs16!Y6L9SL^QaC_qCUrW z?foB6Usvo^k^3t#sD^$jC0LKs@O7lE`4N@+G^VE%PDZ`(Ce$z8Mr8k)BdB(7+56`) zJRutEtI0qO^cvLlGGtqs)!D4SE^M_8584K=Ab+NdgErqKR3_rtd0M*>I2{)tt7Dpx zKF#x}Oq@oNYI;x|$Mb0w;V9IESK$I&cQyG}gAOj}!7fy4zeFv?Mbuil*lC(cDr%;= zsOQS8w_9sbyM4R$04k#|qB`!uLcD~UP(hH7T^$soGI0y)#kHsbZAYcJ)p{J+ujUM@ z{Uy{=CFDfT^H4ubWvI+lq6c@NGTMf$syS`12Y;rb7o@SET9cXR!IhYSn^7-3WIb-L ze~4O|i}pNbLL@U;sHG@IUTxN*-t&a@HPi&oAsG#tU#V!ODH9`^$VPQ|E$YFgn1Bta zcH2-HJAjG!g1z2}n(=AWX1#=JH+WJc)uU0*=VJwy;#&RGwc7^6*;z_y7HSC!Q5h-6 zB&@a98&R9f!Q1gQOu^LrNanIp11m+gk6DHqSR-l=J%gIi35=(I^NzjoF)C#jFb2~L zA_K@kozKF7SYpo?q6W4UH8UUT#hXzbK7=mRde0_Usc^Z0V-2A!sDHDK(5}`7d6?)g zWbp4Y#n#k8f6>O=XirE&_-A-G-es?mSQ8*LDfVf2zkq4dfx;&o45w}%CsPTfzlc!r z5VKUF+(O(-L=krrD#;PT$3+~M*>i2?{lp=Az7Dk?N{MQM?G`TO99L-mPf*E-Tnn$8 z*1V3mlV~Qk5-JZ7n~0lrLRmu0Aub~t2$fjkCc;k?651yZ5;KYZvVqDff}a3$|8foo ziM@o%5aNMwEpoUA93qprk!U1F6Do6w$;5rcCX@yr4Dmx>D zkHs9dd$dKb2wySgQEVlyCuR_pgvtQov2cz5BwDY<9k$+2G?m)^6LlSLPg<-?F^fng z%7_wz-)Q3_`b#|(ZS%GL7f|2XE@B?Bm{7TfxRn@6q!D|F!Gy|oV!8ewl22v6u27~C zRm3AYp{yi^5qA&^h&99kVm+baB?>~HB+MA#n&U(zO%2UY>UPBz*KDY*3HY4cl-$sS zlvA$QMKytXf1NM%-jE`f%M(f*b}(vs$sA9mx87Uf4fs6O-VHvpXuVH$Uv<5&&coeW zZy>O-rmph8H=NJY(+8Byah`II7(}y%fUi!^hg#F3T~5AxYRuefe^s^5sdW#FTf*C@ zuXp_JQK2>NY4HR5LOXg|TDv>joz^j9Lm!M;;TqrjbZ6huJv|*wy?dKIB{i$p(Z8L7 zr=qIbTUX@^m`I~g?o})PnNCgC<(kgJ*>O>`|9)@p!3Vqd?&)niX8PK9_nqwMZaVU> zdoMTlK7I0k?m2sN+>`&+^6*pt(~Q@D{l=TU``Y>%nN1P`s+vRjJej zW3;teHD=Qz^=NFY))^X45h^PhQ7j~3pX z<+>FSxZ6-FiT1>IfyUI})=+*ZwPD7z!tXH_A7F2cXkttw%(hOzHXKjKa4bXq%qD(P zu@W=zGPc05rp81W<1(>S8q<)Dx?wmr!wIMh3s3`Fj-9a*HK5bj7HhC2)}!tVq<0OZ zC2Anu`RRazQP)kg?MpF{{!KZR7*3qPLcE50P#=C|7C-ZGA`Zce_!2g5ZcG>KgUL7p z({LMh#Piq*?_w`(9N}xvz;+zxV>kLYE-FgxaqD%A=J*k6rp+Rm1ty@{b5WTp!JfDd z)A3W(z#iK6Xws*Q!yVOkM_KB(f%EJgTE2B&%jKG8VHJwG5MyE=%o4n*DX z8tVGRs0VLDZZXG@B$x}RrMii!7{=%|;0)}Fxu_*tgHAl=qN2@r6_u)bdmKP-nn5Sj zYc>LPew?)swR9^{1K5O#cmOriE2!%qpavYoj|SWkwdXRi0$t~*XoT4;cr4C9?dr9t z2OUMt>?&$A{epT6LV4OM9EIxWGV1ytQF|tUS*2kFGAEOT+C%x+5SJkna~T&E#$YyM zI(~@3_!DYIzoKqv;WQ=$qmgfvi9>C+L{tZZP??&DDL4yH%2*Vm z4OK2us3?{FQ6tPkJ^^O3ZJ&qn9GBuCtVVTw3w8Y?)crxMmyEE+Ag{hjLUlOE9_L!; zVmSSq6;zb6EvWap3iaT_s0W@x&EOl`e#^E$M7@50+w<{EZyd)1Q1@-O?!%!Re}sLp z9+mNgIP$O54W*(7O-FsnDv*6+K0#ghtvz3lnn^3tp|_(uYM>)f?USs<_WV|Rd=T~g zGpM~*hsyBNc=E5c3gc`)9E4=klp@!d_fa$d3Yny-MRoWTGccT;s+s2CNSul~e*|^k z8B|7VP)l(ewRDeB6A0-_{x!oGUQXROz&gg7huYmG*3GCCR--zu#lcvIno%4(Rvo0F zGLnsYZXRktCANJF@`*49T~svVv*^Uz$mC1|z7k~HB%<1LkYzKAQ3KwCdVmLG@Cqum zzoVWPnB@C}C!mw#VW{h8qpn|#y56JqLs0SyZI_!rI)VdE= zJE4+I%p+zHDsK~7IxX8q!e2laQX;@x^Zhh~XUTZ3sL)FIHC1s zUzz1Z4zYo76ETE}mQ5*NKujdo68c9+TWSPPTRN!^;y!3m_@uy=yR1%_{$M1IcBE%T z_ydQhy7^g$r##Z>a3p&UwWtbke;xIg@4P!Rs=cjEk7}Liy~kNxuw+@m5@&Xf$tfzB zSzO>OSg@4i|D0U3aLLmDIqg0k)!KckO>a++wtXA9OFPE~`)>2>>^#E}eCNFrbvr)r zM8{8bcy=WOX*g9~8U}dMlfoPW=9d*OE^^+jD!=EcxU*+(-4{pAy`x+1o&LOT{UPVG xlXWLH+&ysm#WU_($?c+_UsJvR#S5J74oT7O;mKL<E^+md5F0o@J<{R{W7mOuai diff --git a/locale/zh_Hant/LC_MESSAGES/jumpserver-installer.po b/locale/zh_Hant/LC_MESSAGES/jumpserver-installer.po index e94bf98f..ccffdd30 100644 --- a/locale/zh_Hant/LC_MESSAGES/jumpserver-installer.po +++ b/locale/zh_Hant/LC_MESSAGES/jumpserver-installer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-09 18:25+0800\n" +"POT-Creation-Date: 2024-04-29 17:07+0800\n" "PO-Revision-Date: 2024-04-09 18:25+0800\n" "Last-Translator: 小冯 \n" "Language-Team: Language locale/zh\n" @@ -16,104 +16,49 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: scripts/5_db_backup.sh:18 -msgid "Backing up" -msgstr "正在備份" - -#: scripts/5_db_backup.sh:34 scripts/5_db_backup.sh:35 -msgid "Backup failed" -msgstr "備份失敗" - -#: scripts/5_db_backup.sh:39 -msgid "Backup succeeded! The backup file has been saved to" -msgstr "備份成功! 備份文件已存放至" - -#: scripts/utils.sh:170 -msgid "no default" -msgstr "無預設值" - -#: scripts/utils.sh:172 -msgid "default" -msgstr "預設為" - -#: scripts/utils.sh:220 -msgid "complete" -msgstr "完成" - -#: scripts/utils.sh:232 -msgid "fail" -msgstr "失敗" - -#: scripts/utils.sh:418 -msgid "command not found, Please install it first" -msgstr "未找到命令, 請先安裝" - -#: scripts/utils.sh:450 -msgid "Check Configuration File" -msgstr "檢查配置文件" - -#: scripts/utils.sh:451 -msgid "Path to Configuration file" -msgstr "配置檔案位置" - -#: scripts/utils.sh:598 scripts/1_config_jumpserver.sh:173 -#: scripts/7_upgrade.sh:256 -msgid "Failed to change the table structure" -msgstr "表結構變更失敗" - -#: scripts/utils.sh:667 -msgid "Failed to pull image" -msgstr "拉取鏡像失敗" - -#: scripts/6_db_restore.sh:11 scripts/8_uninstall.sh:8 -msgid "Make sure you have a backup of data, this operation is not reversible" -msgstr "請確認已經備份好相關數據, 此操作不可逆" - -#: scripts/6_db_restore.sh:14 -msgid "file does not exist" -msgstr "文件不存在" +#: scripts/0_prepare.sh:14 +msgid "Starting to download Docker engine" +msgstr "開始下載 Docker 程序" -#: scripts/6_db_restore.sh:20 -msgid "Start restoring database" -msgstr "開始還原資料庫" +#: scripts/0_prepare.sh:16 +msgid "Download docker fails, check the network is normal" +msgstr "下載 docker 失敗, 請檢查網路是否正常" -#: scripts/6_db_restore.sh:34 -msgid "" -"Database recovery failed. Please check whether the database file is complete " -"or try to recover manually" -msgstr "資料庫恢復失敗. 請檢查資料庫文件是否完整, 或嘗試手動恢復" +#: scripts/0_prepare.sh:21 +msgid "Using Docker cache" +msgstr "使用 Docker 快取文" -#: scripts/6_db_restore.sh:37 -msgid "Database recovered successfully" -msgstr "資料庫恢復成功" +#: scripts/0_prepare.sh:36 +msgid "Starting to download Docker Compose binary" +msgstr "開始下載 Docker Compose 程序" -#: scripts/6_db_restore.sh:48 -msgid "Format error" -msgstr "格式錯誤" +#: scripts/0_prepare.sh:38 +msgid "Download docker-compose fails, check the network is normal" +msgstr "下載 docker-compose 失敗, 請檢查網路是否正常" -#: scripts/6_db_restore.sh:52 -msgid "The backup file does not exist" -msgstr "備份文件不存在" +#: scripts/0_prepare.sh:43 +msgid "Using Docker Compose cache" +msgstr "使用 Docker Compose 快取文件" -#: scripts/2_install_docker.sh:25 -msgid "Docker program does not exist" -msgstr "Docker 程序不存在" +#: scripts/0_prepare.sh:55 scripts/7_upgrade.sh:24 +msgid "Docker is not running, please install and start" +msgstr "Docker 沒有運行, 請安裝並啟動" -#: scripts/2_install_docker.sh:129 -msgid "Do you want to support IPv6" -msgstr "是否需要支持 IPv6" +#: scripts/0_prepare.sh:81 +msgid "The image has been saved, skipping" +msgstr "已保存過該鏡像, 跳過" -#: scripts/2_install_docker.sh:175 -msgid "Install Docker" -msgstr "安裝 Docker" +#: scripts/0_prepare.sh:85 +msgid "Save image" +msgstr "保存鏡像" -#: scripts/2_install_docker.sh:178 -msgid "Configure Docker" -msgstr "配置 Docker" +#: scripts/0_prepare.sh:95 +msgid "Preparing Docker offline package" +msgstr "準備 Docker 離線包" -#: scripts/2_install_docker.sh:180 -msgid "Start Docker" -msgstr "啟動 Docker" +#: scripts/0_prepare.sh:99 +msgid "Preparing image offline package" +msgstr "準備鏡像離線包" #: scripts/1_config_jumpserver.sh:8 msgid "Configure Private Key" @@ -143,292 +88,279 @@ msgstr "注意:安裝後不能更改,否則資料庫可能會遺失" msgid "Persistent storage directory" msgstr "持久化儲存目錄" -#: scripts/1_config_jumpserver.sh:55 -msgid "Please enter MySQL server IP" -msgstr "請輸入 mysql 的主機地址" +#: scripts/1_config_jumpserver.sh:72 +msgid "Please enter DB server IP" +msgstr "請輸入資料庫的主機地址" + +#: scripts/1_config_jumpserver.sh:74 +msgid "Can not use localhost as DB server IP" +msgstr "" -#: scripts/1_config_jumpserver.sh:60 -msgid "Please enter MySQL server port" -msgstr "請輸入 mysql 的埠" +#: scripts/1_config_jumpserver.sh:77 +msgid "Please enter DB server port" +msgstr "請輸入資料庫的埠" -#: scripts/1_config_jumpserver.sh:62 -msgid "Please enter MySQL database name" -msgstr "請輸入 mysql 的資料庫" +#: scripts/1_config_jumpserver.sh:79 +msgid "Please enter DB database name" +msgstr "請輸入資料庫的名稱" -#: scripts/1_config_jumpserver.sh:64 -msgid "Please enter MySQL username" -msgstr "請輸入 mysql 的使用者名稱" +#: scripts/1_config_jumpserver.sh:81 +msgid "Please enter DB username" +msgstr "請輸入資料庫的使用者名稱" -#: scripts/1_config_jumpserver.sh:66 -msgid "Please enter MySQL password" -msgstr "請輸入 mysql 的密碼" +#: scripts/1_config_jumpserver.sh:83 +msgid "Please enter DB password" +msgstr "請輸入資料庫的密碼" -#: scripts/1_config_jumpserver.sh:91 -msgid "Configure MySQL" -msgstr "配置 MySQL" +#: scripts/1_config_jumpserver.sh:106 +msgid "Configure DB" +msgstr "配置資料庫" -#: scripts/1_config_jumpserver.sh:97 +#: scripts/1_config_jumpserver.sh:116 msgid "Do you want to use external MySQL" msgstr "是否使用外部 MySQL" -#: scripts/1_config_jumpserver.sh:107 +#: scripts/1_config_jumpserver.sh:128 +msgid "Do you want to use external PostgreSQL" +msgstr "是否使用外部 PostgreSQL" + +#: scripts/1_config_jumpserver.sh:136 scripts/6_db_restore.sh:46 +#: scripts/5_db_backup.sh:45 +msgid "Invalid DB Engine selection" +msgstr "" + +#: scripts/1_config_jumpserver.sh:144 msgid "Please enter Redis server IP" msgstr "請輸入 Redis 的主機地址" -#: scripts/1_config_jumpserver.sh:112 +#: scripts/1_config_jumpserver.sh:146 +msgid "Can not use localhost as Redis server IP" +msgstr "" + +#: scripts/1_config_jumpserver.sh:149 msgid "Please enter Redis server port" msgstr "請輸入 Redis 的埠" -#: scripts/1_config_jumpserver.sh:114 +#: scripts/1_config_jumpserver.sh:151 scripts/1_config_jumpserver.sh:164 msgid "Please enter Redis password" msgstr "請輸入 Redis 的密碼" -#: scripts/1_config_jumpserver.sh:132 +#: scripts/1_config_jumpserver.sh:160 +msgid "Please enter Redis Sentinel hosts" +msgstr "" + +#: scripts/1_config_jumpserver.sh:162 +msgid "Please enter Redis Sentinel password" +msgstr "請輸入 Redis 的密碼" + +#: scripts/1_config_jumpserver.sh:186 msgid "Configure Redis" msgstr "配置 Redis" -#: scripts/1_config_jumpserver.sh:142 +#: scripts/1_config_jumpserver.sh:188 +msgid "Please enter Redis Engine" +msgstr "請輸入 Redis 的主機地址" + +#: scripts/1_config_jumpserver.sh:197 msgid "Do you want to use external Redis" msgstr "是否使用外部 Redis" -#: scripts/1_config_jumpserver.sh:151 +#: scripts/1_config_jumpserver.sh:208 +msgid "Invalid Redis Engine selection" +msgstr "" + +#: scripts/1_config_jumpserver.sh:214 msgid "Configure External Access" msgstr "配置外部訪問" -#: scripts/1_config_jumpserver.sh:157 +#: scripts/1_config_jumpserver.sh:220 msgid "Do you need to customize the JumpServer external port" msgstr "是否需要配置 JumpServer 對外訪問埠" -#: scripts/1_config_jumpserver.sh:159 +#: scripts/1_config_jumpserver.sh:222 msgid "JumpServer web port" msgstr "JumpServer web 埠" -#: scripts/1_config_jumpserver.sh:161 +#: scripts/1_config_jumpserver.sh:226 msgid "JumpServer ssh port" msgstr "JumpServer ssh 埠" -#: scripts/1_config_jumpserver.sh:164 +#: scripts/1_config_jumpserver.sh:228 msgid "JumpServer rdp port" msgstr "JumpServer rdp 埠" -#: scripts/1_config_jumpserver.sh:171 +#: scripts/1_config_jumpserver.sh:235 msgid "Init JumpServer Database" msgstr "初始化資料庫" -#: scripts/3_load_images.sh:19 -msgid "Docker image not found" -msgstr "鏡像文件沒有發現" - -#: scripts/3_load_images.sh:36 -msgid "Docker image loaded, skipping" -msgstr "鏡像已載入, 跳過" - -#: scripts/8_uninstall.sh:12 -msgid "Are you clean up JumpServer files" -msgstr "確認清理 JumpServer 相關文件" - -#: scripts/8_uninstall.sh:19 scripts/8_uninstall.sh:21 -#: scripts/8_uninstall.sh:23 scripts/8_uninstall.sh:45 -#: scripts/8_uninstall.sh:50 scripts/8_uninstall.sh:56 -msgid "Cleaning up" -msgstr "正在清理" - -#: scripts/8_uninstall.sh:30 -msgid "Do you need to clean up the Docker image" -msgstr "是否清理 Docker 鏡像" - -#: scripts/8_uninstall.sh:40 -msgid "Do you need to clean up the Docker binaries" -msgstr "是否清理 Docker binaries" - -#: scripts/8_uninstall.sh:59 -msgid "Cleanup complete" -msgstr "清理完成" - -#: scripts/8_uninstall.sh:63 jmsctl.sh:56 -msgid "Uninstall JumpServer" -msgstr "卸載 JumpServer" - -#: scripts/0_prepare.sh:14 -msgid "Starting to download Docker engine" -msgstr "開始下載 Docker 程序" - -#: scripts/0_prepare.sh:16 -msgid "Download docker fails, check the network is normal" -msgstr "下載 docker 失敗, 請檢查網路是否正常" - -#: scripts/0_prepare.sh:21 -msgid "Using Docker cache" -msgstr "使用 Docker 快取文" - -#: scripts/0_prepare.sh:36 -msgid "Starting to download Docker Compose binary" -msgstr "開始下載 Docker Compose 程序" - -#: scripts/0_prepare.sh:38 -msgid "Download docker-compose fails, check the network is normal" -msgstr "下載 docker-compose 失敗, 請檢查網路是否正常" - -#: scripts/0_prepare.sh:43 -msgid "Using Docker Compose cache" -msgstr "使用 Docker Compose 快取文件" - -#: scripts/0_prepare.sh:55 -msgid "Docker is not running, please install and start" -msgstr "Docker 沒有運行, 請安裝並啟動" - -#: scripts/0_prepare.sh:81 -msgid "The image has been saved, skipping" -msgstr "已保存過該鏡像, 跳過" - -#: scripts/0_prepare.sh:85 -msgid "Save image" -msgstr "保存鏡像" - -#: scripts/0_prepare.sh:95 -msgid "Preparing Docker offline package" -msgstr "準備 Docker 離線包" - -#: scripts/0_prepare.sh:99 -msgid "Preparing image offline package" -msgstr "準備鏡像離線包" +#: scripts/1_config_jumpserver.sh:237 scripts/7_upgrade.sh:185 +#: scripts/utils.sh:565 +msgid "Failed to change the table structure" +msgstr "表結構變更失敗" -#: scripts/4_install_jumpserver.sh:10 -msgid "" -"The current Linux system does not support systemd management. Please deploy " -"docker by yourself before running this script again" -msgstr "當前 Linux 系統不支持 systemd 管理, 請先自行部署 docker 後再重新運行此腳本" +#: scripts/2_install_docker.sh:25 +msgid "Docker program does not exist" +msgstr "Docker 程序不存在" -#: scripts/4_install_jumpserver.sh:14 -msgid "" -"The current Linux system does not support systemd management. Please deploy " -"docker-compose by yourself before running this script again" +#: scripts/2_install_docker.sh:80 scripts/2_install_docker.sh:173 +msgid "Permission denied. pass..." msgstr "" -"當前 Linux 系統不支持 systemd 管理, 請先自行部署 docker-compose 後再重新運行" -"此腳本" - -#: scripts/4_install_jumpserver.sh:21 -msgid "The Installation is Complete" -msgstr "安裝完成了" -#: scripts/4_install_jumpserver.sh:31 -msgid "You can use the following command to start, and then visit" -msgstr "可以使用如下命令啟動, 然後訪問" +#: scripts/2_install_docker.sh:155 +msgid "Do you want to support IPv6" +msgstr "是否需要支持 IPv6" -#: scripts/4_install_jumpserver.sh:35 -msgid "Other management commands" -msgstr "其它一些管理命令" +#: scripts/2_install_docker.sh:205 +msgid "Install Docker" +msgstr "安裝 Docker" -#: scripts/4_install_jumpserver.sh:40 -msgid "For more commands, you can enter ./jmsctl.sh --help to understand" -msgstr "更多還有一些命令, 你可以 ./jmsctl.sh --help 來了解" +#: scripts/2_install_docker.sh:208 +msgid "Configure Docker" +msgstr "配置 Docker" -#: scripts/4_install_jumpserver.sh:42 -msgid "Web access" -msgstr "Web 訪問" +#: scripts/2_install_docker.sh:210 +msgid "Start Docker" +msgstr "啟動 Docker" -#: scripts/4_install_jumpserver.sh:49 -msgid "Default username" -msgstr "預設用戶" +#: scripts/3_load_images.sh:19 +msgid "Docker image not found" +msgstr "鏡像文件沒有發現" -#: scripts/4_install_jumpserver.sh:49 -msgid "Default password" -msgstr "默認密碼" +#: scripts/3_load_images.sh:36 +msgid "Docker image loaded, skipping" +msgstr "鏡像已載入, 跳過" -#: scripts/4_install_jumpserver.sh:51 -msgid "access" -msgstr "訪問" +#: scripts/6_db_restore.sh:15 scripts/8_uninstall.sh:70 +msgid "Make sure you have a backup of data, this operation is not reversible" +msgstr "請確認已經備份好相關數據, 此操作不可逆" -#: scripts/4_install_jumpserver.sh:55 -msgid "More information" -msgstr "更多資訊" +#: scripts/6_db_restore.sh:18 +msgid "file does not exist" +msgstr "文件不存在" -#: scripts/4_install_jumpserver.sh:56 -msgid "Official Website" -msgstr "我們的官網" +#: scripts/6_db_restore.sh:24 +msgid "Start restoring database" +msgstr "開始還原資料庫" -#: scripts/4_install_jumpserver.sh:57 -msgid "Documentation" -msgstr "我們的文件" +#: scripts/6_db_restore.sh:52 +msgid "" +"Database recovery failed. Please check whether the database file is complete " +"or try to recover manually" +msgstr "資料庫恢復失敗. 請檢查資料庫文件是否完整, 或嘗試手動恢復" -#: scripts/4_install_jumpserver.sh:67 -msgid "Install and Configure Docker" -msgstr "安裝配置 Docker" +#: scripts/6_db_restore.sh:55 +msgid "Database recovered successfully" +msgstr "資料庫恢復成功" -#: scripts/4_install_jumpserver.sh:71 scripts/7_upgrade.sh:332 -msgid "Loading Docker Image" -msgstr "載入 Docker 鏡像" +#: scripts/6_db_restore.sh:66 +msgid "Format error" +msgstr "格式錯誤" -#: scripts/4_install_jumpserver.sh:75 -msgid "Install and Configure JumpServer" -msgstr "安裝配置 JumpServer" +#: scripts/6_db_restore.sh:70 +msgid "The backup file does not exist" +msgstr "備份文件不存在" -#: scripts/7_upgrade.sh:223 +#: scripts/7_upgrade.sh:152 msgid "Back up to" msgstr "備份至" -#: scripts/7_upgrade.sh:230 +#: scripts/7_upgrade.sh:159 msgid "Failed to backup the database. Continue to upgrade" msgstr "備份資料庫失敗, 繼續升級嗎" -#: scripts/7_upgrade.sh:236 +#: scripts/7_upgrade.sh:165 msgid "Skip database backup" msgstr "跳過備份資料庫" -#: scripts/7_upgrade.sh:243 +#: scripts/7_upgrade.sh:172 msgid "" "Detected that the JumpServer container is running. Do you want to close the " "container and continue to upgrade" msgstr "檢測到 JumpServer 正在運行, 是否需要關閉並繼續升級" -#: scripts/7_upgrade.sh:258 +#: scripts/7_upgrade.sh:187 msgid "Failed to change the table structure. Continue to upgrade" msgstr "表結構變更失敗, 是否繼續" -#: scripts/7_upgrade.sh:269 +#: scripts/7_upgrade.sh:200 msgid "Do you need to clean up the old version image" msgstr "是否需要清理舊版本鏡像文件" -#: scripts/7_upgrade.sh:282 +#: scripts/7_upgrade.sh:213 msgid "Do you need upgrade Docker binaries" msgstr "是否升級 Docker binaries" -#: scripts/7_upgrade.sh:302 +#: scripts/7_upgrade.sh:236 msgid "Do you need upgrade Docker Compose" msgstr "是否升級 Docker Compose" -#: scripts/7_upgrade.sh:320 +#: scripts/7_upgrade.sh:254 msgid "Are you sure you want to update the current version to" msgstr "是否將版本更新至" -#: scripts/7_upgrade.sh:335 jmsctl.sh:60 +#: scripts/7_upgrade.sh:266 scripts/4_install_jumpserver.sh:75 +msgid "Loading Docker Image" +msgstr "載入 Docker 鏡像" + +#: scripts/7_upgrade.sh:269 jmsctl.sh:60 msgid "Backup database" msgstr "備份資料庫" -#: scripts/7_upgrade.sh:338 +#: scripts/7_upgrade.sh:272 msgid "Backup Configuration File" msgstr "備份配置文件" -#: scripts/7_upgrade.sh:341 +#: scripts/7_upgrade.sh:275 msgid "Apply database changes" msgstr "進行資料庫變更" -#: scripts/7_upgrade.sh:342 +#: scripts/7_upgrade.sh:276 msgid "Changing database schema may take a while, please wait patiently" msgstr "資料表結構變更可能需要一段時間, 請耐心等待" -#: scripts/7_upgrade.sh:345 +#: scripts/7_upgrade.sh:279 msgid "Cleanup Image" msgstr "清理鏡像" -#: scripts/7_upgrade.sh:348 +#: scripts/7_upgrade.sh:282 msgid "Upgrade Docker" msgstr "升級 Docker" -#: scripts/7_upgrade.sh:353 +#: scripts/7_upgrade.sh:288 msgid "Upgrade successfully. You can now restart the program" msgstr "升級成功, 可以重新啟動程序了" +#: scripts/8_uninstall.sh:19 scripts/8_uninstall.sh:33 +#: scripts/8_uninstall.sh:38 scripts/8_uninstall.sh:50 +#: scripts/8_uninstall.sh:59 scripts/8_uninstall.sh:77 +#: scripts/8_uninstall.sh:81 +msgid "Cleaning up" +msgstr "正在清理" + +#: scripts/8_uninstall.sh:28 +msgid "Do you need to clean up the Docker binaries" +msgstr "確認清理 Docker binaries" + +#: scripts/8_uninstall.sh:48 scripts/8_uninstall.sh:57 +msgid "Do you need to clean up the Docker Compose binaries" +msgstr "確認清理 Docker Compose binaries" + +#: scripts/8_uninstall.sh:74 +msgid "Are you clean up JumpServer files" +msgstr "確認清理 JumpServer 相關文件" + +#: scripts/8_uninstall.sh:88 +msgid "Do you need to clean up the Docker image" +msgstr "是否清理 Docker 鏡像" + +#: scripts/8_uninstall.sh:95 +msgid "Cleanup complete" +msgstr "清理完成" + +#: scripts/8_uninstall.sh:99 jmsctl.sh:56 +msgid "Uninstall JumpServer" +msgstr "卸載 JumpServer" + #: scripts/config.sh:16 msgid "Configuration ntp sync" msgstr "配置 ntp 同步" @@ -553,6 +485,117 @@ msgstr "是否需要繼續添加或修改配置" msgid "Configuration file not found" msgstr "配置文件沒有發現" +#: scripts/utils.sh:198 +msgid "no default" +msgstr "無預設值" + +#: scripts/utils.sh:200 +msgid "default" +msgstr "預設為" + +#: scripts/utils.sh:248 +msgid "complete" +msgstr "完成" + +#: scripts/utils.sh:260 +msgid "fail" +msgstr "失敗" + +#: scripts/utils.sh:385 +msgid "command not found, Please install it first" +msgstr "未找到命令, 請先安裝" + +#: scripts/utils.sh:417 +msgid "Check Configuration File" +msgstr "檢查配置文件" + +#: scripts/utils.sh:418 +msgid "Path to Configuration file" +msgstr "配置檔案位置" + +#: scripts/utils.sh:634 +msgid "Failed to pull image" +msgstr "拉取鏡像失敗" + +#: scripts/4_install_jumpserver.sh:10 +msgid "" +"The current Linux system does not support systemd management. Please deploy " +"docker by yourself before running this script again" +msgstr "" +"當前 Linux 系統不支持 systemd 管理, 請先自行部署 docker 後再重新運行此腳本" + +#: scripts/4_install_jumpserver.sh:14 +msgid "" +"The current Linux system does not support systemd management. Please deploy " +"docker-compose by yourself before running this script again" +msgstr "" +"當前 Linux 系統不支持 systemd 管理, 請先自行部署 docker-compose 後再重新運行" +"此腳本" + +#: scripts/4_install_jumpserver.sh:21 +msgid "The Installation is Complete" +msgstr "安裝完成了" + +#: scripts/4_install_jumpserver.sh:32 +msgid "You can use the following command to start, and then visit" +msgstr "可以使用如下命令啟動, 然後訪問" + +#: scripts/4_install_jumpserver.sh:36 +msgid "Other management commands" +msgstr "其它一些管理命令" + +#: scripts/4_install_jumpserver.sh:41 +msgid "For more commands, you can enter ./jmsctl.sh --help to understand" +msgstr "更多還有一些命令, 你可以 ./jmsctl.sh --help 來了解" + +#: scripts/4_install_jumpserver.sh:43 +msgid "Web access" +msgstr "Web 訪問" + +#: scripts/4_install_jumpserver.sh:50 +msgid "Default username" +msgstr "預設用戶" + +#: scripts/4_install_jumpserver.sh:50 +msgid "Default password" +msgstr "默認密碼" + +#: scripts/4_install_jumpserver.sh:53 +msgid "access" +msgstr "訪問" + +#: scripts/4_install_jumpserver.sh:58 +msgid "More information" +msgstr "更多資訊" + +#: scripts/4_install_jumpserver.sh:59 +msgid "Official Website" +msgstr "我們的官網" + +#: scripts/4_install_jumpserver.sh:60 +msgid "Documentation" +msgstr "我們的文件" + +#: scripts/4_install_jumpserver.sh:70 +msgid "Install and Configure Docker" +msgstr "安裝配置 Docker" + +#: scripts/4_install_jumpserver.sh:79 +msgid "Install and Configure JumpServer" +msgstr "安裝配置 JumpServer" + +#: scripts/5_db_backup.sh:19 +msgid "Backing up" +msgstr "正在備份" + +#: scripts/5_db_backup.sh:51 scripts/5_db_backup.sh:52 +msgid "Backup failed" +msgstr "備份失敗" + +#: scripts/5_db_backup.sh:56 +msgid "Backup succeeded! The backup file has been saved to" +msgstr "備份成功! 備份文件已存放至" + #: jmsctl.sh:16 msgid "If you are upgrading from v1.5.x, please copy the config.txt To" msgstr "如果你是從 v1.5.x 升級的, 請 copy 之前目錄中的 config.txt 到" @@ -602,8 +645,8 @@ msgid "Data recovery through database backup file" msgstr "通過資料庫備份文件恢復數據" #: jmsctl.sh:62 -msgid "Execute the original docker-compose command" -msgstr "執行原始 docker-compose 命令" +msgid "Execute the original docker compose command" +msgstr "執行原始 docker compose 命令" #: jmsctl.sh:63 msgid "View log" @@ -632,3 +675,6 @@ msgstr "macOS 安裝請參考" #: jmsctl.sh:179 msgid "Windows installer please see" msgstr "Windows 安裝請參考" + +#~ msgid "Configure MySQL" +#~ msgstr "配置 MySQL" From 9626e0afa552492f86edfe20bdcc1c9e413969c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 29 Apr 2024 17:49:33 +0800 Subject: [PATCH 09/36] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/koko.yml | 4 +++- compose/minio.yml | 8 ++++---- compose/receptor.yml | 2 +- scripts/config.sh | 44 ++++++++++++++++++++++---------------------- scripts/utils.sh | 7 ++++++- 5 files changed, 36 insertions(+), 29 deletions(-) diff --git a/compose/koko.yml b/compose/koko.yml index ef896d8b..bf1702e4 100644 --- a/compose/koko.yml +++ b/compose/koko.yml @@ -6,12 +6,14 @@ services: ulimits: core: 0 restart: always + privileged: true env_file: - ${CONFIG_FILE} + ports: + - ${SSH_PORT}:2222 volumes: - ${CONFIG_DIR}/certs:/opt/koko/data/certs - ${VOLUME_DIR}/koko/data:/opt/koko/data - privileged: true healthcheck: test: "check http://localhost:5000/koko/health/" interval: 10s diff --git a/compose/minio.yml b/compose/minio.yml index b76c384f..66d323c7 100644 --- a/compose/minio.yml +++ b/compose/minio.yml @@ -5,16 +5,16 @@ services: hostname: jms_minio restart: always command: "server /data --console-address :9001" + environment: + TZ: ${TZ:-Asia/Shanghai} + MINIO_ROOT_USER: minio + MINIO_ROOT_PASSWORD: $BOOTSTRAP_TOKEN ports: - 9000:9000 - 9001:9001 volumes: - ${VOLUME_DIR}/minio/data:/data - ${CONFIG_DIR}/minio/config:/root/.minio - environment: - TZ: ${TZ:-Asia/Shanghai} - MINIO_ROOT_USER: minio - MINIO_ROOT_PASSWORD: $BOOTSTRAP_TOKEN healthcheck: test: "mc ready local" interval: 10s diff --git a/compose/receptor.yml b/compose/receptor.yml index d55ba7f0..c9451290 100644 --- a/compose/receptor.yml +++ b/compose/receptor.yml @@ -1,6 +1,6 @@ services: receptor: - image: ${REGISTRY:-docker.io}/jumpserver/core-ce:${VERSION} + image: ${REGISTRY:-docker.io}/jumpserver/core:${VERSION} container_name: jms_receptor hostname: jms_receptor ulimits: diff --git a/scripts/config.sh b/scripts/config.sh index 2d1d7a6f..617fbf45 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -67,29 +67,29 @@ function set_port() { set_config HTTPS_PORT "${https_port}" fi fi - if [[ "${koko_enable}" != "0" ]]; then - ssh_port=$(get_config SSH_PORT) - read_from_input ssh_port "$(gettext 'Please enter SSH PORT')" "" "${ssh_port}" - set_config SSH_PORT "${ssh_port}" - fi - if [[ "${magnus_enable}" != "0" ]]; then - magnus_mysql_port=$(get_config MAGNUS_MYSQL_PORT) - read_from_input magnus_mysql_port "$(gettext 'Please enter MAGNUS MYSQL PORT')" "" "${magnus_mysql_port}" - set_config MAGNUS_MYSQL_PORT "${magnus_mysql_port}" - magnus_mariadb_port=$(get_config MAGNUS_MARIADB_PORT) - read_from_input magnus_mariadb_port "$(gettext 'Please enter MAGNUS MARIADB PORT')" "" "${magnus_mariadb_port}" - set_config MAGNUS_MARIADB_PORT "${magnus_mariadb_port}" - magnus_redis_port=$(get_config MAGNUS_REDIS_PORT) - read_from_input magnus_redis_port "$(gettext 'Please enter MAGNUS REDIS PORT')" "" "${magnus_redis_port}" - set_config MAGNUS_REDIS_PORT "${magnus_redis_port}" - magnus_postgresql_port=$(get_config MAGNUS_POSTGRESQL_PORT) - read_from_input magnus_postgresql_port "$(gettext 'Please enter MAGNUS POSTGRESQL PORT')" "" "${magnus_postgresql_port}" - set_config MAGNUS_POSTGRESQL_PORT "${magnus_postgresql_port}" - magnus_sqlserver_port=$(get_config MAGNUS_SQLSERVER_PORT) - read_from_input magnus_sqlserver_port "$(gettext 'Please enter MAGNUS SQLSERVER PORT')" "" "${magnus_sqlserver_port}" - set_config MAGNUS_SQLSERVER_PORT "${magnus_sqlserver_port}" - fi if [[ "${use_xpack}" == "1" ]]; then + if [[ "${koko_enable}" != "0" ]]; then + ssh_port=$(get_config SSH_PORT) + read_from_input ssh_port "$(gettext 'Please enter SSH PORT')" "" "${ssh_port}" + set_config SSH_PORT "${ssh_port}" + fi + if [[ "${magnus_enable}" != "0" ]]; then + magnus_mysql_port=$(get_config MAGNUS_MYSQL_PORT) + read_from_input magnus_mysql_port "$(gettext 'Please enter MAGNUS MYSQL PORT')" "" "${magnus_mysql_port}" + set_config MAGNUS_MYSQL_PORT "${magnus_mysql_port}" + magnus_mariadb_port=$(get_config MAGNUS_MARIADB_PORT) + read_from_input magnus_mariadb_port "$(gettext 'Please enter MAGNUS MARIADB PORT')" "" "${magnus_mariadb_port}" + set_config MAGNUS_MARIADB_PORT "${magnus_mariadb_port}" + magnus_redis_port=$(get_config MAGNUS_REDIS_PORT) + read_from_input magnus_redis_port "$(gettext 'Please enter MAGNUS REDIS PORT')" "" "${magnus_redis_port}" + set_config MAGNUS_REDIS_PORT "${magnus_redis_port}" + magnus_postgresql_port=$(get_config MAGNUS_POSTGRESQL_PORT) + read_from_input magnus_postgresql_port "$(gettext 'Please enter MAGNUS POSTGRESQL PORT')" "" "${magnus_postgresql_port}" + set_config MAGNUS_POSTGRESQL_PORT "${magnus_postgresql_port}" + magnus_sqlserver_port=$(get_config MAGNUS_SQLSERVER_PORT) + read_from_input magnus_sqlserver_port "$(gettext 'Please enter MAGNUS SQLSERVER PORT')" "" "${magnus_sqlserver_port}" + set_config MAGNUS_SQLSERVER_PORT "${magnus_sqlserver_port}" + fi if [[ "${xrdp_enable}" != "0" ]]; then xrdp_port=$(get_config XRDP_PORT) read_from_input xrdp_port "$(gettext 'Please enter XRDP PORT')" "" "${xrdp_port}" diff --git a/scripts/utils.sh b/scripts/utils.sh index efc8ba21..744e7c2f 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -283,6 +283,11 @@ function get_docker_compose_services() { services="core celery koko lion chen web" + receptor_enabled=$(get_config RECEPTOR_ENABLED) + if [[ "${receptor_enabled}" == "1" ]]; then + services+=" receptor" + fi + if [[ "${ignore_db}" != "ignore_db" ]]; then case "${db_engine}" in mysql) @@ -328,7 +333,7 @@ function get_docker_compose_cmd_line() { fi services=$(get_docker_compose_services "$ignore_db") - for service in core celery koko lion chen web redis; do + for service in core celery receptor koko lion chen web redis; do if [[ "${services}" =~ ${service} ]]; then cmd+=" -f compose/${service}.yml" fi From aeb5a2e12577d3d7560439199acd714765e4ecda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 6 May 2024 08:53:21 +0800 Subject: [PATCH 10/36] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20docker=2026.?= =?UTF-8?q?1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index 3e11d075..1e26faa3 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,20 +26,20 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.1.0 +export DOCKER_VERSION=26.1.1 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" export DOCKER_BIN_URL="${DOCKER_MIRROR}/$(uname -m)/docker-${DOCKER_VERSION}.tgz" if [[ "$(uname -m)" == "x86_64" ]]; then - DOCKER_MD5=344e9cc48a523725fc1b3b2ce0d9fb30 + DOCKER_MD5=0224c312b66629fe62f1b658d7424188 fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_MD5=81ff95d539a16a7382819d026d64d918 + DOCKER_MD5=97f956ed2098b331c94640370fe96c19 fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_MD5=0071150b3931cf6bc2d9e5d23dc112c7 + DOCKER_MD5=08420ea7a6904e061a755edd053a1f21 fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_MD5=09bd1754c83e683e7caf826c5fb788c3 + DOCKER_MD5=a5172303a906b610796ba71970a549aa fi export DOCKER_MD5 From b16f4612ac0c4e17c83e4273c07617fdf51933d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 10 May 2024 06:57:10 +0800 Subject: [PATCH 11/36] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20docker=2026.?= =?UTF-8?q?1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index a91fbe83..e0757a09 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,20 +26,20 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.1.0 +export DOCKER_VERSION=26.1.2 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" export DOCKER_BIN_URL="${DOCKER_MIRROR}/$(uname -m)/docker-${DOCKER_VERSION}.tgz" if [[ "$(uname -m)" == "x86_64" ]]; then - DOCKER_MD5=344e9cc48a523725fc1b3b2ce0d9fb30 + DOCKER_MD5=b6401f2abd3c8955fbbec851933c6ebe fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_MD5=81ff95d539a16a7382819d026d64d918 + DOCKER_MD5=dedcbe72fca2fb9f125c5689e8a4432e fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_MD5=0071150b3931cf6bc2d9e5d23dc112c7 + DOCKER_MD5=0a216869715a45d2a6d97d8dfb815d37 fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_MD5=09bd1754c83e683e7caf826c5fb788c3 + DOCKER_MD5=e458b7fa40f27b4a70a2d30505d30ceb fi export DOCKER_MD5 From 4807d8ab79fb952b6e624b0fc33545879e9cc085 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 16 May 2024 19:07:12 +0800 Subject: [PATCH 12/36] =?UTF-8?q?perf:=20=E6=B7=BB=E5=8A=A0=20loki=20(#427?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * perf: 添加 grafana perf: update grafana * perf: 集成 loki --------- Co-authored-by: Eric --- compose/loki.yml | 29 +++++++++++ config_init/loki/loki.yaml | 41 +++++++++++++++ config_init/loki/promtail.yml | 98 +++++++++++++++++++++++++++++++++++ scripts/utils.sh | 7 +++ 4 files changed, 175 insertions(+) create mode 100644 compose/loki.yml create mode 100644 config_init/loki/loki.yaml create mode 100644 config_init/loki/promtail.yml diff --git a/compose/loki.yml b/compose/loki.yml new file mode 100644 index 00000000..0d97f9ae --- /dev/null +++ b/compose/loki.yml @@ -0,0 +1,29 @@ +services: + loki: + image: grafana/loki:3.0.0 + container_name: jms_loki + hostname: jms_loki + user: "0" + command: -config.file=/etc/loki/local-config.yaml + volumes: + - ${CONFIG_DIR}/loki/loki.yaml:/etc/loki/local-config.yaml + - ${VOLUME_DIR}/loki/loki:/loki + networks: + - net + + promtail: + image: grafana/promtail:3.0.0 + container_name: jms_promtail + hostname: jms_promtail + env_file: + - ${CONFIG_FILE} + volumes: + - ${CONFIG_DIR}/loki/promtail.yml:/etc/promtail/config.yml + - ${VOLUME_DIR}/loki/promtail/:/data/jumpserver/loki/promtail/ + - ${VOLUME_DIR}:/data/jumpserver/ + - /var/run/docker.sock:/var/run/docker.sock + command: -config.file=/etc/promtail/config.yml -config.expand-env=true + networks: + - net + depends_on: + - loki diff --git a/config_init/loki/loki.yaml b/config_init/loki/loki.yaml new file mode 100644 index 00000000..99cdb86f --- /dev/null +++ b/config_init/loki/loki.yaml @@ -0,0 +1,41 @@ +auth_enabled: false + +server: + http_listen_port: 3100 + +common: + path_prefix: /loki + storage: + filesystem: + chunks_directory: /loki/chunks + rules_directory: /loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + +schema_config: + configs: + - from: 2020-10-24 + store: boltdb-shipper + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +ruler: + alertmanager_url: http://localhost:9093 + +# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration +# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ +# +# Statistics help us better understand how Loki is used, and they show us performance +# levels for most users. This helps us prioritize features and documentation. +# For more information on what's sent, look at +# https://github.com/grafana/loki/blob/main/pkg/usagestats/stats.go +# Refer to the buildReport method to see what goes into a report. +# +# If you would like to disable reporting, uncomment the following lines: +analytics: + reporting_enabled: false diff --git a/config_init/loki/promtail.yml b/config_init/loki/promtail.yml new file mode 100644 index 00000000..ff2c3fd2 --- /dev/null +++ b/config_init/loki/promtail.yml @@ -0,0 +1,98 @@ +server: + disable: false + http_listen_port: 0 + grpc_listen_port: 0 + +positions: + filename: /data/jumpserver/loki/promtail/positions.yaml + +clients: + - url: http://jms_loki:3100/loki/api/v1/push + tenant_id: tenant1 + +scrape_configs: + - job_name: core + static_configs: + - targets: + - localhost + labels: + component: core + job_name: core + __path__: /data/jumpserver/core/data/logs/*.log + - job_name: koko + static_configs: + - targets: + - localhost + labels: + component: koko + job_name: koko + __path__: /data/jumpserver/koko/data/logs/*.log + + - job_name: lion + static_configs: + - targets: + - localhost + labels: + component: lion + job_name: lion + __path__: /data/jumpserver/lion/data/logs/*.log + + - job_name: chen + static_configs: + - targets: + - localhost + labels: + component: chen + job_name: chen + __path__: /data/jumpserver/chen/data/logs/*.log + + - job_name: web + static_configs: + - targets: + - localhost + labels: + component: web + job_name: web + __path__: /data/jumpserver/nginx/data/logs/*.log + + - job_name: razor + static_configs: + - targets: + - localhost + labels: + component: razor + job_name: razor + __path__: /data/jumpserver/razor/data/logs/*.log + + - job_name: xrdp + static_configs: + - targets: + - localhost + labels: + component: xrdp + job_name: xrdp + __path__: /data/jumpserver/xrdp/data/logs/*.log + + - job_name: magnus + static_configs: + - targets: + - localhost + labels: + component: magnus + job_name: magnus + __path__: /data/jumpserver/magnus/data/logs/*.log + + - job_name: docker + docker_sd_configs: + - host: unix:///var/run/docker.sock + refresh_interval: 5s + filters: + - name: name + values: [jms_web, jms_core, jms_koko, jms_lion, + jms_chen, jms_magnus, jms_xrdp, jms_razor, + jms_receptor] + relabel_configs: + - source_labels: ["__meta_docker_container_name"] + regex: "/(.*)" + target_label: "component" + diff --git a/scripts/utils.sh b/scripts/utils.sh index 744e7c2f..f211d035 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -279,6 +279,8 @@ function get_docker_compose_services() { redis_host=$(get_config REDIS_HOST) use_es=$(get_config USE_ES) use_minio=$(get_config USE_MINIO) + use_loki=$(get_config USE_LOKI) + use_xpack=$(get_config_or_env USE_XPACK) services="core celery koko lion chen web" @@ -307,6 +309,7 @@ function get_docker_compose_services() { [[ "${use_es}" == "1" ]] && services+=" es" [[ "${use_minio}" == "1" ]] && services+=" minio" + [[ "${use_loki}" == "1" ]] && services+=" loki" if [[ "${use_xpack}" == "1" ]]; then services+=" magnus razor xrdp video panda" @@ -357,6 +360,10 @@ function get_docker_compose_cmd_line() { cmd+=" -f compose/lb.yml" fi + if [[ "${services}" =~ loki ]]; then + cmd+=" -f compose/loki.yml" + fi + if [[ "${use_xpack}" == '1' ]]; then for service in magnus razor xrdp video panda; do if [[ "${services}" =~ ${service} ]]; then From f95223251df36d9820e8f68f8dfac08075a6fa18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 10 May 2024 06:52:24 +0800 Subject: [PATCH 13/36] =?UTF-8?q?perf:=20=E5=85=81=E8=AE=B8=20koko=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/koko.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compose/koko.yml b/compose/koko.yml index bf1702e4..9caab714 100644 --- a/compose/koko.yml +++ b/compose/koko.yml @@ -9,8 +9,10 @@ services: privileged: true env_file: - ${CONFIG_FILE} + environment: + - SSHD_PORT=${SSH_PORT:-2222} ports: - - ${SSH_PORT}:2222 + - ${SSH_PORT:-2222}:${SSH_PORT:-2222} volumes: - ${CONFIG_DIR}/certs:/opt/koko/data/certs - ${VOLUME_DIR}/koko/data:/opt/koko/data From 84c0ddb97d6fbd4589e14bf81f8e55b4fc62a58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 10 May 2024 06:42:31 +0800 Subject: [PATCH 14/36] =?UTF-8?q?perf:=20=E5=85=81=E8=AE=B8=20razor=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/razor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/razor.yml b/compose/razor.yml index 67e4b502..1b5a9410 100644 --- a/compose/razor.yml +++ b/compose/razor.yml @@ -9,7 +9,7 @@ services: env_file: - ${CONFIG_FILE} ports: - - ${RDP_PORT}:3389 + - ${RDP_PORT:-3389}:${RDP_PORT:-3389} volumes: - ${VOLUME_DIR}/razor/data:/opt/razor/data - ${CONFIG_DIR}/nginx/cert:/opt/razor/cert From 5a9c03cef372001ec4dadf1d4e2021f5c7cbe882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 20 May 2024 09:37:55 +0800 Subject: [PATCH 15/36] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=8B=89=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.sh b/scripts/utils.sh index f211d035..c3beb09a 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -622,7 +622,7 @@ function pull_image() { fi echo "[${image}] pulling" - if [[ -n "${DOCKER_IMAGE_PREFIX}" && $(image_has_prefix "${image}") == "0" ]]; then + if [[ -n "${DOCKER_IMAGE_PREFIX}" && $(image_has_prefix "${image}") == "1" ]]; then docker pull "${DOCKER_IMAGE_PREFIX}/${image}" docker tag "${DOCKER_IMAGE_PREFIX}/${image}" "${image}" docker rmi -f "${DOCKER_IMAGE_PREFIX}/${image}" From 542e433ee8a6c5813a8472a004e5a1c0216c19f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 20 May 2024 09:57:09 +0800 Subject: [PATCH 16/36] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=8B=89=E5=8F=96=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.sh b/scripts/utils.sh index c3beb09a..d891e1bb 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -513,7 +513,7 @@ function get_latest_version() { } function image_has_prefix() { - if [[ $1 =~ registry.fit2cloud.com.* ]]; then + if [[ $1 =~ jumpserver.* ]]; then echo "1" else echo "0" From ba6a71ac796664ccad8fd42892605dc24288eca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 20 May 2024 10:20:57 +0800 Subject: [PATCH 17/36] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E5=AF=BC=E5=85=A5=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/3_load_images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/3_load_images.sh b/scripts/3_load_images.sh index 7db94ae4..dde6f0a4 100755 --- a/scripts/3_load_images.sh +++ b/scripts/3_load_images.sh @@ -39,7 +39,7 @@ function load_image_files() { } function main() { - if [[ -d "${IMAGE_DIR}" && -f "${IMAGE_DIR}/redis:6.2.tar" ]]; then + if [[ -d "${IMAGE_DIR}" && $(find "${IMAGE_DIR}" -type f -name "*.tar" -print -quit 2>/dev/null) ]]; then load_image_files else pull_images From 1f325299fd5fc88cdff935a14eec9bc55d2dd7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 20 May 2024 11:18:46 +0800 Subject: [PATCH 18/36] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20docker=2026.?= =?UTF-8?q?1.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index 873bab53..c45b12cd 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,20 +26,20 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.1.2 +export DOCKER_VERSION=26.1.3 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" export DOCKER_BIN_URL="${DOCKER_MIRROR}/$(uname -m)/docker-${DOCKER_VERSION}.tgz" if [[ "$(uname -m)" == "x86_64" ]]; then - DOCKER_MD5=b6401f2abd3c8955fbbec851933c6ebe + DOCKER_MD5=0d5deaa475b93915cf3eb36e51d12d18 fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_MD5=dedcbe72fca2fb9f125c5689e8a4432e + DOCKER_MD5=ba57d12516d0ca55debf0a60b49cc975 fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_MD5=0a216869715a45d2a6d97d8dfb815d37 + DOCKER_MD5=897ec1f0700bcf82b02d31271b5dc23c fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_MD5=e458b7fa40f27b4a70a2d30505d30ceb + DOCKER_MD5=95f0111c2d70a7c32fdc4526cef8b6a1 fi export DOCKER_MD5 From 475b566781a4d8688c05d763b723f1f12da8a519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 21 May 2024 10:54:51 +0800 Subject: [PATCH 19/36] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E8=84=9A=E6=9C=AC=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/7_upgrade.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/7_upgrade.sh b/scripts/7_upgrade.sh index 931bfe72..1fd632ed 100644 --- a/scripts/7_upgrade.sh +++ b/scripts/7_upgrade.sh @@ -262,6 +262,7 @@ function main() { fi echo update_config_if_need + check_compose_install echo_yellow "\n2. $(gettext 'Loading Docker Image')" bash "${BASE_DIR}/3_load_images.sh" From c1eb668bbc431bf039849c947cb000381d08e554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 21 May 2024 11:44:46 +0800 Subject: [PATCH 20/36] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=20docker=20?= =?UTF-8?q?=E4=BA=8C=E8=BF=9B=E5=88=B6=E9=A2=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/0_prepare.sh | 22 +++++++++++----------- scripts/2_install_docker.sh | 24 +++++++++++------------- scripts/7_upgrade.sh | 3 ++- scripts/utils.sh | 1 - 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/scripts/0_prepare.sh b/scripts/0_prepare.sh index c4e74bb0..0f5c3fbf 100644 --- a/scripts/0_prepare.sh +++ b/scripts/0_prepare.sh @@ -4,7 +4,7 @@ BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "${BASE_DIR}/utils.sh" -IMAGE_DIR="images" +IMAGE_DIR="${BASE_DIR}/images" function prepare_docker_bin() { md5_matched=$(check_md5 /tmp/docker.tar.gz "${DOCKER_MD5}") @@ -20,12 +20,12 @@ function prepare_docker_bin() { else echo "$(gettext 'Using Docker cache'): /tmp/docker.tar.gz" fi - tar -xf /tmp/docker.tar.gz -C ./ || { - rm -rf docker /tmp/docker.tar.gz + tar -xf /tmp/docker.tar.gz -C "${BASE_DIR}/" || { + rm -rf "${BASE_DIR}/docker" /tmp/docker.tar.gz exit 1 } - chown -R root:root docker - chmod +x docker/* + chown -R root:root "${BASE_DIR}/docker" + chmod +x "${BASE_DIR}/docker/*" } function prepare_compose_bin() { @@ -42,12 +42,12 @@ function prepare_compose_bin() { else echo "$(gettext 'Using Docker Compose cache'): /tmp/docker-compose" fi - if [[ ! -d "$BASE_DIR/docker" ]]; then + if [[ ! -d "${BASE_DIR}/docker" ]]; then mkdir -p "${BASE_DIR}/docker" fi - \cp -rf /tmp/docker-compose docker/ - chown -R root:root docker - chmod +x docker/* + \cp -f /tmp/docker-compose "${BASE_DIR}/docker/" + chown -R root:root "${BASE_DIR}/docker/docker-compose" + chmod +x "${BASE_DIR}/docker/docker-compose" } function prepare_image_files() { @@ -62,7 +62,7 @@ function prepare_image_files() { filename=$(basename "${image}").tar image_path="${IMAGE_DIR}/${filename}" md5_filename=$(basename "${image}").md5 - md5_path=${IMAGE_DIR}/${md5_filename} + md5_path="${IMAGE_DIR}/${md5_filename}" image_id=$(docker inspect -f "{{.ID}}" "${image}") saved_id="" @@ -102,4 +102,4 @@ function main() { if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then main -fi +fi \ No newline at end of file diff --git a/scripts/2_install_docker.sh b/scripts/2_install_docker.sh index 894652b8..888def45 100755 --- a/scripts/2_install_docker.sh +++ b/scripts/2_install_docker.sh @@ -13,15 +13,15 @@ function copy_docker() { if [[ ! -d "/usr/local/bin" ]]; then mkdir -p /usr/local/bin fi - \cp -f ./docker/* /usr/local/bin/ - \cp -f ./docker.service /etc/systemd/system/ + \cp -f ${BASE_DIR}/docker/* /usr/local/bin/ + \cp -f ${BASE_DIR}/docker.service /etc/systemd/system/ } function install_docker() { - if [[ ! -f ./docker/dockerd ]]; then + if [[ ! -f ${BASE_DIR}/docker/dockerd ]]; then prepare_docker_bin fi - if [[ ! -f ./docker/dockerd ]]; then + if [[ ! -f ${BASE_DIR}/docker/dockerd ]]; then echo_red "Error: $(gettext 'Docker program does not exist')" exit 1 fi @@ -29,7 +29,7 @@ function install_docker() { docker_exist=1 docker_version_match=1 old_docker_md5=$(get_file_md5 /usr/local/bin/dockerd) - new_docker_md5=$(get_file_md5 ./docker/dockerd) + new_docker_md5=$(get_file_md5 ${BASE_DIR}/docker/dockerd) if [[ ! -f "/usr/local/bin/dockerd" ]]; then docker_exist=0 @@ -43,32 +43,30 @@ function install_docker() { } function install_compose() { - if [[ ! -f ./docker/docker-compose ]]; then + if [[ ! -f ${BASE_DIR}/docker/docker-compose ]]; then prepare_compose_bin fi old_docker_compose_md5=$(get_file_md5 /usr/local/libexec/docker/cli-plugins/docker-compose) - new_docker_compose_md5=$(get_file_md5 ./docker/docker-compose) + new_docker_compose_md5=$(get_file_md5 ${BASE_DIR}/docker/docker-compose) if [[ ! -f "/usr/local/libexec/docker/cli-plugins/docker-compose" || "${old_docker_compose_md5}" != "${new_docker_compose_md5}" ]]; then if [[ ! -d "/usr/local/libexec/docker/cli-plugins" ]]; then mkdir -p /usr/local/libexec/docker/cli-plugins fi - \cp -f ./docker/docker-compose /usr/local/libexec/docker/cli-plugins/ - chmod +x /usr/local/libexec/docker/cli-plugins/docker-compose + \cp -f ${BASE_DIR}/docker/docker-compose /usr/local/libexec/docker/cli-plugins/ fi } function install_compose_home() { - if [[ ! -f ./docker/docker-compose ]]; then + if [[ ! -f ${BASE_DIR}/docker/docker-compose ]]; then prepare_compose_bin fi old_docker_compose_md5=$(get_file_md5 $HOME/.docker/cli-plugins/docker-compose) - new_docker_compose_md5=$(get_file_md5 ./docker/docker-compose) + new_docker_compose_md5=$(get_file_md5 ${BASE_DIR}/docker/docker-compose) if [[ ! -f "$HOME/.docker/cli-plugins/docker-compose" || "${old_docker_compose_md5}" != "${new_docker_compose_md5}" ]]; then if [[ ! -d "$HOME/.docker/cli-plugins" ]]; then mkdir -p $HOME/.docker/cli-plugins fi - \cp -f ./docker/docker-compose $HOME/.docker/cli-plugins/ - chmod +x $HOME/.docker/cli-plugins/docker-compose + \cp -f ${BASE_DIR}/docker/docker-compose $HOME/.docker/cli-plugins/ fi } diff --git a/scripts/7_upgrade.sh b/scripts/7_upgrade.sh index 1fd632ed..a77c55bb 100644 --- a/scripts/7_upgrade.sh +++ b/scripts/7_upgrade.sh @@ -24,7 +24,7 @@ function upgrade_config() { log_error "$(gettext 'Docker is not running, please install and start')" exit 1 fi - local containers=("jms_guacamole" "jms_lina" "jms_luna" "jms_nginx" "jms_xpack" "jms_lb" "jms_omnidb") + local containers=("jms_guacamole" "jms_lina" "jms_luna" "jms_nginx" "jms_xpack" "jms_lb" "jms_omnidb" "jms_kael" "jms_magnus") for container in "${containers[@]}"; do if docker ps -a | grep ${container} &>/dev/null; then docker stop ${container} &>/dev/null @@ -262,6 +262,7 @@ function main() { fi echo update_config_if_need + echo check_compose_install echo_yellow "\n2. $(gettext 'Loading Docker Image')" diff --git a/scripts/utils.sh b/scripts/utils.sh index d891e1bb..1ad6435f 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -488,7 +488,6 @@ function prepare_config() { if [[ "$(uname -m)" == "aarch64" ]]; then sed -i "s/# ignore-warnings ARM64-COW-BUG/ignore-warnings ARM64-COW-BUG/g" "${CONFIG_DIR}/redis/redis.conf" fi - echo_done } function echo_logo() { From 818d29f1401922a29f383bc6e82cc125433104a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 21 May 2024 12:07:26 +0800 Subject: [PATCH 21/36] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20prepare.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/0_prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/0_prepare.sh b/scripts/0_prepare.sh index 0f5c3fbf..52cc6e55 100644 --- a/scripts/0_prepare.sh +++ b/scripts/0_prepare.sh @@ -25,7 +25,7 @@ function prepare_docker_bin() { exit 1 } chown -R root:root "${BASE_DIR}/docker" - chmod +x "${BASE_DIR}/docker/*" + chmod +x ${BASE_DIR}/docker/* } function prepare_compose_bin() { From e9c98a3e10c5ecbd29d956ed1a66afae56902522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 29 May 2024 12:14:15 +0800 Subject: [PATCH 22/36] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=20ip=20=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 10 +++++----- scripts/utils.sh | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index c45b12cd..5ea6beb8 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -43,19 +43,19 @@ if [[ "$(uname -m)" == "s390x" ]]; then fi export DOCKER_MD5 -export DOCKER_COMPOSE_VERSION=v2.27.0 +export DOCKER_COMPOSE_VERSION=v2.27.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=891a283d0e11bbff04b8347d7611500a + DOCKER_COMPOSE_MD5=24120814a7df4f78aca2a31b17067e64 fi if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_COMPOSE_MD5=798dde95d63ebff0e92d986848848967 + DOCKER_COMPOSE_MD5=553e16f35beca0e3ee09425db7ceb546 fi if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_COMPOSE_MD5=83f554dafd26e6892d1a4c73ea95bc12 + DOCKER_COMPOSE_MD5=af46b5338ec398e2d1c3b68f6e7ace2e fi if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_COMPOSE_MD5=f7cbe603e2a0b8921f392549a6480a1a + DOCKER_COMPOSE_MD5=ef119360c5f1a0d4dc9c10bef5e9c1b7 fi export DOCKER_COMPOSE_MD5 diff --git a/scripts/utils.sh b/scripts/utils.sh index 1ad6435f..23bd3897 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -681,11 +681,14 @@ function installation_log() { } function get_host_ip() { - host=$(command -v ip &>/dev/null && ip addr | grep 'state UP' -A2 | grep inet | grep -Ev '(127.0.0.1|inet6|docker)' | awk '{print $2}' | tr -d "addr:" | head -n 1 | cut -d / -f1) + local default_ip="127.0.0.1" + host=$(command -v hostname &>/dev/null && hostname -I | cut -d ' ' -f1) if [ ! "${host}" ]; then - host=$(hostname -I | cut -d ' ' -f1) + host=$(command -v ip &>/dev/null && ip addr | grep 'inet ' | grep -Ev '(127.0.0.1|inet6|docker)' | awk '{print $2}' | head -n 1 | cut -d / -f1) fi if [[ ${host} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "${host}" + else + echo "${default_ip}" fi } From 31f24346f13fcece0999e4aa85f5106e5cd8d7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 31 May 2024 11:27:36 +0800 Subject: [PATCH 23/36] =?UTF-8?q?feat:=20=E9=AA=8C=E8=AF=81=20postgresql?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/init-db.yml | 2 +- compose/postgres.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compose/init-db.yml b/compose/init-db.yml index 20c00fae..de778f65 100644 --- a/compose/init-db.yml +++ b/compose/init-db.yml @@ -3,7 +3,7 @@ services: image: ${REGISTRY:-docker.io}/jumpserver/core:${VERSION} container_name: jms_core hostname: jms_core - command: sleep + command: "tail -f /dev/null" env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/postgres.yml b/compose/postgres.yml index 9b394f68..ff186296 100644 --- a/compose/postgres.yml +++ b/compose/postgres.yml @@ -1,6 +1,6 @@ services: postgresql: - image: postgres:16.2-bullseye + image: postgres:16.3-bullseye container_name: jms_postgresql restart: always environment: From fad9a09aefdfbef07bb5a0ce02e047af76610ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 5 Jun 2024 17:55:49 +0800 Subject: [PATCH 24/36] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20postgres=20?= =?UTF-8?q?=E9=95=9C=E5=83=8F=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 2 ++ scripts/utils.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..b810e316 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=lf \ No newline at end of file diff --git a/scripts/utils.sh b/scripts/utils.sh index 23bd3897..2a5a0c6a 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -131,7 +131,7 @@ function get_db_info() { elif [[ "${mariadb_data_exists}" == "1" ]]; then echo "mariadb:10.6" else - echo "postgres:16.2-bullseye" + echo "postgres:16.3-bullseye" fi ;; "file") From cf7985b065c5f057ff106c97fbe47031fc9b506d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 7 Jun 2024 17:37:53 +0800 Subject: [PATCH 25/36] perf: translation config --- config-example.txt | 100 ++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/config-example.txt b/config-example.txt index 86d8827d..d03ccde3 100644 --- a/config-example.txt +++ b/config-example.txt @@ -1,57 +1,57 @@ # JumpServer configuration file example. # -# 如果不了解用途可以跳过修改此配置文件, 系统会自动填入 -# 完整参数文档 https://docs.jumpserver.org/zh/v3/guide/env/ +# If you don't understand the purpose, you can skip modifying this configuration file, the system will automatically fill in +# Complete parameter documentation https://docs.jumpserver.org/zh/v3/guide/env/ -################################## 镜像配置 ################################### +################################# Image Configuration ################################# # -# 国内连接 docker.io 会超时或下载速度较慢, 开启此选项使用华为云镜像加速 -# 取代旧版本 DOCKER_IMAGE_PREFIX +# The connection to docker.io in China will timeout or the download speed will be slow, enable this option to use Huawei Cloud image acceleration +# Replace the old version DOCKER_IMAGE_PREFIX # # DOCKER_IMAGE_MIRROR=1 -# 镜像拉取规则 Always, IfNotPresent -# Always 表示每次都会拉取最新镜像, IfNotPresent 表示本地不存在镜像时才会拉取 +# Image pull policy Always, IfNotPresent +# Always means that the latest image will be pulled every time, IfNotPresent means that the image will be pulled only if it does not exist locally # # IMAGE_PULL_POLICY=Always -################################## 安装配置 ################################### +############################## Installation Configuration ############################# # -# JumpServer 数据库持久化目录, 默认情况下录像、任务日志都在此目录 -# 请根据实际情况修改, 升级时备份的数据库文件(.sql)和配置文件也会保存到该目录 +# JumpServer database persistence directory, by default, recordings, task logs are in this directory +# Please modify according to the actual situation, the database file (.sql) and configuration file backed up during the upgrade will also be saved to this directory # VOLUME_DIR=/data/jumpserver -# 加密密钥, 迁移请保证 SECRET_KEY 与旧环境一致, 请勿使用特殊字符串 +# Encryption key, please ensure that SECRET_KEY is consistent with the old environment when migrating, do not use special strings # (*) Warning: Keep this value secret. -# (*) 勿向任何人泄露 SECRET_KEY +# (*) Do not disclose SECRET_KEY to anyone # SECRET_KEY= -# 组件向 core 注册使用的 token, 迁移请保持 BOOTSTRAP_TOKEN 与旧环境一致, -# 请勿使用特殊字符串 +# The token used by the component to register with core, please keep BOOTSTRAP_TOKEN consistent with the old environment when migrating, +# Do not use special strings # (*) Warning: Keep this value secret. -# (*) 勿向任何人泄露 BOOTSTRAP_TOKEN +# (*) Do not disclose BOOTSTRAP_TOKEN to anyone # BOOTSTRAP_TOKEN= -# 日志等级 INFO, WARN, ERROR +# Log level INFO, WARN, ERROR # LOG_LEVEL=ERROR -# JumpServer 容器使用的网段, 请勿与现有的网络冲突, 根据实际情况自行修改 +# The network segment used by the JumpServer container, please do not conflict with the existing network, modify according to the actual situation # DOCKER_SUBNET=192.168.250.0/24 -# ipv6 nat, 正常情况下无需开启 -# 如果宿主不支持 ipv6 开启此选项将会导致无法获取真实的客户端 ip 地址 +# ipv6 nat, no need to enable under normal circumstances +# If the host does not support ipv6, enabling this option will prevent the real client ip address from being obtained # USE_IPV6=0 DOCKER_SUBNET_IPV6=fc00:1010:1111:200::/64 -################################# DB 配置 ################################## -# 外置数据库需要输入正确的数据库信息, 内置数据库系统会自动处理 -# (*) 密码部分不得包含单引号和双引号 +################################# DB Configuration #################################### +# For external databases, you need to enter the correct database information, the system will automatically handle the built-in database +# (*) The password part must not contain single quotes and double quotes # DB_ENGINE=postgresql DB_HOST=postgresql @@ -60,36 +60,36 @@ DB_USER=postgres DB_PASSWORD= DB_NAME=jumpserver -# 如果外置 MySQL 需要开启 TLS/SSL 连接, 参考 https://docs.jumpserver.org/zh/v3/installation/security_setup/mysql_ssl/ +# If external MySQL needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/mysql_ssl/ # # DB_USE_SSL=true -################################# Redis 配置 ################################## -# 外置 Redis 需要请输入正确的 Redis 信息, 内置 Redis 系统会自动处理 -# (*) 密码部分不得包含单引号和双引号 +################################# Redis Configuration ################################# +# For external Redis, please enter the correct Redis information, the system will automatically handle the built-in Redis +# (*) The password part must not contain single quotes and double quotes # REDIS_HOST=redis REDIS_PORT=6379 REDIS_PASSWORD= -# 如果使用外置 Redis Sentinel, 请手动填写下面内容 +# If you are using external Redis Sentinel, please manually fill in the following content # # REDIS_SENTINEL_HOSTS=mymaster/192.168.100.1:26379,192.168.100.1:26380,192.168.100.1:26381 # REDIS_SENTINEL_PASSWORD=your_sentinel_password # REDIS_PASSWORD=your_redis_password # REDIS_SENTINEL_SOCKET_TIMEOUT=5 -# 如果外置 Redis 需要开启 TLS/SSL 连接, 参考 https://docs.jumpserver.org/zh/v3/installation/security_setup/redis_ssl/ +# If external Redis needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/redis_ssl/ # # REDIS_USE_SSL=true -################################## 访问配置 ################################### -# 对外提供服务端口, 如果与现有服务冲突请自行修改 +################################# Access Configuration ################################ +# The service port provided to the outside, if it conflicts with the existing service, please modify it yourself # HTTP_PORT=80 -################################# HTTPS 配置 ################################# -# 参考 https://docs.jumpserver.org/zh/v3/installation/proxy/ 配置 +################################# HTTPS Configuration ################################# +# Refer to https://docs.jumpserver.org/zh/v3/installation/proxy/ for configuration # # HTTPS_PORT=443 # SERVER_NAME=your_domain_name @@ -97,31 +97,31 @@ HTTP_PORT=80 # SSL_CERTIFICATE_KEY=your_cert_key # -# Nginx 文件上传下载大小限制 +# Nginx file upload and download size limit # CLIENT_MAX_BODY_SIZE=4096m -################################## 组件配置 ################################### -# 组件注册使用, 默认情况下向 core 容器注册, 集群环境需要修改为集群 vip 地址 +################################# Component Configuration ############################# +# Component registration use, by default, register to the core container, the cluster environment needs to be modified to the cluster vip address # CORE_HOST=http://core:8080 PERIOD_TASK_ENABLED=true -# Core Session 定义, -# SESSION_COOKIE_AGE 表示闲置多少秒后 session 过期, -# SESSION_EXPIRE_AT_BROWSER_CLOSE=true 表示关闭浏览器即 session 过期 +# Core Session definition, +# SESSION_COOKIE_AGE indicates how many seconds the session expires after idling, +# SESSION_EXPIRE_AT_BROWSER_CLOSE=true means that the session expires as soon as the browser is closed # # SESSION_COOKIE_AGE=86400 SESSION_EXPIRE_AT_BROWSER_CLOSE=false -# 可信任 DOMAINS 定义, -# 定义可信任的访问 IP, 请根据实际情况修改, 如果是公网 IP 请改成对应的公网 IP, +# Trusted DOMAINS definition, +# Define the trusted access IP, please modify according to the actual situation, if it is a public IP, please change to the corresponding public IP, # DOMAINS="demo.jumpserver.org:443" # DOMAINS="172.17.200.191:80" # DOMAINS="demo.jumpserver.org:443,172.17.200.191:80" DOMAINS= -# 配置不需要启动的组件, 默认所有组件都会开启, 如果不需要某个组件可以通过设置 {组件名称}_ENABLED 为 0 关闭 +# Configure the components that do not need to be started, by default all components will be started, if you do not need a certain component, you can set {component name}_ENABLED to 0 to turn it off # CORE_ENABLED=0 # CELERY_ENABLED=0 # KOKO_ENABLED=0 @@ -129,12 +129,12 @@ DOMAINS= # CHEN_ENABLED=0 # WEB_ENABLED=0 -# Lion 开启字体平滑, 优化体验 +# Lion enables font smoothing to optimize the experience # JUMPSERVER_ENABLE_FONT_SMOOTHING=true -################################# XPack 配置 ################################# -# XPack 包, 开源版本设置无效 +################################# XPack Configuration ################################# +# XPack package, invalid setting in open source version # SSH_PORT=2222 RDP_PORT=3389 @@ -146,17 +146,17 @@ MAGNUS_POSTGRESQL_PORT=54320 MAGNUS_SQLSERVER_PORT=14330 MAGNUS_ORACLE_PORTS=30000-30030 -################################## 其他配置 ################################## -# 终端使用宿主 HOSTNAME 标识, 首次安装自动生成 +################################## Other Configuration ################################ +# The terminal uses the host HOSTNAME as the identifier, automatically generated during the first installation # SERVER_HOSTNAME=${HOSTNAME} -# 使用内置 SLB, 如果 Web 页面获取到的客户端 IP 地址不正确, 请将 USE_LB 设置为 0 -# USE_LB 设置为 1 时, 使用配置 proxy_set_header X-Forwarded-For $remote_addr -# USE_LB 设置为 0 时, 使用配置 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for +# Use built-in SLB, if the client IP address obtained by the Web page is not correct, please set USE_LB to 0 +# When USE_LB is set to 1, use the configuration proxy_set_header X-Forwarded-For $remote_addr +# When USE_LB is set to 0, use the configuration proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for USE_LB=1 -# 当前运行的 JumpServer 版本号, 安装和升级完成后自动生成 +# The current running version number of JumpServer, automatically generated after installation and upgrade # TZ=Asia/Shanghai CURRENT_VERSION= \ No newline at end of file From 9dacbcc7054e5ff64e24a40ad421e7faa6913cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 12 Jun 2024 16:26:48 +0800 Subject: [PATCH 26/36] feat: Support cross architecture offline packages --- scripts/const.sh | 61 ++++++++++++++++++++++++++---------------------- scripts/utils.sh | 25 ++++++++++++++++++-- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index 5ea6beb8..bd4ea4ad 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,36 +26,41 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.1.3 +export DOCKER_VERSION=26.1.4 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" -export DOCKER_BIN_URL="${DOCKER_MIRROR}/$(uname -m)/docker-${DOCKER_VERSION}.tgz" -if [[ "$(uname -m)" == "x86_64" ]]; then - DOCKER_MD5=0d5deaa475b93915cf3eb36e51d12d18 -fi -if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_MD5=ba57d12516d0ca55debf0a60b49cc975 -fi -if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_MD5=897ec1f0700bcf82b02d31271b5dc23c -fi -if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_MD5=95f0111c2d70a7c32fdc4526cef8b6a1 -fi -export DOCKER_MD5 export DOCKER_COMPOSE_VERSION=v2.27.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=24120814a7df4f78aca2a31b17067e64 -fi -if [[ "$(uname -m)" == "aarch64" ]]; then - DOCKER_COMPOSE_MD5=553e16f35beca0e3ee09425db7ceb546 -fi -if [[ "$(uname -m)" == "loongarch64" ]]; then - DOCKER_COMPOSE_MD5=af46b5338ec398e2d1c3b68f6e7ace2e -fi -if [[ "$(uname -m)" == "s390x" ]]; then - DOCKER_COMPOSE_MD5=ef119360c5f1a0d4dc9c10bef5e9c1b7 + +ARCH=$(uname -m) +if [ -n "${BUILD_ARCH}" ]; then + ARCH=${BUILD_ARCH} fi -export DOCKER_COMPOSE_MD5 + +export ARCH + +# 使用 case 语句处理不同的架构 +case "${ARCH}" in + "x86_64") + DOCKER_MD5=99ba6d75fe9972405083b2bd911fd37b + DOCKER_COMPOSE_MD5=24120814a7df4f78aca2a31b17067e64 + ;; + "aarch64") + DOCKER_MD5=eac2f5b6ad2c29d1ca46d22b29c5edd3 + DOCKER_COMPOSE_MD5=553e16f35beca0e3ee09425db7ceb546 + ;; + "loongarch64") + DOCKER_MD5=a3d5d528210cd29872622513c6533078 + DOCKER_COMPOSE_MD5=af46b5338ec398e2d1c3b68f6e7ace2e + ;; + "s390x") + DOCKER_MD5=2b910e8455d36aa3f6733c7c43126200 + DOCKER_COMPOSE_MD5=ef119360c5f1a0d4dc9c10bef5e9c1b7 + ;; +esac + +export DOCKER_MD5 +export DOCKER_BIN_URL="${DOCKER_MIRROR}/${ARCH}/docker-${DOCKER_VERSION}.tgz" + +export DOCKER_COMPOSE_BIN_URL="${DOCKER_COMPOSE_MIRROR}/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-${ARCH}" +export DOCKER_COMPOSE_MD5 \ No newline at end of file diff --git a/scripts/utils.sh b/scripts/utils.sh index 2a5a0c6a..64b92700 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -603,6 +603,9 @@ function pull_image() { if [[ "$(uname -m)" == "loongarch64" ]]; then DOCKER_IMAGE_PREFIX="swr.cn-southwest-2.myhuaweicloud.com" fi + if [[ "$(uname -m)" == "s390x" ]]; then + DOCKER_IMAGE_PREFIX="swr.sa-brazil-1.myhuaweicloud.com" + fi else DOCKER_IMAGE_PREFIX=$(get_config_or_env 'DOCKER_IMAGE_PREFIX') fi @@ -620,13 +623,31 @@ function pull_image() { return fi + pull_args="" + if [[ -n "${BUILD_ARCH}" ]]; then + case "${BUILD_ARCH}" in + "x86_64") + pull_args="--platform linux/amd64" + ;; + "aarch64") + pull_args="--platform linux/arm64" + ;; + "loongarch64") + pull_args="--platform linux/loong64" + ;; + "s390x") + pull_args="--platform linux/s390x" + ;; + esac + fi + echo "[${image}] pulling" if [[ -n "${DOCKER_IMAGE_PREFIX}" && $(image_has_prefix "${image}") == "1" ]]; then - docker pull "${DOCKER_IMAGE_PREFIX}/${image}" + docker pull ${pull_args} "${DOCKER_IMAGE_PREFIX}/${image}" docker tag "${DOCKER_IMAGE_PREFIX}/${image}" "${image}" docker rmi -f "${DOCKER_IMAGE_PREFIX}/${image}" else - docker pull "${image}" + docker pull ${pull_args} "${image}" fi echo "" } From 00f64273e64cccd3ffcad6f4953a288a60097bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 19 Jun 2024 17:12:11 +0800 Subject: [PATCH 27/36] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=20razor=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/web.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/compose/web.yml b/compose/web.yml index 445f8a1d..2c282043 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -11,6 +11,7 @@ services: HTTP_PORT: ${HTTP_PORT:-80} USE_LB: ${USE_LB:-1} USE_IPV6: ${USE_IPV6:-0} + USE_XPACK: ${USE_XPACK:-0} CLIENT_MAX_BODY_SIZE: ${CLIENT_MAX_BODY_SIZE:-4096m} CORE_ENABLED: ${CORE_ENABLED:-1} KOKO_ENABLED: ${KOKO_ENABLED:-1} From 80e44769bec2d86bc955afd2d29d0b082781ef55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Thu, 20 Jun 2024 13:13:13 +0800 Subject: [PATCH 28/36] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=20razor=20?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/web.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/web.yml b/compose/web.yml index 2c282043..3021e62b 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -18,7 +18,7 @@ services: LION_ENABLED: ${LION_ENABLED:-1} CHEN_ENABLED: ${CHEN_ENABLED:-1} KAEL_ENABLED: ${KAEL_ENABLED:-0} - RAZOR_ENABLED: ${RAZOR_ENABLED:-0} + RAZOR_ENABLED: ${RAZOR_ENABLED:-1} ports: - ${HTTP_PORT:-80}:${HTTP_PORT:-80} volumes: From 6c785827a3233dea6ed016964199c7dc0af0c839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 17 Jun 2024 11:31:07 +0800 Subject: [PATCH 29/36] feat: celery use privileged --- compose/docker-compose-celery.yml | 2 +- compose/docker-compose-chen.yml | 1 - compose/docker-compose-core.yml | 1 - compose/docker-compose-init-db.yml | 1 - compose/docker-compose-kael.yml | 1 - compose/docker-compose-koko.yml | 4 ++-- compose/docker-compose-lion.yml | 1 - compose/docker-compose-magnus.yml | 1 - compose/docker-compose-panda.yml | 1 - compose/docker-compose-razor.yml | 1 - compose/docker-compose-receptor.yml | 1 - compose/docker-compose-video-worker.yml | 1 - compose/docker-compose-video.yml | 1 - compose/docker-compose-web.yml | 1 - compose/docker-compose-xrdp.yml | 1 - 15 files changed, 3 insertions(+), 16 deletions(-) diff --git a/compose/docker-compose-celery.yml b/compose/docker-compose-celery.yml index a5921097..5532f766 100644 --- a/compose/docker-compose-celery.yml +++ b/compose/docker-compose-celery.yml @@ -6,7 +6,7 @@ services: ulimits: core: 0 restart: always - tty: true + privileged: true command: start task env_file: - ${CONFIG_FILE} diff --git a/compose/docker-compose-chen.yml b/compose/docker-compose-chen.yml index fbf6d2fb..cc4b59ef 100644 --- a/compose/docker-compose-chen.yml +++ b/compose/docker-compose-chen.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/docker-compose-core.yml b/compose/docker-compose-core.yml index d684c26c..1c99308e 100644 --- a/compose/docker-compose-core.yml +++ b/compose/docker-compose-core.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true command: start web env_file: - ${CONFIG_FILE} diff --git a/compose/docker-compose-init-db.yml b/compose/docker-compose-init-db.yml index 991ad635..caec6c6a 100644 --- a/compose/docker-compose-init-db.yml +++ b/compose/docker-compose-init-db.yml @@ -3,7 +3,6 @@ services: image: ${REGISTRY:-docker.io}/jumpserver/core-ce:${VERSION} container_name: jms_core hostname: jms_core - tty: true command: sleep env_file: - ${CONFIG_FILE} diff --git a/compose/docker-compose-kael.yml b/compose/docker-compose-kael.yml index c91ab3c4..ce267c57 100644 --- a/compose/docker-compose-kael.yml +++ b/compose/docker-compose-kael.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/docker-compose-koko.yml b/compose/docker-compose-koko.yml index 4fd54869..ff3887f3 100644 --- a/compose/docker-compose-koko.yml +++ b/compose/docker-compose-koko.yml @@ -6,7 +6,7 @@ services: ulimits: core: 0 restart: always - tty: true + privileged: true env_file: - ${CONFIG_FILE} environment: @@ -16,7 +16,7 @@ services: volumes: - ${CONFIG_DIR}/certs:/opt/koko/data/certs - ${VOLUME_DIR}/koko/data:/opt/koko/data - privileged: true + healthcheck: test: "curl -fsL http://localhost:5000/koko/health/ > /dev/null" interval: 10s diff --git a/compose/docker-compose-lion.yml b/compose/docker-compose-lion.yml index 31a7a2e3..13ad2182 100644 --- a/compose/docker-compose-lion.yml +++ b/compose/docker-compose-lion.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/docker-compose-magnus.yml b/compose/docker-compose-magnus.yml index 833e85b3..72bc4874 100644 --- a/compose/docker-compose-magnus.yml +++ b/compose/docker-compose-magnus.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: diff --git a/compose/docker-compose-panda.yml b/compose/docker-compose-panda.yml index 8f0cc794..1b26bceb 100644 --- a/compose/docker-compose-panda.yml +++ b/compose/docker-compose-panda.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/docker-compose-razor.yml b/compose/docker-compose-razor.yml index 5625d224..1b5a9410 100644 --- a/compose/docker-compose-razor.yml +++ b/compose/docker-compose-razor.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: diff --git a/compose/docker-compose-receptor.yml b/compose/docker-compose-receptor.yml index d55ba7f0..65a6d250 100644 --- a/compose/docker-compose-receptor.yml +++ b/compose/docker-compose-receptor.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true command: start receptor environment: LOG_LEVEL: ${LOG_LEVEL} diff --git a/compose/docker-compose-video-worker.yml b/compose/docker-compose-video-worker.yml index c79fe93c..b1e35b71 100644 --- a/compose/docker-compose-video-worker.yml +++ b/compose/docker-compose-video-worker.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: diff --git a/compose/docker-compose-video.yml b/compose/docker-compose-video.yml index cc59c52b..547df76b 100644 --- a/compose/docker-compose-video.yml +++ b/compose/docker-compose-video.yml @@ -7,7 +7,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} volumes: diff --git a/compose/docker-compose-web.yml b/compose/docker-compose-web.yml index 328d0979..de678b2e 100644 --- a/compose/docker-compose-web.yml +++ b/compose/docker-compose-web.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true environment: HTTP_PORT: ${HTTP_PORT:-80} USE_LB: ${USE_LB:-1} diff --git a/compose/docker-compose-xrdp.yml b/compose/docker-compose-xrdp.yml index d53d6449..1020e163 100644 --- a/compose/docker-compose-xrdp.yml +++ b/compose/docker-compose-xrdp.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true env_file: - ${CONFIG_FILE} ports: From 24ede963b468cb692bc03cf9ccf3ba97b9ff76d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 17 Jun 2024 11:34:10 +0800 Subject: [PATCH 30/36] feat: celery use privileged --- compose/celery.yml | 1 + compose/receptor.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/celery.yml b/compose/celery.yml index 221233a0..fd86e87a 100644 --- a/compose/celery.yml +++ b/compose/celery.yml @@ -6,6 +6,7 @@ services: ulimits: core: 0 restart: always + privileged: true command: start task env_file: - ${CONFIG_FILE} diff --git a/compose/receptor.yml b/compose/receptor.yml index c9451290..d3ef74bc 100644 --- a/compose/receptor.yml +++ b/compose/receptor.yml @@ -6,7 +6,6 @@ services: ulimits: core: 0 restart: always - tty: true command: start receptor environment: LOG_LEVEL: ${LOG_LEVEL} From cd6086cc593d5f5d993ee8e89a45326a6cc1d765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 24 Jun 2024 08:11:58 +0800 Subject: [PATCH 31/36] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20compose=20v2?= =?UTF-8?q?.28.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/const.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index bd4ea4ad..cc986b33 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -29,7 +29,7 @@ export OS=$(uname -s) export DOCKER_VERSION=26.1.4 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" -export DOCKER_COMPOSE_VERSION=v2.27.1 +export DOCKER_COMPOSE_VERSION=v2.28.0 export DOCKER_COMPOSE_MIRROR="https://download.jumpserver.org/docker/compose/releases/download" ARCH=$(uname -m) @@ -43,24 +43,24 @@ export ARCH case "${ARCH}" in "x86_64") DOCKER_MD5=99ba6d75fe9972405083b2bd911fd37b - DOCKER_COMPOSE_MD5=24120814a7df4f78aca2a31b17067e64 + DOCKER_COMPOSE_MD5=fa5fe3bca5d12435d07e05ad53cf55a6 ;; "aarch64") DOCKER_MD5=eac2f5b6ad2c29d1ca46d22b29c5edd3 - DOCKER_COMPOSE_MD5=553e16f35beca0e3ee09425db7ceb546 + DOCKER_COMPOSE_MD5=7f270f803805c8a72033c5186b0f3b84 ;; "loongarch64") DOCKER_MD5=a3d5d528210cd29872622513c6533078 - DOCKER_COMPOSE_MD5=af46b5338ec398e2d1c3b68f6e7ace2e + DOCKER_COMPOSE_MD5=38530057002b8517759262e501869adb ;; "s390x") DOCKER_MD5=2b910e8455d36aa3f6733c7c43126200 - DOCKER_COMPOSE_MD5=ef119360c5f1a0d4dc9c10bef5e9c1b7 + DOCKER_COMPOSE_MD5=610fc7074048f122e1b23752ba612f3a ;; esac export DOCKER_MD5 export DOCKER_BIN_URL="${DOCKER_MIRROR}/${ARCH}/docker-${DOCKER_VERSION}.tgz" -export DOCKER_COMPOSE_BIN_URL="${DOCKER_COMPOSE_MIRROR}/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-${ARCH}" -export DOCKER_COMPOSE_MD5 \ No newline at end of file +export DOCKER_COMPOSE_MD5 +export DOCKER_COMPOSE_BIN_URL="${DOCKER_COMPOSE_MIRROR}/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-${ARCH}" \ No newline at end of file From 799ce50fc105c5edfa803374d0322c86209ad520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 25 Jun 2024 18:31:16 +0800 Subject: [PATCH 32/36] perf: Upgrade utils.sh --- scripts/utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.sh b/scripts/utils.sh index 64b92700..aa4a510f 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -26,7 +26,7 @@ function random_str() { uuid="" if check_root && command -v dmidecode &>/dev/null; then if [[ ${len} -gt 24 ]]; then - uuid=$(dmidecode -t 1 | grep UUID | awk '{print $2}' | sha256sum | awk '{print $1}' | head -c ${len}) + uuid=$(dmidecode -s system-uuid | sha256sum | awk '{print $1}' | head -c ${len}) fi fi if [[ "${#uuid}" == "${len}" ]]; then From 51e418d03b994385353cd7940158a050f65f7e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Thu, 27 Jun 2024 09:44:38 +0800 Subject: [PATCH 33/36] feat: Fix default password --- scripts/4_install_jumpserver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/4_install_jumpserver.sh b/scripts/4_install_jumpserver.sh index 12ee307b..6fb4767b 100644 --- a/scripts/4_install_jumpserver.sh +++ b/scripts/4_install_jumpserver.sh @@ -47,7 +47,7 @@ function post_install() { echo "http://${host}:${http_port}" fi - echo "$(gettext 'Default username'): admin $(gettext 'Default password'): admin" + echo "$(gettext 'Default username'): admin $(gettext 'Default password'): ChangeMe" if [[ "${use_xpack}" == "1" ]]; then echo_yellow "\n4. SSH/SFTP $(gettext 'access')" From bb9cd312e0b3baa4ab901fd46833987637b3c90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 28 Jun 2024 08:24:32 +0800 Subject: [PATCH 34/36] perf: migrate db image --- scripts/7_upgrade.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/7_upgrade.sh b/scripts/7_upgrade.sh index a77c55bb..7ba1b9fa 100644 --- a/scripts/7_upgrade.sh +++ b/scripts/7_upgrade.sh @@ -31,6 +31,12 @@ function upgrade_config() { docker rm ${container} &>/dev/null fi done + local images=("jumpserver/mariadb:10.6" "jumpserver/mysql:5.7") + for image in "${images[@]}"; do + if docker image inspect -f '{{.Id}}' ${image} &>/dev/null; then + docker tag ${image} ${image#*/} + fi + done if docker ps -a | grep jms_xpack &>/dev/null; then docker volume rm jms_share-volume &>/dev/null fi From 10d010bc4b20c1b2bd779e9e7bf1365b97ad3dba Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 3 Jul 2024 12:57:31 +0800 Subject: [PATCH 35/36] perf: fix loki config --- config_init/loki/loki.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_init/loki/loki.yaml b/config_init/loki/loki.yaml index 99cdb86f..cbecef6b 100644 --- a/config_init/loki/loki.yaml +++ b/config_init/loki/loki.yaml @@ -17,7 +17,7 @@ common: schema_config: configs: - from: 2020-10-24 - store: boltdb-shipper + store: tsdb object_store: filesystem schema: v13 index: From 822c1d6c3eef7fc2ebc542e7187c153b3ea37de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 3 Jul 2024 15:43:30 +0800 Subject: [PATCH 36/36] feat: bump docker from 26.1.4 to 27.0.3 --- scripts/const.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/const.sh b/scripts/const.sh index cc986b33..6251f1b6 100644 --- a/scripts/const.sh +++ b/scripts/const.sh @@ -26,10 +26,10 @@ STATIC_ENV=${PROJECT_DIR}/static.env . "${STATIC_ENV}" export OS=$(uname -s) -export DOCKER_VERSION=26.1.4 +export DOCKER_VERSION=27.0.3 export DOCKER_MIRROR="https://download.jumpserver.org/docker/docker-ce/linux/static/stable" -export DOCKER_COMPOSE_VERSION=v2.28.0 +export DOCKER_COMPOSE_VERSION=v2.28.1 export DOCKER_COMPOSE_MIRROR="https://download.jumpserver.org/docker/compose/releases/download" ARCH=$(uname -m) @@ -42,20 +42,20 @@ export ARCH # 使用 case 语句处理不同的架构 case "${ARCH}" in "x86_64") - DOCKER_MD5=99ba6d75fe9972405083b2bd911fd37b - DOCKER_COMPOSE_MD5=fa5fe3bca5d12435d07e05ad53cf55a6 + DOCKER_MD5=f2dd63a7ec8d56b3b4fad28c59967f5c + DOCKER_COMPOSE_MD5=9f03db8f978af10dc4c6913c60cbabd8 ;; "aarch64") - DOCKER_MD5=eac2f5b6ad2c29d1ca46d22b29c5edd3 - DOCKER_COMPOSE_MD5=7f270f803805c8a72033c5186b0f3b84 + DOCKER_MD5=a6e096151704a89a8d3a2beb70e6bb6b + DOCKER_COMPOSE_MD5=593936c9bfddd61572194c849289bd34 ;; "loongarch64") - DOCKER_MD5=a3d5d528210cd29872622513c6533078 - DOCKER_COMPOSE_MD5=38530057002b8517759262e501869adb + DOCKER_MD5=a6bed0b96f12c14263ccea9a40d4961c + DOCKER_COMPOSE_MD5=65875721c20ad90b58a3b35387d1cd89 ;; "s390x") - DOCKER_MD5=2b910e8455d36aa3f6733c7c43126200 - DOCKER_COMPOSE_MD5=610fc7074048f122e1b23752ba612f3a + DOCKER_MD5=b303546b603ff472830ea9ff141c431b + DOCKER_COMPOSE_MD5=51a205076f33972e8995a0d9db1fbfab ;; esac