- Start gnu screen automatically when connecting interactively to Home Assistant (keep terminal session across connections).
- Provide a status line in the terminal
- Define some aliases
- Automatically "re-install" after add-on upgrade (create symbolic links, .vimrc, .viminfo)
- Use vim when calling vi
- These files reside in /data
- The "Terminal & SSH" add-on automatically relinks the
.bash_profile
script (see /etc/cont-init.d/profile.sh ) - If you add a
requirements.txt
in /data then it will install the python modules listed in it. - Add the appropriate apks to your "Terminal & SSH configuration". This is
what my configuration looks like (
PUBLIC_KEY
andKEY_ALIAS
need to be replaced with your values - password is optional). You only need the 'screen' apk, I suggest the other ones (database access, install python modules):
authorized_keys:
- >-
ssh-rsa
PUBLIC_KEY KEY_ALIAS
password: ''
apks:
- screen
- etckeeper
- sqlite
- py3-pip
server:
tcp_forwarding: false
You can get started quickly with some of the following examples (on HAOS).
(Examples with ls -lrt
to view the files)
cd data
git init .
git remote add -t \* -f origin https://gist.github.com/07918a6a1300fa64f0faf08c7e2a1dd1.git
git checkout main
Using the zip will require that you update the zip file name and subdirectory:
cd /data
wget -O bashenv.zip https://gist.github.com/mdeweerd/07918a6a1300fa64f0faf08c7e2a1dd1/archive/dbcc36adb7b6f77541a5cbfd2f3fcfe5e7b26a7f.zip
unzip bashenv.zip
SDIR=07918a6a1300fa64f0faf08c7e2a1dd1-dbcc36adb7b6f77541a5cbfd2f3fcfe5e7b26a7f
mv ${SDIR}/* ${SDIR}/.[a-z]* .
rmdir ${SDIR}
ls -lrat
This is just a note regarding the keyboard layout for the machine's console, not the ssh add-on. This issue is discussed at home-assistant/operating-system#1775 .
The following may help to set the keymap:
apk update
apk add -s kbd-bkeymaps alpine-conf busybox-openrc
setup-keymap
# or
setup-keymap fr fr