Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compose/celery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ services:
volumes:
- ${CONFIG_DIR}/certs:/opt/jumpserver/data/certs
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
- /var/run/docker.sock:/var/run/docker.sock:z
healthcheck:
test: "bash /opt/jumpserver/utils/check_celery.sh"
interval: 10s
Expand Down
2 changes: 2 additions & 0 deletions scripts/4_install_jumpserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ function main() {
log_error "$(gettext 'Failed to change the table structure')!"
exit 1
fi

ensure_core_data_symlink || log_warn "Failed to prepare host core data symlink, continue installation"

installation_log "install"
post_install
Expand Down
1 change: 1 addition & 0 deletions scripts/7_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ function main() {
echo_yellow "\n7. $(gettext 'Upgrade Docker')"
upgrade_docker
upgrade_compose
ensure_core_data_symlink || log_warn "Failed to prepare host core data symlink, continue upgrade"

installation_log "upgrade"

Expand Down
22 changes: 21 additions & 1 deletion scripts/gists/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,24 @@ function prepare_config() {
fi

gen_safe_config
}
}

function ensure_core_data_symlink() {
local target_dir link_path="/opt/jumpserver/data"
target_dir="$(get_config VOLUME_DIR)/core/data"

mkdir -p "${target_dir}" "/opt/jumpserver" || return 1

if [[ -L "${link_path}" ]] && [[ "$(readlink -f "${link_path}")" == "$(readlink -f "${target_dir}")" ]]; then
echo_check "${link_path} -> ${target_dir}"
return 0
fi

if [[ -e "${link_path}" ]]; then
log_warn "${link_path} exists, skip creating symlink"
return 1
fi

ln -s "${target_dir}" "${link_path}" || return 1
echo_check "${link_path} -> ${target_dir}"
}