Skip to content

Commit 4c910df

Browse files
Make scripts invisible to session users
1 parent 78b1d4b commit 4c910df

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ RUN apt-get update && \
2929
chmod +x /usr/bin/gotty && \
3030
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \
3131
DEBIAN_FRONTEND=noninteractive apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
32-
chmod 755 /tmp
32+
chmod 755 /tmp && mkdir -p /opt/webkubectl
33+
34+
COPY start-webkubectl.sh /opt/webkubectl
35+
COPY start-session.sh /opt/webkubectl
36+
COPY init-kubectl.sh /opt/webkubectl
37+
RUN chmod -R 700 /opt/webkubectl
38+
3339

3440
ENV SESSION_STORAGE_SIZE=10M
3541
ENV WELCOME_BANNER="Welcome to Web Kubectl, try kubectl --help."
3642
ENV KUBECTL_INSECURE_SKIP_TLS_VERIFY=true
3743
ENV GOTTY_OPTIONS="--port 8080 --permit-write --permit-arguments"
3844

39-
COPY start-webkubectl.sh /
40-
RUN chmod +x /start-webkubectl.sh
41-
COPY start-session.sh /
42-
RUN chmod +x /start-session.sh
43-
COPY init-kubectl.sh /
44-
RUN chmod +x /init-kubectl.sh
45-
CMD ["sh","/start-webkubectl.sh"]
45+
CMD ["sh","/opt/webkubectl/start-webkubectl.sh"]

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
![License](https://img.shields.io/badge/License-Apache%202.0-red)
44
![Dockerized](https://img.shields.io/badge/Dockerized-yes-brightgreen)
55
![Version](https://img.shields.io/badge/Version-v1.3-yellow)
6-
![Total visitor](https://visitor-count-badge.herokuapp.com/total.svg?repo_id=webkubectl-webkubectl)
7-
![Visitors in today](https://visitor-count-badge.herokuapp.com/today.svg?repo_id=webkubectl-webkubectl)
6+
![HitCount](http://hits.dwyl.io/webkubectl/webkubectl.svg)
87

98
![webkubectl](https://raw.githubusercontent.com/webkubectl/web-resources/master/webkubectl.gif)
109

start-session.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ if [[ $all == ERROR:* ]]; then
1616
exit 1
1717
fi
1818

19-
unshare --fork --pid --mount-proc --mount /init-kubectl.sh ${all}
19+
unshare --fork --pid --mount-proc --mount /opt/webkubectl/init-kubectl.sh ${all}

start-webkubectl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ if [ ${KUBECTL_INSECURE_SKIP_TLS_VERIFY} == "true" ];then
1212
fi
1313

1414

15-
gotty ${GOTTY_OPTIONS} /start-session.sh
15+
gotty ${GOTTY_OPTIONS} /opt/webkubectl/start-session.sh

0 commit comments

Comments
 (0)