Add support for public add-on configuration access (#732)

This commit is contained in:
Franck Nijhof 2023-11-10 10:58:47 +01:00 committed by GitHub
parent 982780c9b2
commit 579652261b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -19,12 +19,13 @@ hassio_api: true
hassio_role: manager hassio_role: manager
homeassistant_api: true homeassistant_api: true
map: map:
- config:rw
- ssl:rw
- addons:rw - addons:rw
- all_addon_configs:rw
- backup:rw
- homeassistant_config:rw
- media:rw - media:rw
- share:rw - share:rw
- backup:rw - ssl:rw
services: services:
- mysql:want - mysql:want
- mqtt:want - mqtt:want

View file

@ -4,7 +4,7 @@
# Home Assistant Community Add-on: Studio Code Server # Home Assistant Community Add-on: Studio Code Server
# Persists user settings and installs custom user packages. # Persists user settings and installs custom user packages.
# ============================================================================== # ==============================================================================
readonly -a DIRECTORIES=(addons backup config media share ssl) readonly -a DIRECTORIES=(addon_configs addons backup homeassistant media share ssl)
readonly GIT_USER_PATH=/data/git readonly GIT_USER_PATH=/data/git
readonly SSH_USER_PATH=/data/.ssh readonly SSH_USER_PATH=/data/.ssh
readonly ZSH_HISTORY_FILE=/root/.zsh_history readonly ZSH_HISTORY_FILE=/root/.zsh_history
@ -16,6 +16,12 @@ for dir in "${DIRECTORIES[@]}"; do
|| bashio::log.warning "Failed linking common directory: ${dir}" || bashio::log.warning "Failed linking common directory: ${dir}"
done done
# Some links to old locations, to not mess with the user's muscle memory
ln -s "/homeassistant" "/config" \
|| bashio::log.warning "Failed linking common directory: ${dir}"
ln -s "/homeassistant" "${HOME}/config" \
|| bashio::log.warning "Failed linking common directory: ${dir}
# Store SSH settings in add-on data folder # Store SSH settings in add-on data folder
if ! bashio::fs.directory_exists "${SSH_USER_PATH}"; then if ! bashio::fs.directory_exists "${SSH_USER_PATH}"; then
mkdir -p "${SSH_USER_PATH}" \ mkdir -p "${SSH_USER_PATH}" \