Skip to content

Commit

Permalink
perf: add nec vnc component
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Nov 11, 2024
1 parent 5a45ed4 commit 3746327
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
23 changes: 23 additions & 0 deletions compose/nec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
services:
magnus:
image: ${REGISTRY:-registry.fit2cloud.com}/jumpserver/nec:${VERSION}
container_name: jms_nec
hostname: jms_nec
ulimits:
core: 0
restart: always
env_file:
- ${CONFIG_FILE}
ports:
- ${NEC_VNC_PORT:-5900}:5900
volumes:
- ${CONFIG_DIR}/certs:/opt/nec/data/certs
- ${VOLUME_DIR}/nec/data:/opt/nec/data
healthcheck:
test: "nc -z 127.0.0.1 5900 || exit 1"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
- net
8 changes: 7 additions & 1 deletion scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function set_port() {
xrdp_enable=$(get_config XRDP_ENABLE)
razor_enable=$(get_config RAZOR_ENABLE)
web_enable=$(get_config WEB_ENABLE)
nec_enable=$(get_config NEC_ENABLE)

if [[ "${web_enable}" != "0" ]]; then
http_port=$(get_config HTTP_PORT)
Expand Down Expand Up @@ -105,6 +106,11 @@ function set_port() {
read_from_input magnus_oracle_ports "$(gettext 'Please enter MAGNUS ORACLE PORTS')" "" "${magnus_oracle_ports}"
set_config MAGNUS_ORACLE_PORTS "${magnus_oracle_ports}"
fi
if [[ "${nec_enable}" != "0" ]]; then
nec_port=$(get_config NEC_PORT)
read_from_input nec_port "$(gettext 'Please enter NEC VNC PORT')" "" "${nec_port}"
set_config NEC_PORT "${nec_port}"
fi
fi
flag=1
}
Expand Down Expand Up @@ -234,4 +240,4 @@ fi

if [[ "${flag}" == "1" ]]; then
restart_service
fi
fi
9 changes: 5 additions & 4 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function get_db_info() {
if [[ "${check_volume_dir}" == "0" ]]; then
db_engine=$(get_config DB_ENGINE "postgresql")
fi

mysql_data_exists="0"
mariadb_data_exists="0"
postgres_data_exists="0"
Expand Down Expand Up @@ -207,6 +207,7 @@ function get_images() {
echo "registry.fit2cloud.com/jumpserver/video-worker:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/xrdp:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/panda:${VERSION}"
echo "registry.fit2cloud.com/jumpserver/nec:${VERSION}"
else
echo "jumpserver/core:${VERSION}"
echo "jumpserver/koko:${VERSION}"
Expand Down Expand Up @@ -342,8 +343,8 @@ function get_docker_compose_services() {
[[ "${use_loki}" == "1" ]] && services+=" loki"

if [[ "${use_xpack}" == "1" ]]; then
services+=" magnus razor xrdp video panda"
for service in magnus razor xrdp video panda; do
services+=" magnus razor xrdp video panda nec"
for service in magnus razor xrdp video panda nec; do
enabled=$(get_config "${service^^}_ENABLED")
[[ "${enabled}" == "0" ]] && services="${services//${service}/}"
done
Expand Down Expand Up @@ -395,7 +396,7 @@ function get_docker_compose_cmd_line() {
fi

if [[ "${use_xpack}" == '1' ]]; then
for service in magnus razor xrdp video panda; do
for service in magnus razor xrdp video panda nec; do
if [[ "${services}" =~ ${service} ]]; then
cmd+=" -f compose/${service}.yml"
fi
Expand Down

0 comments on commit 3746327

Please sign in to comment.