Skip to content

Commit

Permalink
fix: 优化 static 路径
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai committed Apr 29, 2024
1 parent 3915141 commit fda6fea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions allinone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ ENV TERMINAL_MAGNUS_ENABLED=False \
TERMINAL_KOKO_SSH_ENABLED=False

RUN set -ex \
&& STATIC_VERSION=$(curl -s https://raw.githubusercontent.com/jumpserver/web-static/master/VERSION) \
&& STATIC_VERSION=$(curl -sSL https://github.com/jumpserver/web-static/raw/v3/VERSION) \
&& wget -O /opt/prepare.sh https://github.com/jumpserver/web-static/raw/${STATIC_VERSION}/prepare.sh \
&& chown root:root /opt/prepare.sh \
&& chmod 755 /opt/prepare.sh \
&& sed -i "s@https://gitea.com/jumpserver/web-static/raw/tag/.*/download/@https://gitea.com/jumpserver/web-static/raw/tag/${STATIC_VERSION}/download/@g" /etc/nginx/nginx.conf
&& chmod 755 /opt/prepare.sh

VOLUME /opt/jumpserver/data
VOLUME /opt/koko/data
Expand Down
2 changes: 1 addition & 1 deletion allinone/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ http {
}

location @redirect_oss {
rewrite ^/download/(.*)$ https://gitea.com/jumpserver/web-static/raw/tag/v1.1.3/download/$1 permanent;
rewrite ^/download/(.*)$ https://static.jumpserver.org/download/$1 permanent;
}

location /private-media/ {
Expand Down
5 changes: 2 additions & 3 deletions web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ COPY web/nginx.conf /etc/nginx/
WORKDIR /opt

RUN set -ex \
&& STATIC_VERSION=$(curl -s https://raw.githubusercontent.com/jumpserver/web-static/master/VERSION) \
&& STATIC_VERSION=$(curl -sSL https://github.com/jumpserver/web-static/raw/v3/VERSION) \
&& wget -O /opt/prepare.sh https://github.com/jumpserver/web-static/raw/${STATIC_VERSION}/prepare.sh \
&& chown root:root /opt/prepare.sh \
&& chmod 755 /opt/prepare.sh \
&& sed -i 's@https://gitea.com/jumpserver/web-static/raw/tag/.*/download/@https://gitea.com/jumpserver/web-static/raw/tag/${STATIC_VERSION}/download/@g' /etc/nginx/nginx.conf
&& chmod 755 /opt/prepare.sh

ARG VERSION=v3.10.9
ENV VERSION=${VERSION}
Expand Down
2 changes: 1 addition & 1 deletion web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ http {
}

location @redirect_oss {
rewrite ^/download/(.*)$ https://gitea.com/jumpserver/web-static/raw/tag/v1.1.3/download/$1 permanent;
rewrite ^/download/(.*)$ https://static.jumpserver.org/download/$1 permanent;
}

location /private-media/ {
Expand Down

0 comments on commit fda6fea

Please sign in to comment.