addon-vscode/vscode/rootfs/etc/services.d/code/run
2019-04-19 12:30:07 +02:00

28 lines
877 B
Text

#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: Visual Studio Code
# Runs the code server
# ==============================================================================
declare -a options
bashio::log.info 'Starting the code server...'
options+=(--port 8443)
options+=(--user-data-dir "/data/vscode")
options+=(--extensions-dir "/data/vscode/extensions")
options+=(--host 127.0.0.1)
options+=(--allow-http)
if bashio::config.true 'disable_telemetry'; then
options+=(--disable-telemetry)
fi
# Disable code authentication, we use HA authentication
options+=(--no-auth)
# Export env variables for the Home Assistant extension
export HASS_SERVER="http://hassio/homeassistant"
export HASS_TOKEN="${HASSIO_TOKEN:-}"
# Run the code server
exec code-server "${options[@]}" /config