Skip to content

Commit

Permalink
Make vscode server data persistent (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Dec 9, 2023
1 parent a4da8d1 commit 69107d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ssh/rootfs/etc/s6-overlay/s6-rc.d/init-user/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ readonly BASH_HISTORY_PERSISTENT_FILE=/data/.bash_history
readonly GIT_CONFIG=/data/.gitconfig
readonly HOME_ASSISTANT_PROFILE_D_FILE=/etc/profile.d/homeassistant.sh
readonly SSH_USER_PATH=/data/.ssh
readonly VSCODE_SERVER_PATH=/root/.vscode-server
readonly VSCODE_SERVER_PERSISTENT_PATH=/data/.vscode-server
readonly ZSH_HISTORY_FILE=/root/.zsh_history
readonly ZSH_HISTORY_PERSISTENT_FILE=/data/.zsh_history

Expand Down Expand Up @@ -79,6 +81,13 @@ if ! bashio::fs.file_exists "${GIT_CONFIG}"; then
fi
ln -s "${GIT_CONFIG}" ~/.gitconfig

# Sets up the user .vscode-server folder to be persistent
if ! bashio::fs.directory_exists "${VSCODE_SERVER_PERSISTENT_PATH}"; then
mkdir -p "${VSCODE_SERVER_PERSISTENT_PATH}" \
|| bashio::exit.nok 'Failed to create a persistent .vscode-server folder'
fi
ln -s "${VSCODE_SERVER_PERSISTENT_PATH}" "${VSCODE_SERVER_PATH}"

# Disable SSH & Web Terminal session sharing if configured
if ! bashio::config.true 'share_sessions'; then
bashio::log.notice 'Session sharing has been disabled!'
Expand Down

0 comments on commit 69107d7

Please sign in to comment.