File tree Expand file tree Collapse file tree
rootfs/etc/s6-overlay/s6-rc.d/init-code-server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ return to the defaults as delivered by this add-on, do the following:
104104 Although we support ARM devices, please be aware, that this add-on is quite
105105 heavy to run, and requires quite a bit of RAM. We do not recommended to run
106106 it on devices with less than 4Gb of memory.
107+ - **Do not use the root directory (`/`) as your workspace.** Opening the root
108+ directory causes severe performance issues, as VS Code will attempt to index
109+ the entire filesystem, resulting in excessive CPU and memory usage. Always
110+ use `/config` (the default) or another specific directory. The add-on will
111+ prevent startup if the root directory is configured as the workspace.
107112- " Visual Studio Code is unable to watch for file changes in this large
108113 workspace" (error ENOSPC)
109114
Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ if bashio::config.has_value 'config_path'; then
2828 if ! bashio::fs.directory_exists "${config_path}"; then
2929 bashio::exit.nok "Configured config path does not exists"
3030 fi
31+ # Prevent using root directory as workspace to avoid performance issues
32+ if [[ "${config_path}" == "/" ]]; then
33+ bashio::exit.nok \
34+ "Using the root directory (/) as workspace is not allowed. " \
35+ "This causes severe performance issues as VS Code will index " \
36+ "the entire filesystem. Please use /config or another specific " \
37+ "directory instead."
38+ fi
3139fi
3240
3341# Ensure persistent data folder exists.
You can’t perform that action at this time.
0 commit comments