Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JappeHallunken authored Feb 10, 2024
2 parents 2415bfa + 8139155 commit 3f91d56
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ case $DISTRO in
6) distro='bullseye' exclude=',gcc-8-base,gcc-9-base';;
7|8)
exclude=',gcc-8-base,gcc-9-base,gcc-10-base,gcc-11-base'
[[ $DISTRO == 7 ]] && distro='bookworm' || distro='trixie' exclude+=',gcc-12-base'
[[ $DISTRO == 7 ]] && distro='bookworm' || distro='trixie' exclude+=',gcc-12-base,gcc-13-base'
[[ $HW_ARCH == 11 ]] && distro='sid' # RISC-V architecture is available on Sid only
# Raise root size where required
case $HW_MODEL in
Expand Down
2 changes: 2 additions & 0 deletions .build/software/gmediarender/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ then
echo 'Setting up environment file /etc/default/gmediarender ...'
[ ! -f '/boot/dietpi/.hw_model' ] || . /boot/dietpi/.hw_model
[ "$G_HW_UUID" ] || read -r G_HW_UUID < /proc/sys/kernel/random/uuid
read -r HOSTNAME < /etc/hostname
[ "$HOSTNAME" ] || HOSTNAME='DietPi'
INTERFACE=$(ip r l 0/0 | awk '{print $5;exit}')
[ "$INTERFACE" ] || INTERFACE=$(ip -br a | awk '$2=="UP"{print $1;exit}')
[ "$INTERFACE" ] || exit 1
Expand Down
36 changes: 19 additions & 17 deletions .build/software/vaultwarden/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,50 @@ do
exit 1
done

# Install Rust via https://rustup.rs/
# - ARMv7: Needs to be installed in tmpfs, else builds fail in emulated 32-bit ARM environments: https://github.com/rust-lang/cargo/issues/8719
# - ARMv8: Apply workaround for increased RAM usage: https://github.com/rust-lang/cargo/issues/10583
# shellcheck disable=SC2015
export HOME='/tmp/rustup' CARGO_NET_GIT_FETCH_WITH_CLI='true'
G_EXEC mkdir -p "$HOME"
G_DIETPI-NOTIFY 2 'Installing Rust via rustup'
# - ARMv6: Set default target explicitly, otherwise it compiles for ARMv7 in emulated container
grep -q '^ID=raspbian' /etc/os-release && G_HW_ARCH_NAME='armv6l' host=('--default-host' 'arm-unknown-linux-gnueabihf') || host=()
# - ARMv7: Apply workaround for failing crates index update in in emulated 32-bit ARM environments: https://github.com/rust-lang/cargo/issues/8719. CARGO_REGISTRIES_CRATES_IO_PROTOCOL='sparse' does not solve everything: https://github.com/rust-lang/cargo/issues/8719#issuecomment-1928540617
# - ARMv8: Apply workaround for increased cargo fetch RAM usage: https://github.com/rust-lang/cargo/issues/10583
# - Trixie: Set missing HOME, since the script runs from a systemd unit without login shell and hence no HOME set.
export HOME=$(mktemp -d) CARGO_NET_GIT_FETCH_WITH_CLI='true'
G_EXEC cd "$HOME"
G_EXEC curl -sSfo rustup-init.sh 'https://sh.rustup.rs'
G_EXEC chmod +x rustup-init.sh
# - ARMv6: Set default target explicitly, otherwise it compiles for ARMv7 in emulated container
grep -q '^ID=raspbian' /etc/os-release && G_HW_ARCH_NAME='armv6l' host=('--default-host' 'arm-unknown-linux-gnueabihf') || host=()
G_EXEC_OUTPUT=1 G_EXEC ./rustup-init.sh -y --profile minimal --default-toolchain none "${host[@]}"
G_EXEC rm rustup-init.sh
export PATH="$HOME/.cargo/bin:$PATH"

# Obtain latest versions
# - vaultwarden
version=$(curl -sSf 'https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest' | mawk -F\" '/^ "tag_name"/{print $4}')
version=$(curl -sSf 'https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}')
[[ $version ]] || { G_DIETPI-NOTIFY 1 'No latest vaultwarden version found, aborting ...'; exit 1; }
# - web vault
wv_url=$(curl -sSf 'https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' | mawk -F\" '/^ "browser_download_url".*\.tar\.gz"$/{print $4}')
wv_url=$(curl -sSf 'https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\.tar\.gz"$/{print $4}')
[[ $wv_url ]] || { G_DIETPI-NOTIFY 1 'No latest web vault version found, aborting ...'; exit 1; }

# Build
G_DIETPI-NOTIFY 2 "Building vaultwarden version \e[33m$version"
G_EXEC cd /tmp
G_EXEC curl -sSfLO "https://github.com/dani-garcia/vaultwarden/archive/$version.tar.gz"
[[ -d vaultwarden-$version ]] && G_EXEC rm -R "vaultwarden-$version"
G_EXEC tar xf "$version.tar.gz"
G_EXEC rm "$version.tar.gz"
G_EXEC cd "vaultwarden-$version"
G_EXEC_OUTPUT=1 G_EXEC cargo build --features sqlite --release
G_EXEC rustup self uninstall -y
G_EXEC strip --remove-section=.comment --remove-section=.note target/release/vaultwarden
# - Use new "release-micro" profile, which fixes 32-bit ARM builds and produces smaller binaries: https://github.com/dani-garcia/vaultwarden/issues/4320
PROFILE='release-micro'
G_EXEC_OUTPUT=1 G_EXEC cargo build --features sqlite --profile "$PROFILE"
G_EXEC_OUTPUT=1 G_EXEC rustup self uninstall -y
G_EXEC strip --remove-section=.comment --remove-section=.note "target/$PROFILE/vaultwarden"
G_EXEC cd ..

# Build DEB package
G_DIETPI-NOTIFY 2 'Building vaultwarden DEB package'
G_EXEC cd /tmp
DIR="vaultwarden_$G_HW_ARCH_NAME"
[[ -d $DIR ]] && G_EXEC rm -R "$DIR"
G_EXEC mkdir -p "$DIR/"{DEBIAN,opt/vaultwarden,mnt/dietpi_userdata/vaultwarden,lib/systemd/system}

# - Copy files in place
G_EXEC mv "vaultwarden-$version/target/release/vaultwarden" "$DIR/opt/vaultwarden/"
G_EXEC mv "vaultwarden-$version/target/$PROFILE/vaultwarden" "$DIR/opt/vaultwarden/"
G_EXEC mv "vaultwarden-$version/.env.template" "$DIR/mnt/dietpi_userdata/vaultwarden/vaultwarden.env"
G_EXEC rm -R "vaultwarden-$version"

Expand Down Expand Up @@ -241,9 +241,11 @@ G_CONFIG_INJECT 'Installed-Size: ' "Installed-Size: $(du -sk "$DIR" | mawk '{pri

# Build DEB package
G_EXEC_OUTPUT=1 G_EXEC dpkg-deb -b "$DIR"
G_EXEC mv "$DIR.deb" /tmp/

# Cleanup
G_EXEC rm -R "$DIR"
G_EXEC cd ..
G_EXEC rm -R "$HOME"

exit 0
}
14 changes: 14 additions & 0 deletions .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,20 @@ map $arg_v $asset_immutable {
fi
}

Patch_9_1()
{
# Software updates and migrations
if [[ -f '/boot/dietpi/.installed' ]]
then
# GMediaRender: https://dietpi.com/forum/t/gmediarender-default-args-on-allo-image-for-raspberry-pi/19205
if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[163\]=2' /boot/dietpi/.installed && grep -q ' -f -I ' /etc/default/gmediarender
then
G_DIETPI-NOTIFY 2 'Fixing default GMediaRender command arguments'
G_EXEC sed -i "s/ -f -I / -f $HOSTNAME -I /" /etc/default/gmediarender
fi
fi
}

# v6.35 => v7 migration
if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 ))
then
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ New images:

Enhancements:
- DietPi-Software | Domoticz: Enabled for x86_64 Bookworm and Trixie systems, since the latest x86_64 builds were compiled against libssl3.
- DietPi-Software | vaultwarden: Along with a regular update, RISC-V support has been added.
- DietPi-Software | Home Assistant: The Python version installed with Home Assistant has been raised to 3.12.1, to align with official appliances. Many thanks to @whyisthisbroken for making us aware if it: https://github.com/MichaIng/DietPi/issues/6906

Bug fixes:
- DietPi-Software | Mosquitto: Resolved an issue where the global software password was accidentally applied as username instead of as password: https://github.com/MichaIng/DietPi/issues/6886
- DietPi-Software | Amiberry: Resolved an issue where the installation failed on 64-bit RPi systems. Many thanks to @JerichoCross for reporting this issue: https://github.com/MichaIng/DietPi/issues/6893
- DietPi-Software | GMediaRender: Resolved an issue where the default command arguments were not set correctly on a fresh install. Many thanks to @ransur0t for reporting this issue: https://dietpi.com/forum/t/gmediarender-default-args-on-allo-image-for-raspberry-pi/19205
- DietPi-Software | Samba Server: Resolved an issue where our configuration file was not installed if the Samba Client was installed as well, or an SMB/CIFS mount done. Many thanks to @TheCrystalGipsy for reporting this issue: https://dietpi.com/forum/t/samba-share-issues-need-help/19224

As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/ADDME

Expand Down
10 changes: 4 additions & 6 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,6 @@ Available commands:
aSOFTWARE_CATX[$software_id]=4
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#vaultwarden'
aSOFTWARE_DEPS[$software_id]='87'
# - RISC-V: Compiling fails due to one dependency crate: https://github.com/briansmith/ring/pull/1562
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0
#------------------
software_id=198
aSOFTWARE_NAME[$software_id]='File Browser'
Expand Down Expand Up @@ -3417,7 +3415,7 @@ _EOF_
echo 'd /run/samba-cache' > /etc/tmpfiles.d/dietpi-samba_cache.conf

# Config: Preserve on reinstall
if [[ ! -f '/etc/samba/smb.conf' ]]
if [[ ! -f '/etc/samba/smb.conf' ]] || diff /usr/share/samba/smb.conf /etc/samba/smb.conf &> /dev/null
then
dps_index=$software_id Download_Install 'conf' /etc/samba/smb.conf
G_CONFIG_INJECT 'max connections =' "max connections = $(( $G_HW_CPU_CORES * 2 ))" /etc/samba/smb.conf
Expand Down Expand Up @@ -8932,7 +8930,7 @@ _EOF_
*) local arch='arm';;
esac

local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.2/syncthing-linux-$arch-v1.27.2.tar.gz"
local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.3/syncthing-linux-$arch-v1.27.3.tar.gz"
Download_Install "$(curl -sSfL 'https://api.github.com/repos/syncthing/syncthing/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/syncthing-linux-$arch-[^\"\/]*\.tar\.gz\"/{print \$4}")"
G_EXEC mv syncthing-* /opt/syncthing
fi
Expand Down Expand Up @@ -11093,7 +11091,7 @@ _EOF_
# v3 drops PHP 7.4 support: https://github.com/TasmoAdmin/TasmoAdmin/releases/tag/v3.0.0
if (( $G_DISTRO > 6 ))
then
local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.3.3/tasmoadmin_v3.3.3.tar.gz'
local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v4.0.0/tasmoadmin_v4.0.0.tar.gz'
Download_Install "$(curl -sSfL 'https://api.github.com/repos/TasmoAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}')"
else
Download_Install 'https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v2.4.2/tasmoadmin_v2.4.2.tar.gz'
Expand Down Expand Up @@ -11190,7 +11188,7 @@ _EOF_
local ha_user='homeassistant'
local ha_home="/home/$ha_user"
local ha_pyenv_activation=". $ha_home/pyenv-activate.sh"
local ha_python_version='3.11.6' # https://github.com/pyenv/pyenv/tree/master/plugins/python-build/share/python-build
local ha_python_version='3.12.1' # https://github.com/pyenv/pyenv/tree/master/plugins/python-build/share/python-build

G_DIETPI-NOTIFY 2 "Home Assistant user: $ha_user"
G_DIETPI-NOTIFY 2 "Home Assistant home: $ha_home"
Expand Down

0 comments on commit 3f91d56

Please sign in to comment.