Skip to content

Commit ddd0d82

Browse files
committed
fix(jumpserver): issues found running the v5 install
- guacd 1.6.0 fails to build against Debian 13's FreeRDP 3 under -Werror for deprecated APIs; allow those warnings. - guacd binds ::1 by default while KoKo dials 127.0.0.1; pin it to IPv4. - The core only accepts terminal registration for 5 minutes after it starts, so start the core and KoKo together after all builds finish. - KoKo links libghostty-vt statically; drop the LD_LIBRARY_PATH. - Append the admin credentials instead of overwriting the database ones. - Restore config and data before the update rebuilds anything.
1 parent ada92a2 commit ddd0d82

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

‎ct/jumpserver.sh‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ function update_script() {
4242
msg_info "Building guacd"
4343
cd /opt/guacd
4444
$STD autoreconf -fi
45-
$STD ./configure --with-systemd-dir=/etc/systemd/system --disable-guacenc
45+
# FreeRDP 3.6+ deprecates APIs guacd still calls, which -Werror turns into build failures
46+
$STD ./configure --with-systemd-dir=/etc/systemd/system --disable-guacenc CFLAGS="-O2 -Wno-error=deprecated-declarations"
4647
$STD make -j"$(nproc)"
4748
$STD make install
4849
$STD ldconfig
@@ -60,6 +61,9 @@ function update_script() {
6061

6162
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jumpserver" "jumpserver/jumpserver" "tarball" "latest" "" "" "v5."
6263
JMS_TAG="v$(<~/.jumpserver)"
64+
CLEAN_INSTALL=1 fetch_and_deploy_gh_tag "koko" "jumpserver/koko" "$JMS_TAG"
65+
66+
restore_backup
6367

6468
msg_info "Updating Python Environment"
6569
cd /opt/jumpserver
@@ -79,8 +83,6 @@ function update_script() {
7983
$STD ../.venv/bin/python3 manage.py compilemessages
8084
msg_ok "Updated Python Environment"
8185

82-
CLEAN_INSTALL=1 fetch_and_deploy_gh_tag "koko" "jumpserver/koko" "$JMS_TAG"
83-
8486
GHOSTTY_COMMIT=$(grep -oP 'libghostty-vt:ghostty-\K[0-9a-f]+' /opt/koko/Dockerfile-base)
8587
ZIG_VERSION=$(grep -oP 'libghostty-vt:ghostty-[0-9a-f]+-zig-\K[0-9.]+' /opt/koko/Dockerfile-base)
8688
USQL_VERSION=$(grep -oP 'ARG USQL_VERSION=\K\S+' /opt/koko/Dockerfile-base)
@@ -111,8 +113,6 @@ function update_script() {
111113
fetch_and_deploy_gh_release "usql" "jumpserver-dev/usql" "prebuild" "$USQL_VERSION" "/opt/usql" "usql-*-linux-$(arch_resolve amd64 arm64).tar.gz"
112114
fetch_and_deploy_gh_release "k8s-bundle" "jumpserver-dev/k8s-bundle" "binary" "$K8S_BUNDLE_VERSION" "" "k8s-bundle_$(arch_resolve amd64 arm64).deb"
113115

114-
restore_backup
115-
116116
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
117117

118118
CLEAN_INSTALL=1 fetch_and_deploy_gh_tag "lina" "jumpserver/lina" "$JMS_TAG" "/opt/lina-src"

‎install/jumpserver-install.sh‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,18 @@ fetch_and_deploy_gh_tag "guacd" "apache/guacamole-server"
7070
msg_info "Building guacd"
7171
cd /opt/guacd
7272
$STD autoreconf -fi
73-
$STD ./configure --with-systemd-dir=/etc/systemd/system --disable-guacenc
73+
# FreeRDP 3.6+ deprecates APIs guacd still calls, which -Werror turns into build failures
74+
$STD ./configure --with-systemd-dir=/etc/systemd/system --disable-guacenc CFLAGS="-O2 -Wno-error=deprecated-declarations"
7475
$STD make -j"$(nproc)"
7576
$STD make install
7677
$STD ldconfig
78+
# guacd binds "localhost" (::1 here) by default, but KoKo dials 127.0.0.1
79+
mkdir -p /etc/guacamole
80+
cat <<EOF >/etc/guacamole/guacd.conf
81+
[server]
82+
bind_host = 127.0.0.1
83+
bind_port = 4822
84+
EOF
7785
systemctl enable -q --now guacd
7886
msg_ok "Built guacd"
7987

@@ -134,7 +142,7 @@ RestartSec=5
134142
[Install]
135143
WantedBy=multi-user.target
136144
EOF
137-
systemctl enable -q --now jumpserver
145+
systemctl enable -q jumpserver
138146
msg_ok "Created Core Service"
139147

140148
fetch_and_deploy_gh_tag "koko" "jumpserver/koko" "$JMS_TAG"
@@ -186,15 +194,14 @@ After=network.target guacd.service jumpserver.service
186194
[Service]
187195
Type=simple
188196
WorkingDirectory=/opt/koko
189-
Environment=LD_LIBRARY_PATH=/opt/libghostty-vt/lib
190197
ExecStart=/opt/koko/koko
191198
Restart=on-failure
192199
RestartSec=5
193200
194201
[Install]
195202
WantedBy=multi-user.target
196203
EOF
197-
systemctl enable -q --now koko
204+
systemctl enable -q koko
198205
msg_ok "Configured KoKo"
199206

200207
fetch_and_deploy_gh_tag "lina" "jumpserver/lina" "$JMS_TAG" "/opt/lina-src"
@@ -220,11 +227,18 @@ mv .output/public /opt/luna
220227
rm -rf /opt/luna-src
221228
msg_ok "Built Luna"
222229

223-
msg_info "Securing Admin Account"
230+
msg_info "Starting Services"
231+
# The core only accepts terminal registration for 5 minutes after it starts,
232+
# so KoKo has to come up right behind it instead of after the long builds
233+
systemctl start jumpserver
224234
for _ in $(seq 1 90); do
225235
curl -fsS -o /dev/null http://127.0.0.1:8080/api/health/ 2>/dev/null && break
226236
sleep 5
227237
done
238+
systemctl start koko
239+
msg_ok "Started Services"
240+
241+
msg_info "Securing Admin Account"
228242
JMS_ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-16)
229243
cd /opt/jumpserver
230244
PYTHONPATH=/opt/jumpserver/apps DJANGO_SETTINGS_MODULE=jumpserver.settings $STD .venv/bin/python3 -c "
@@ -236,7 +250,7 @@ u.set_password('${JMS_ADMIN_PASS}')
236250
u.need_update_password = False
237251
u.save()
238252
"
239-
cat <<EOF >~/jumpserver.creds
253+
cat <<EOF >>~/jumpserver.creds
240254
JumpServer Admin Credentials
241255
Username: admin
242256
Password: ${JMS_ADMIN_PASS}

0 commit comments

Comments
 (0)