changed code-server config

This commit is contained in:
Richard Sperry 2025-04-14 00:25:33 -07:00
parent 13f33ac377
commit e189ce90d1
4 changed files with 9 additions and 9 deletions

View file

@ -63,7 +63,7 @@ RUN if [ "${BUILD_ARCH}" = "aarch64" ]; then HA_CLI_URL="https://github.com/home
#Copy root file system
COPY rootfs /
WORKDIR /root/.config/code-server
# Install Oh My ZSH
# hadolint ignore=SC2086

View file

@ -29,5 +29,5 @@ export HASS_TOKEN="${SUPERVISOR_TOKEN:-}"
# Run the code server
cd "${CODE_SERVER_CONFIG_PATH}" || bashio::exit.nok "Could not change working directory"
exec code-server --config="$CODE_SERVER_CONFIG_PATH/config.yaml" "/config"
exec code-server "/config"

View file

@ -26,6 +26,7 @@ readonly -a PREVIOUS_DEFAULT_CONFIG_HASHES=(
readonly DEFAULT_FILES_PATH="/usr/lib/code-server/defaults"
readonly DEFAULT_CONFIG_PATH="/config/addons_config/vscode"
readonly CODE_SERVER_CONFIG="/root/.config/code-server/config.yaml"
# Ensure config path exists
if bashio::config.has_value 'config_path'; then
@ -43,15 +44,14 @@ else
|| bashio::exit.nok "Could not create persistent storage folder."
fi
export CODE_SERVER_CONFIG_PATH=$config_path
bashio::log.info "using code-server config path: $config_path"
# Ensure code-server config
if ! bashio::fs.file_exists $config_path/config.yaml; then
cp "$DEFAULT_FILES_PATH/config.yaml" "$config_path/config.yaml"
if ! bashio::fs.file_exists $CODE_SERVER_CONFIG; then
cp "$DEFAULT_FILES_PATH/config.yaml" "$CODE_SERVER_CONFIG"
fi
if bashio::config.has_value 'log_level'; then
sed -i "/log_level=/c log_level=\"$log_level\"" "$config_path/config.yaml"
sed -i "/log_level=/c log_level=\"$log_level\"" "$CODE_SERVER_CONFIG"
fi
@ -69,7 +69,7 @@ if [ ! -d "$ext_path" ]; then
fi;
done < "$DEFAULT_FILES_PATH/vscode.extensions"
fi
sed -i "/extensions-dir=/c extensions-dir=\"$ext_path\"" "$config_path/config.yaml"
sed -i "/extensions-dir=/c extensions-dir=\"$ext_path\"" "$CODE_SERVER_CONFIG"
# Ensure User settings path
user_path="$config_path/user"
@ -77,7 +77,7 @@ if [ ! -d "$user_path" ]; then
mkdir -p $user_path \
|| bashio::exit.nok "Could not create persistent User folder."
fi
sed -i "/user-data-dir=/c user-data-dir=\"$user_path\"" "$config_path/config.yaml"
sed -i "/user-data-dir=/c user-data-dir=\"$user_path\"" "$CODE_SERVER_CONFIG"
# Sets up default user settings on first start.
if ! bashio::fs.file_exists $user_path/settings.json; then

View file

@ -1,3 +1,3 @@
#!/bin/sh
exec /usr/local/lib/code-server/bin/code-server --config="$CODE_SERVER_CONFIG_PATH/config.yaml" "${@}"
exec /usr/local/lib/code-server/bin/code-server "${@}"