diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 4dd6efdf90..28882c83ad 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 @@ -261,6 +262,8 @@ do #86|134|185) Process_Software 162;; # Docker does not start in systemd containers (without dedicated network) 166) Process_Software 70;; 180) (( $arch == 10 || $arch == 3 )) || Process_Software 170;; + 188) Process_Software 17;; + 213) Process_Software 17 188;; *) :;; esac Process_Software "$i" @@ -351,6 +354,7 @@ G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ INFO ] Unsup # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt # - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 +# - Set HOME path, required e.g. go builds, which is otherwise missing when started from a systemd unit. if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) then cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service @@ -361,6 +365,7 @@ After=dietpi-postboot.service [Service] Type=idle StandardOutput=tty +Environment=HOME=/root ExecStart=/bin/dash -c 'infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb; exec /boot/dietpi/dietpi-login' ExecStop=/sbin/poweroff diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 690509e96c..c13944aa27 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_6[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-services b/dietpi/dietpi-services index 07d9a13610..2c267a3045 100755 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -230,6 +230,7 @@ _EOF_ 'openbazaar' 'synapse' 'microblog-pub' + 'soju' # - Hardware Projects 'pi-spc' diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 68c980a882..50e323539f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1047,6 +1047,13 @@ Available commands: aSOFTWARE_CATX[$software_id]=6 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#mediawiki' aSOFTWARE_DEPS[$software_id]='88 89 webserver' + #------------------ + software_id=213 + 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' + aSOFTWARE_DEPS[$software_id]='188' # Camera & Surveillance #-------------------------------------------------------------------------------- @@ -12097,6 +12104,70 @@ If no WireGuard (auto)start is included, but you require it, please do the follo unset -v choice_required domain port invalid_text server_ip fi + + if To_Install 213 soju # soju + then + # Dependencies + aDEPS=('make' 'scdoc' 'gcc' 'libsqlite3-dev' 'libpam-dev') + + # 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 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 cp "${commands[@]}" /usr/local/bin/ + G_EXEC mkdir -p /usr/local/share/man/man1 + 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 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:// + listen unix+admin:// + _EOF_ + fi + + # User + 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: 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/ +Documentation=man:soju(1) man:sojuctl(1) +Wants=network-online.target +After=network-online.target + +[Service] +User=soju +RuntimeDirectory=soju +WorkingDirectory=/mnt/dietpi_userdata/soju +AmbientCapabilities=CAP_NET_BIND_SERVICE +ExecStart=/usr/local/bin/soju +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target +_EOF_ + fi } # $1: 0=None -1=Dropbear -2=OpenSSH @@ -14229,6 +14300,24 @@ _EOF_ [[ -d '/mnt/dietpi_userdata/spotifyd' ]] && G_EXEC rm -R /mnt/dietpi_userdata/spotifyd fi + 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" + done + for x in "${manpages[@]}" + do + [[ -f /usr/local/share/man/man1/$x ]] && G_EXEC rm "/usr/local/share/man/man1/$x" + done + [[ -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' # Uninstall finished, set all uninstalled software to state 0 (not installed)