This repository was archived by the owner on Apr 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +46
-2
lines changed
root/etc/services.d/autostart Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,13 @@ RUN \
132132 xterm && \
133133 apt-get install -qy --no-install-recommends \
134134 $(cat /tmp/out/DEPENDENCIES) && \
135- cd /usr/bin && \
135+ echo "**** grab websocat ****" && \
136+ WEBSOCAT_RELEASE=$(curl -sX GET "https://api.github.com/repos/vi/websocat/releases/latest" \
137+ | awk '/tag_name/{print $4;exit}' FS='[""]' ); \
138+ curl -o \
139+ /usr/bin/websocat -L \
140+ "https://github.com/vi/websocat/releases/download/${WEBSOCAT_RELEASE}/websocat_nossl_amd64-linux-static" && \
141+ chmod +x /usr/bin/websocat && \
136142 echo "**** cleanup ****" && \
137143 apt-get autoclean && \
138144 rm -rf \
Original file line number Diff line number Diff line change @@ -132,7 +132,13 @@ RUN \
132132 xterm && \
133133 apt-get install -qy --no-install-recommends \
134134 $(cat /tmp/out/DEPENDENCIES) && \
135- cd /usr/bin && \
135+ echo "**** grab websocat ****" && \
136+ WEBSOCAT_RELEASE=$(curl -sX GET "https://api.github.com/repos/vi/websocat/releases/latest" \
137+ | awk '/tag_name/{print $4;exit}' FS='[""]'); \
138+ curl -o \
139+ /usr/bin/websocat -L \
140+ "https://github.com/vi/websocat/releases/download/${WEBSOCAT_RELEASE}/websocat_nossl_arm-linux-static" && \
141+ chmod +x /usr/bin/websocat && \
136142 echo "**** cleanup ****" && \
137143 apt-get autoclean && \
138144 rm -rf \
Original file line number Diff line number Diff line change @@ -133,6 +133,13 @@ RUN \
133133 apt-get install -qy --no-install-recommends \
134134 $(cat /tmp/out/DEPENDENCIES) && \
135135 cd /usr/bin && \
136+ echo "**** grab websocat ****" && \
137+ WEBSOCAT_RELEASE=$(curl -sX GET "https://api.github.com/repos/vi/websocat/releases/latest" \
138+ | awk '/tag_name/{print $4;exit}' FS='[""]'); \
139+ curl -o \
140+ /usr/bin/websocat -L \
141+ "https://github.com/vi/websocat/releases/download/${WEBSOCAT_RELEASE}/websocat_nossl_arm-linux-static" && \
142+ chmod +x /usr/bin/websocat && \
136143 echo "**** cleanup ****" && \
137144 apt-get autoclean && \
138145 rm -rf \
Original file line number Diff line number Diff line change 1+ #!/usr/bin/with-contenv bash
2+
3+ # just sleep if autostart is not enabled
4+ if [ -z ${GUIAUTOSTART+x} ]; then
5+ echo "[guac-init] Auto start not set, application start on login"
6+ sleep infinity
7+ # start abc session by sending a token to guacamole via websockets
8+ else
9+ # make sure services are up
10+ until \
11+ $(true &>/dev/null </dev/tcp/127.0.0.1/3350) && \
12+ $(true &>/dev/null </dev/tcp/127.0.0.1/4822) && \
13+ $(true &>/dev/null </dev/tcp/127.0.0.1/${CUSTOM_PORT:=3000}) &&
14+ $(true &>/dev/null </dev/tcp/127.0.0.1/3389)
15+ do
16+ sleep .5
17+ done
18+ echo "[guac-init] Auto start set, starting application"
19+ sleep 1
20+ # generate a token based on env vars
21+ cd /gclient
22+ TOKEN=$(node maketoken.js)
23+ websocat -q -n ws://localhost:${CUSTOM_PORT:=3000}/guaclite?token=${TOKEN}
24+ sleep infinity
25+ fi
You can’t perform that action at this time.
0 commit comments