diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 4dd6efdf90..190bd6babe 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -240,6 +240,7 @@ Process_Software() 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;; 212) aSERVICES[i]='kavita' aTCP[i]='2036'; (( $arch < 10 )) && aDELAY[i]=180; (( $arch == 10 )) && aDELAY[i]=30;; + 213) aSERVICES[i]='soju' aTCP[i]='6667';; *) :;; esac done diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 690509e96c..7e742f0d36 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -726,6 +726,7 @@ shopt -s extglob do aSOFTWARE_NAME9_6[i]=${aSOFTWARE_NAME9_5[i]} done + aSOFTWARE_NAME9_5[213]='soju' # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs for i in "${aSOFTWARE_NAME9_6[@]}" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8a9913100b..f94024d1ce 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ v9.6 (2024-07-06) +New software: +- soju | This IRC bouncer has been added to our software catalogue. Many thanks to @subnut for implementing it: https://github.com/MichaIng/DietPi/pull/7124 + Enhancements: - General | Since we provide all kernel, bootloader and firmware packages from our own APT repository now, the Armbian APT repository is removed form all systems. In case you use an SBC which is not officially supported by DietPi, as generic device, it is however preserved. - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 diff --git a/README.md b/README.md index a6805bf5bf..95022d1050 100644 --- a/README.md +++ b/README.md @@ -340,6 +340,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image) - [Kavita](https://github.com/Kareadita/Kavita) - [Forgejo](https://codeberg.org/forgejo/forgejo) +- [soju](https://github.com/emersion/soju) --- diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index eade26ae21..5fe77e9936 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1049,7 +1049,7 @@ Available commands: aSOFTWARE_DEPS[$software_id]='88 89 webserver' #------------------ software_id=213 - aSOFTWARE_NAME[$software_id]='Soju' + aSOFTWARE_NAME[$software_id]='soju' aSOFTWARE_DESC[$software_id]='A user-friendly IRC bouncer' aSOFTWARE_CATX[$software_id]=6 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#soju' @@ -12107,30 +12107,32 @@ If no WireGuard (auto)start is included, but you require it, please do the follo if To_Install 213 # soju then - local ver=0.8.0 + # Dependencies aDEPS=('gcc' 'make' 'pkg-config' 'scdoc' 'libpam-dev' 'libsqlite3-dev') - Download_Install "https://git.sr.ht/~emersion/soju/archive/v${ver}.tar.gz" - G_EXEC cd "soju-v${ver}" + + # Download + local fallback_url='https://github.com/emersion/soju/releases/download/v0.8.0/soju-0.8.0.tar.gz' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/emersion/soju/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/soju-[^"\/]*\.tar\.gz"$/{print $4}')" # Build - G_EXEC_OUTPUT=1 G_EXEC make all "-j$(nproc)" \ - config_path=/mnt/dietpi_userdata/soju/config - GOFLAGS=-tags=pam,libsqlite3 \ + G_EXEC cd soju-* + G_EXEC_OUTPUT=1 G_EXEC make all "-j$(nproc)" config_path='/mnt/dietpi_userdata/soju/config' GOFLAGS='-tags=pam,libsqlite3' # Install local commands=('soju' 'sojuctl' 'sojudb') local manpages=('doc/soju.1' 'doc/sojuctl.1') - G_EXEC mkdir -p /usr/local/bin + G_EXEC cp "${commands[@]}" /usr/local/bin/ G_EXEC mkdir -p /usr/local/share/man/man1 - G_EXEC mkdir -p /mnt/dietpi_userdata/soju - G_EXEC cp "${commands[@]}" /usr/local/bin - G_EXEC cp "${manpages[@]}" /usr/local/share/man/man1 - if [[ ! -f '/mnt/dietpi_userdata/soju/config' ]]; then + G_EXEC cp "${manpages[@]}" /usr/local/share/man/man1/ + + # Config + if [[ ! -f '/mnt/dietpi_userdata/soju/config' ]] + then # We shall default to on-disk chat logs # It's a lossy format, as stated under `message-store` subsection in https://soju.im/doc/soju.1.html#CONFIG_FILE # But it's the recommended setting as per https://git.sr.ht/~emersion/soju/tree/master/doc/getting-started.md - G_EXEC touch /mnt/dietpi_userdata/soju/config - cat <<- _EOF_ > /mnt/dietpi_userdata/soju/config + G_EXEC mkdir -p /mnt/dietpi_userdata/soju + cat <<- '_EOF_' > /mnt/dietpi_userdata/soju/config db sqlite3 /mnt/dietpi_userdata/soju/data.db message-store fs /mnt/dietpi_userdata/soju/logs listen irc+insecure:// @@ -12139,14 +12141,14 @@ If no WireGuard (auto)start is included, but you require it, please do the follo fi # User - Create_User soju - G_EXEC chown soju:soju -R /mnt/dietpi_userdata/soju + Create_User -d /mnt/dietpi_userdata/soju soju + G_EXEC chown 'soju:soju' -R /mnt/dietpi_userdata/soju G_EXEC chmod 0660 -R /mnt/dietpi_userdata/soju G_EXEC chmod 0770 /mnt/dietpi_userdata/soju - # Service - # Modified version of ./contrib/soju.service - cat << _EOF_ > /etc/systemd/system/soju.service + # Service: https://github.com/emersion/soju/blob/master/contrib/soju.service + # - CAP_NET_BIND_SERVICE needed for builtin identd server: https://github.com/emersion/soju/blob/master/doc/packaging.md#binding-to-privileged-ports + cat << '_EOF_' > /etc/systemd/system/soju.service [Unit] Description=soju IRC bouncer service Documentation=https://soju.im/ @@ -12155,16 +12157,14 @@ Wants=network-online.target After=network-online.target [Service] -Type=simple User=soju -Group=soju RuntimeDirectory=soju RuntimeDirectoryMode=0770 RuntimeDirectoryPreserve=restart WorkingDirectory=/mnt/dietpi_userdata/soju AmbientCapabilities=CAP_NET_BIND_SERVICE ExecStart=/usr/local/bin/soju -ExecReload=/bin/kill -HUP \$MAINPID +ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure [Install] @@ -14303,23 +14303,22 @@ _EOF_ [[ -d '/mnt/dietpi_userdata/spotifyd' ]] && G_EXEC rm -R /mnt/dietpi_userdata/spotifyd fi - if To_Uninstall 213 # Soju + if To_Uninstall 213 # soju then Remove_Service soju 1 1 - local x local commands=('soju' 'sojuctl' 'sojudb') local manpages=('soju.1' 'sojuctl.1') - for x in "${commands[@]}"; do - [[ -f "/usr/local/bin/$x" ]] && - G_EXEC rm "/usr/local/bin/$x" + for x in "${commands[@]}" + do + [[ -f /usr/local/bin/$x ]] && G_EXEC rm "/usr/local/bin/$x" done - for x in "${manpages[@]}"; do - [[ -f "/usr/local/share/man/man${x##*.}/$x" ]] && - G_EXEC rm "/usr/local/share/man/man${x##*.}/$x" + for x in "${manpages[@]}" + do + [[ -f /usr/local/share/man/man1/$x ]] && G_EXEC rm "/usr/local/share/man/man1/$x" done - [[ -d '/mnt/dietpi_userdata/soju' ]] && - G_EXEC rm -Rf /mnt/dietpi_userdata/soju + [[ -d '/usr/local/share/man/man1' ]] && G_EXEC rmdir -p --ignore-fail-on-non-empty /usr/local/share/man/man1 + [[ -d '/mnt/dietpi_userdata/soju' ]] && G_EXEC rm -Rf /mnt/dietpi_userdata/soju fi G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Finalising uninstall'