mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: put terminal service into container refactor: separate main into terminal and websocket feat: create zsh using commander in home feat: pass backendUrl to container feat: pass token to ws server to cmd-hook feat: gen terminal access token for frontend feat: success to connect through traefik fix: handle invalid jwt feat: connect to session container via traefik
19 lines
487 B
Bash
19 lines
487 B
Bash
#!/bin/sh
|
|
|
|
USERNAME=commander
|
|
|
|
echo "Initializing container for $USERNAME"
|
|
echo "BACKEND_URL: $BACKEND_URL"
|
|
|
|
if ! id -u ${USERNAME} >/dev/null 2>&1; then
|
|
echo "Adding user $USERNAME"
|
|
adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME} && \
|
|
find / -name ".gitkeep" -type f -exec rm -f {} +
|
|
fi
|
|
|
|
# Preserve environment variables
|
|
export BACKEND_URL
|
|
|
|
echo "Starting terminal service"
|
|
su - ${USERNAME} -w BACKEND_URL -c "/usr/local/lib/terminal-service/terminal-service"
|