From 817c7681b7f749055846b1e5de49566dff64b338 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 16 Jan 2026 11:37:28 +0800 Subject: [PATCH] perf: revert to TZ --- compose/core.yml | 2 ++ compose/es.yml | 2 +- compose/mariadb.yml | 2 +- compose/minio.yml | 2 +- compose/mysql.yml | 2 +- compose/postgres.yml | 2 +- compose/redis.yml | 2 +- compose/web.yml | 2 +- config-example.txt | 2 +- scripts/1_config_jumpserver.sh | 4 ++-- scripts/7_upgrade.sh | 3 +-- 11 files changed, 13 insertions(+), 12 deletions(-) diff --git a/compose/core.yml b/compose/core.yml index c380abcb..4fb8428c 100644 --- a/compose/core.yml +++ b/compose/core.yml @@ -9,6 +9,8 @@ services: command: start web env_file: - ${CONFIG_FILE} + environment: + TIME_ZONE: ${TZ:-Asia/Shanghai} volumes: - ${CONFIG_DIR}/certs:/opt/jumpserver/data/certs - ${VOLUME_DIR}/core/data:/opt/jumpserver/data diff --git a/compose/es.yml b/compose/es.yml index ed206423..656527e2 100644 --- a/compose/es.yml +++ b/compose/es.yml @@ -11,7 +11,7 @@ services: - ${VOLUME_DIR}/elasticsearch/data:/usr/share/elasticsearch/data - ${VOLUME_DIR}/elasticsearch/logs:/usr/share/elasticsearch/logs environment: - TZ: ${TIME_ZONE:-Asia/Shanghai} + 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 6abc74f4..7002208b 100644 --- a/compose/mariadb.yml +++ b/compose/mariadb.yml @@ -5,7 +5,7 @@ services: restart: always command: --character-set-server=utf8 --collation-server=utf8_general_ci environment: - TZ: ${TIME_ZONE:-Asia/Shanghai} + 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 9c97aef0..39a0cc93 100644 --- a/compose/minio.yml +++ b/compose/minio.yml @@ -6,7 +6,7 @@ services: restart: always command: "server /data --console-address :9001" environment: - TZ: ${TIME_ZONE:-Asia/Shanghai} + TZ: ${TZ:-Asia/Shanghai} MINIO_ROOT_USER: minio MINIO_ROOT_PASSWORD: $BOOTSTRAP_TOKEN MINIO_REGION_NAME: us-west-rack2 diff --git a/compose/mysql.yml b/compose/mysql.yml index 48b7110a..5f5b0cd9 100644 --- a/compose/mysql.yml +++ b/compose/mysql.yml @@ -5,7 +5,7 @@ services: restart: always command: --character-set-server=utf8 environment: - TZ: ${TIME_ZONE:-Asia/Shanghai} + 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 index 76ba1a7c..19aa293c 100644 --- a/compose/postgres.yml +++ b/compose/postgres.yml @@ -4,7 +4,7 @@ services: container_name: jms_postgresql restart: always environment: - TZ: ${TIME_ZONE:-Asia/Shanghai} + TZ: ${TZ:-Asia/Shanghai} POSTGRES_DB: $DB_NAME POSTGRES_USER: $DB_USER POSTGRES_PASSWORD: $DB_PASSWORD diff --git a/compose/redis.yml b/compose/redis.yml index a7c8c129..00eeaf5d 100644 --- a/compose/redis.yml +++ b/compose/redis.yml @@ -6,7 +6,7 @@ services: restart: always command: ["redis-server", "/etc/redis.conf", "--requirepass", "$REDIS_PASSWORD"] environment: - TZ: ${TIME_ZONE:-Asia/Shanghai} + TZ: ${TZ:-Asia/Shanghai} REDIS_PORT: $REDIS_PORT REDIS_PASSWORD: $REDIS_PASSWORD volumes: diff --git a/compose/web.yml b/compose/web.yml index 43305492..288e23ad 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -7,7 +7,7 @@ services: core: 0 restart: always environment: - TZ: ${TIME_ZONE:-Asia/Shanghai} + 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 68f06295..555cb115 100644 --- a/config-example.txt +++ b/config-example.txt @@ -160,5 +160,5 @@ USE_LB=1 # The current running version number of JumpServer, automatically generated after installation and upgrade # -TIME_ZONE=Asia/Shanghai +TZ=Asia/Shanghai CURRENT_VERSION= diff --git a/scripts/1_config_jumpserver.sh b/scripts/1_config_jumpserver.sh index 6da235bf..fe489ee2 100644 --- a/scripts/1_config_jumpserver.sh +++ b/scripts/1_config_jumpserver.sh @@ -245,9 +245,9 @@ function set_others() { read_from_input lang "$(gettext 'Please enter language')" "zh/en/ja/es/ko/ru/vi" "${lang}" set_config LANGUAGE_CODE "${lang}" - timezone=$(get_config TIME_ZONE "Asia/Shanghai") + timezone=$(get_config TZ "Asia/Shanghai") read_from_input timezone "$(gettext 'Please enter timezone')" "" "${timezone}" - set_config TIME_ZONE "${timezone}" + set_config TZ "${timezone}" } function main() { diff --git a/scripts/7_upgrade.sh b/scripts/7_upgrade.sh index 643cf0e8..8e07dad5 100644 --- a/scripts/7_upgrade.sh +++ b/scripts/7_upgrade.sh @@ -66,8 +66,7 @@ function upgrade_config() { check_and_set_config "SERVER_HOSTNAME" "${HOSTNAME}" check_and_set_config "JUMPSERVER_ENABLE_FONT_SMOOTHING" "true" check_and_set_config "USE_LB" "1" - check_and_set_config "TIME_ZONE" "${TZ}" - check_and_set_config "VERIFY_EXTERNAL_SSL" "False" + check_and_set_config "VERIFY_EXTERNAL_SSL" "false" # XPACK use_xpack=$(get_config_or_env USE_XPACK) if [[ "${use_xpack}" == "1" ]]; then