Skip to content

Commit 8c91ebe

Browse files
committed
Added SSH_SERVER and PROMPT customizations
1 parent 71943fc commit 8c91ebe

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

docker-compose-template.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ services:
2626
- OPENAI_TEMPERATURE=0.2
2727
- USER_DEFAULT_PROMPT_MODE=exec
2828
- USER_PREFERENCES="Never execute any commands without my confirmation!"
29+
- PROMPT_KUBECTL_ENABLED=1
30+
- PROMPT_PREFIX="[ TOOLS ]"
31+
- SSH_SERVER_ENABLED="0"
2932
# - DEBUG=1
3033
# ports:
3134
# - "18000-19000:18000-19000"

entrypoint.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ if [[ "$HOME" != "$HOME_TEMPLATE" && $HOME ]]; then
5757
"${HOME_TEMPLATE}/.kubectl_aliases"
5858
"${HOME_TEMPLATE}/.tmux.conf"
5959
"${HOME_TEMPLATE}/.vimrc"
60-
"${HOME_TEMPLATE}/.wget-hsts"
6160
"${HOME_TEMPLATE}/.zshrc"
6261
)
6362
for item in "${items_to_copy[@]}"; do
@@ -110,6 +109,13 @@ for env_key in "${env_keys[@]}"; do
110109
fi
111110
done
112111

112+
# Start SSH server if SSH_SERVER is enabled
113+
SSH_SERVER_ENABLED="${SSH_SERVER_ENABLED:-0}"
114+
if [ "${SSH_SERVER_ENABLED}" = "1" ]; then
115+
printf "| Starting SSH server ... "
116+
(sudo service ssh start >/dev/null 2>&1 && echo "[ OK ]") || echo "[ FAILED ]"
117+
fi
118+
113119
printf "| Initialization complete! Container ready for use \n"
114120
print_divider
115121

files/.zshrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,8 @@ export PATH="${HOME}/.krew/bin:${HOME}/bin:${HOME}/.local/bin:${PATH}"
140140
[[ $(which kubectl) ]] && source <(kubectl completion zsh)
141141
export KUBE_PS1_SYMBOL_ENABLE="false"
142142
source "${ZSH}/custom/plugins/kube-ps1/kube-ps1.sh"
143-
PROMPT='[ TOOLS ] ''$(kube_ps1)'$PROMPT
143+
PROMPT_KUBECTL_ENABLED="${PROMPT_KUBECTL_ENABLED:-1}"
144+
PROMPT_PREFIX="${PROMPT_PREFIX:-[ TOOLS ]}"
145+
[ "$PROMPT_KUBECTL_ENABLED" = "1" ] && PROMPT="$(kube_ps1)${PROMPT}"
146+
PROMPT="${PROMPT_PREFIX}${PROMPT}"
144147
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

0 commit comments

Comments
 (0)