Skip to content

Commit

Permalink
Allow HA commands without an interactive shell
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Apr 29, 2023
1 parent 5905de3 commit d289ab5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ssh/rootfs/etc/s6-overlay/s6-rc.d/init-user/run
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ echo "export SUPERVISOR_TOKEN=\"${SUPERVISOR_TOKEN}\"" \
>> "${HOME_ASSISTANT_PROFILE_D_FILE}" \
|| bashio::exit.nok 'Failed to export Supervisor API token'

echo "SUPERVISOR_TOKEN=${SUPERVISOR_TOKEN}" > /data/.ssh/environment \
|| bashio::exit.nok 'Failed to set Supervisor API token in env'

# Sets up the users .ssh folder to be persistent
if ! bashio::fs.directory_exists "${SSH_USER_PATH}"; then
mkdir -p "${SSH_USER_PATH}" \
Expand Down
2 changes: 1 addition & 1 deletion ssh/rootfs/etc/ssh/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ AuthorizedKeysFile /etc/ssh/authorized_keys ~/.ssh/authorized_keys

# Environment
# ===================
PermitUserEnvironment no
PermitUserEnvironment SUPERVISOR_TOKEN

# Forwarding / Tunnel
# ===================
Expand Down
3 changes: 2 additions & 1 deletion ssh/rootfs/etc/sudoers.d/ssh-agent-env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Defaults env_keep += SSH_AUTH_SOCK
Defaults env_keep += SSH_AUTH_SOCK
Defaults env_keep += SUPERVISOR_TOKEN

0 comments on commit d289ab5

Please sign in to comment.