Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Sofware | Homebridge: Bringing HomeKit support where there is none #6493

Merged
merged 5 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/dietpi-software.bash
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Process_Software()
#207) Moonlight (CLI), "moonlight" command
#208) Moonlight (GUI), "moonlight-qt" command
209) aCOMMANDS[i]='restic version';;
211) aCOMMANDS[i]='hb-service status' aSERVICES[i]='homebridge' aTCP[i]='8581'; (( $arch < 10 )) && aDELAY[i]=30; (( $arch == 3 )) && aDELAY[i]=120;;
*) :;;
esac
done
Expand Down Expand Up @@ -322,11 +323,12 @@ for i in $SOFTWARE; do G_CONFIG_INJECT "AUTO_SETUP_INSTALL_SOFTWARE_ID=$i" "AUTO
# Workaround for "Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 145." during Apache2 DEB postinst in 32-bit ARM Bookworm container: https://lists.ubuntu.com/archives/foundations-bugs/2022-January/467253.html
G_CONFIG_INJECT 'AUTO_SETUP_WEB_SERVER_INDEX=' 'AUTO_SETUP_WEB_SERVER_INDEX=-2' rootfs/boot/dietpi.txt

# Workaround for failing Redis, Raspotify and Navidrome as PrivateUsers=true leads to "Failed to set up user namespacing" on QEMU-emulated 32-bit ARM containers
G_EXEC mkdir rootfs/etc/systemd/system/{redis-server,raspotify,navidrome}.service.d
# Workaround for failing servkces as PrivateUsers=true leads to "Failed to set up user namespacing" on QEMU-emulated 32-bit ARM containers, and AmbientCapabilities to "Failed to apply ambient capabilities (before UID change): Operation not permitted"
G_EXEC mkdir rootfs/etc/systemd/system/{redis-server,raspotify,navidrome,homebridge}.service.d
G_EXEC eval 'echo -e '\''[Service]\nPrivateUsers=0'\'' > rootfs/etc/systemd/system/redis-server.service.d/dietpi-container.conf'
G_EXEC eval 'echo -e '\''[Service]\nPrivateUsers=0'\'' > rootfs/etc/systemd/system/raspotify.service.d/dietpi-container.conf'
G_EXEC eval 'echo -e '\''[Service]\nPrivateUsers=0'\'' > rootfs/etc/systemd/system/navidrome.service.d/dietpi-container.conf'
G_EXEC eval 'echo -e '\''[Service]\nAmbientCapabilities='\'' > rootfs/etc/systemd/system/homebridge.service.d/dietpi-container.conf'

# Workarounds for failing MariaDB install on Buster within GitHub Actions runner (both cannot be replicated on my test systems with and without QEMU):
# - mysqld does not have write access if our symlink is in place, even that directory permissions are correct.
Expand Down Expand Up @@ -384,7 +386,7 @@ _EOF_
done
# Check commands
[[ ${aCOMMANDS[i]} ]] && cat << _EOF_ >> rootfs/boot/Automation_Custom_Script.sh
echo '\e[33m[ INFO ] Testing command ${aCOMMANDS[i]}:\e[0m'
echo '\e[33m[ INFO ] Testing command "${aCOMMANDS[i]}":\e[0m'
${aCOMMANDS[i]} || { echo '\e[31m[FAILED] Command returned error code\e[0m'; exit_code=1; }
_EOF_
G_EXEC eval 'echo fi >> rootfs/boot/Automation_Custom_Script.sh'
Expand Down
1 change: 1 addition & 0 deletions .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ shopt -s extglob
do
aSOFTWARE_NAME8_20[i]=${aSOFTWARE_NAME8_19[i]}
done
aSOFTWARE_NAME8_20[211]='Homebridge'

# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
for i in "${aSOFTWARE_NAME8_20[@]}"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
v8.20
(2023-07-29)

New software:
- Homebridge | Bringing HomeKit support where there is none. Many thanks to @Zer0x00 for implementing it: https://github.com/MichaIng/DietPi/pull/6493

Enhancements:
- DietPi-LetsEncrypt | Updated the Lighttpd SSL config syntax and options according to latest Mozilla SSL config generator recommendation with intermediate client compatibility. Many thanks to @JappeHallunken for implementing this enhancement: https://github.com/MichaIng/DietPi/pull/6481
- DietPi-Software | WiFi Hotspot: The default DHCP server settings have been cleaned up and enhanced, with the default lease time increased from 10 minutes to 12 hours, the max lease time increased from 2 hours to 1 day, and the IP range extended up to 192.168.42.250.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ Links to hardware and software manufacturers, sources and build instructions use
- [Moonlight (GUI)](https://github.com/moonlight-stream/moonlight-qt)
- [Restic](https://github.com/restic/restic)
- [MediaWiki](https://github.com/wikimedia/mediawiki)
- [Homebridge](https://github.com/homebridge/homebridge)

---

Expand Down
1 change: 1 addition & 0 deletions dietpi/dietpi-services
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ _EOF_
'home-assistant'
'domoticz'
'openhab'
'homebridge'

# - Network
'noip2'
Expand Down
32 changes: 32 additions & 0 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,15 @@ Available commands:
aSOFTWARE_DEPS[$software_id]='196'
# - ARMv6: Requires at least Java 11
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
#------------------
software_id=211
aSOFTWARE_NAME[$software_id]='Homebridge'
aSOFTWARE_DESC[$software_id]='Bringing HomeKit support where there is none'
aSOFTWARE_CATX[$software_id]=17
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/home_automation/#homebridge'
# - RISC-V: Missing packages: https://repo.homebridge.io/dists/stable/Release
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0
#------------------

# Printing
#--------------------------------------------------------------------------------
Expand Down Expand Up @@ -11707,6 +11716,20 @@ _EOF_
G_EXEC mv mediawiki-* /var/www/wiki
fi

if To_Install 211 homebridge # Homebridge
then
# APT key
local url='https://repo.homebridge.io/KEY.gpg'
G_CHECK_URL "$url"
G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-homebridge.gpg --yes"

# APT list
G_EXEC eval 'echo '\''deb https://repo.homebridge.io stable main'\'' > /etc/apt/sources.list.d/dietpi-homebridge.list'
G_AGUP

G_AGI homebridge
fi

if To_Install 205 # Homer
then
# Download the latest release
Expand Down Expand Up @@ -14123,6 +14146,15 @@ _EOF_
Remove_Database mediawiki
fi

if To_Uninstall 211 # Homebridge
then
Remove_Service homebridge
G_AGP homebridge

[[ -f '/etc/apt/sources.list.d/dietpi-homebridge.list' ]] && G_EXEC rm /etc/apt/sources.list.d/dietpi-homebridge.list
[[ -f '/etc/apt/trusted.gpg.d/dietpi-homebridge.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-homebridge.gpg
fi

if To_Uninstall 198 # File Browser
then
Remove_Service filebrowser 1
Expand Down