Skip to content

Commit df6f494

Browse files
committed
fix: correct ttyd startup command
- Use numeric uid/gid instead of username for -u/-g flags - Remove problematic fontFamily parameter with complex quoting - Add disableLeaveAlert option for better UX - Use /bin/bash -l for proper login shell - Add sleep after starting ttyd
1 parent b88ca54 commit df6f494

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

src/lib/gcp.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,15 +1005,25 @@ curl -X PUT "http://metadata.google.internal/computeMetadata/v1/instance/attribu
10051005
10061006
# Start ttyd on port 7681 with authentication
10071007
# -W: Writable (allow input)
1008-
# -t: Set terminal type
1008+
# -t: Set terminal options
10091009
# -c: Set credentials (username:password)
10101010
# -p: Port number
1011-
nohup ttyd -W -t fontSize=14 -t fontFamily="'JetBrains Mono', 'Fira Code', monospace" \\
1012-
-c developer:\$TTYD_PASSWORD \\
1011+
DEVELOPER_UID=\$(id -u developer)
1012+
DEVELOPER_GID=\$(id -g developer)
1013+
1014+
nohup ttyd -W \\
1015+
-t fontSize=14 \\
1016+
-t disableLeaveAlert=true \\
1017+
-c "developer:\$TTYD_PASSWORD" \\
10131018
-p 7681 \\
1014-
sudo -u developer -i \\
1019+
-u \$DEVELOPER_UID \\
1020+
-g \$DEVELOPER_GID \\
1021+
/bin/bash -l \\
10151022
> /var/log/teable-services/ttyd.log 2>&1 &
10161023
1024+
# Wait a moment for ttyd to start
1025+
sleep 1
1026+
10171027
echo "✓ ttyd web terminal started on port 7681" >> /var/log/startup.log
10181028
10191029
echo "All services started successfully!" >> /var/log/startup.log

0 commit comments

Comments
 (0)