mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-03 18:51:23 +00:00
✨ Initial add-on code
This commit is contained in:
parent
416e586602
commit
344e8f48be
20 changed files with 810 additions and 0 deletions
32
vscode/rootfs/etc/services.d/code/run
Normal file
32
vscode/rootfs/etc/services.d/code/run
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/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...'
|
||||
|
||||
# Non-interactive
|
||||
options+=(--port 1337)
|
||||
options+=(--data-dir "/data/vscode")
|
||||
|
||||
if bashio::config.false 'ssl'; then
|
||||
options+=(--allow-http)
|
||||
else
|
||||
options+=(--cert "/ssl/$(bashio::config 'certfile')")
|
||||
options+=(--cert-key "/ssl/$(bashio::config 'keyfile')")
|
||||
fi
|
||||
|
||||
if ! bashio::config.has_value 'password'; then
|
||||
options+=(--no-auth)
|
||||
else
|
||||
options+=(--password "$(bashio::config 'password')")
|
||||
fi
|
||||
|
||||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue