Skip to content

Commit

Permalink
Merge pull request #132 from jumpserver/dev
Browse files Browse the repository at this point in the history
v3.7.0
  • Loading branch information
BaiJiangJie authored Sep 21, 2023
2 parents 5640864 + 9700fec commit 8cb59d1
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 102 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN set -ex \

# 下载公共的客户端
WORKDIR /opt/download/public
ARG Client_VERSION=v2.0.0
ARG Client_VERSION=v2.0.1
ARG MRD_VERSION=10.6.7
ARG VIDEO_PLAYER_VERSION=0.1.9
ARG OPENSSH_VERSION=v9.2.0.0
Expand Down Expand Up @@ -64,5 +64,6 @@ COPY release/lina /opt/lina
COPY release/luna /opt/luna
COPY release/applets /opt/download/applets
COPY nginx.conf /etc/nginx/nginx.conf
COPY includes /etc/nginx/includes
COPY http_server.conf /etc/nginx/conf.d/default.conf
COPY init.sh /docker-entrypoint.d/40-init-config.sh
103 changes: 2 additions & 101 deletions http_server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ server {

client_max_body_size 5000m;

location ~* \.(mp4|m4v|m4a)$ {
mp4;
mp4_buffer_size 1m;
mp4_max_buffer_size 50m;
root /opt/jumpserver/data/;
}

location /player/ {
try_files $uri / /index.html;
alias /opt/player/;
Expand All @@ -30,101 +23,9 @@ server {
alias /opt/download/;
}

location /media/replay/ {
add_header Content-Encoding gzip;
root /opt/jumpserver/data/;
}

location /static/ {
root /opt/jumpserver/data/;
}

location /koko/ {
proxy_pass http://koko:5000;
proxy_buffering off;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}

location /lion/ {
proxy_pass http://lion:8081;
proxy_buffering off;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}

location /chen/ {
proxy_pass http://chen:8082;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}

location /kael/ {
proxy_pass http://kael:8083;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}

location /ws/ {
proxy_pass http://core:8080;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ ^/(core|api|media)/ {
proxy_pass http://core:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location / {
rewrite ^/(.*)$ /ui/$1 last;
}

include includes/*.conf;
}
16 changes: 16 additions & 0 deletions includes/chen.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
location /chen/ {
proxy_pass http://chen:8082;
proxy_buffering off;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}
21 changes: 21 additions & 0 deletions includes/core.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
location /static/ {
root /opt/jumpserver/data/;
}

location /ws/ {
proxy_pass http://core:8080;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ ^/(core|api|media)/ {
proxy_pass http://core:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
16 changes: 16 additions & 0 deletions includes/kael.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
location /kael/ {
proxy_pass http://kael:8083;
proxy_buffering off;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}
16 changes: 16 additions & 0 deletions includes/koko.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
location /koko/ {
proxy_pass http://koko:5000;
proxy_buffering off;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}
16 changes: 16 additions & 0 deletions includes/lion.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
location /lion/ {
proxy_pass http://lion:8081;
proxy_buffering off;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 6000;
}
21 changes: 21 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ if [ -n "${HTTPS_PORT}" ] && [ -f "/etc/nginx/sites-enabled/jumpserver.conf" ];
fi
fi

# config components
if [ "${CORE_ENABLED}" == "0" ]; then
mv /etc/nginx/includes/core.conf /etc/nginx/includes/core.conf.disabled
fi

if [ "${KOKO_ENABLED}" == "0" ]; then
mv /etc/nginx/includes/koko.conf /etc/nginx/includes/koko.conf.disabled
fi

if [ "${LION_ENABLED}" == "0" ]; then
mv /etc/nginx/includes/lion.conf /etc/nginx/includes/lion.conf.disabled
fi

if [ "${CHEN_ENABLED}" == "0" ]; then
mv /etc/nginx/includes/chen.conf /etc/nginx/includes/chen.conf.disabled
fi

if [ "${KAEL_ENABLED}" == "0" ]; then
mv /etc/nginx/includes/kael.conf /etc/nginx/includes/kael.conf.disabled
fi

if [ -f "/etc/init.d/cron" ]; then
/etc/init.d/cron start
fi

0 comments on commit 8cb59d1

Please sign in to comment.