Skip to content

Commit 1470a6b

Browse files
subnutMichaIng
andauthored
v9.6 (#7124)
- DietPi-Software | soju: This IRC bouncer has been added to our software catalogue. Many thanks to @subnut for implementing it: #7124 Co-authored-by: MichaIng <[email protected]>
1 parent 867adda commit 1470a6b

File tree

6 files changed

+100
-0
lines changed

6 files changed

+100
-0
lines changed

.github/workflows/dietpi-software.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Process_Software()
240240
209) aCOMMANDS[i]='restic version';;
241241
211) aCOMMANDS[i]='hb-service status' aSERVICES[i]='homebridge' aTCP[i]='8581'; (( $arch < 10 )) && aDELAY[i]=30; (( $arch == 3 )) && aDELAY[i]=120;;
242242
212) aSERVICES[i]='kavita' aTCP[i]='2036'; (( $arch < 10 )) && aDELAY[i]=180; (( $arch == 10 )) && aDELAY[i]=30;;
243+
213) aSERVICES[i]='soju' aTCP[i]='6667';;
243244
*) :;;
244245
esac
245246
done
@@ -261,6 +262,8 @@ do
261262
#86|134|185) Process_Software 162;; # Docker does not start in systemd containers (without dedicated network)
262263
166) Process_Software 70;;
263264
180) (( $arch == 10 || $arch == 3 )) || Process_Software 170;;
265+
188) Process_Software 17;;
266+
213) Process_Software 17 188;;
264267
*) :;;
265268
esac
266269
Process_Software "$i"
@@ -351,6 +354,7 @@ G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ INFO ] Unsup
351354
# Enable automated setup
352355
G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt
353356
# - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962
357+
# - Set HOME path, required e.g. go builds, which is otherwise missing when started from a systemd unit.
354358
if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) ))
355359
then
356360
cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service
@@ -361,6 +365,7 @@ After=dietpi-postboot.service
361365
[Service]
362366
Type=idle
363367
StandardOutput=tty
368+
Environment=HOME=/root
364369
ExecStart=/bin/dash -c 'infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb; exec /boot/dietpi/dietpi-login'
365370
ExecStop=/sbin/poweroff
366371

.meta/dietpi-survey_report

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ shopt -s extglob
726726
do
727727
aSOFTWARE_NAME9_6[i]=${aSOFTWARE_NAME9_5[i]}
728728
done
729+
aSOFTWARE_NAME9_6[213]='soju'
729730

730731
# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
731732
for i in "${aSOFTWARE_NAME9_6[@]}"

CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
v9.6
22
(2024-07-06)
33

4+
New software:
5+
- 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
6+
47
Enhancements:
58
- 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.
69
- 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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ Links to hardware and software manufacturers, sources and build instructions use
340340
- [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image)
341341
- [Kavita](https://github.com/Kareadita/Kavita)
342342
- [Forgejo](https://codeberg.org/forgejo/forgejo)
343+
- [soju](https://github.com/emersion/soju)
343344

344345
---
345346

dietpi/dietpi-services

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ _EOF_
230230
'openbazaar'
231231
'synapse'
232232
'microblog-pub'
233+
'soju'
233234

234235
# - Hardware Projects
235236
'pi-spc'

dietpi/dietpi-software

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,13 @@ Available commands:
10471047
aSOFTWARE_CATX[$software_id]=6
10481048
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#mediawiki'
10491049
aSOFTWARE_DEPS[$software_id]='88 89 webserver'
1050+
#------------------
1051+
software_id=213
1052+
aSOFTWARE_NAME[$software_id]='soju'
1053+
aSOFTWARE_DESC[$software_id]='A user-friendly IRC bouncer'
1054+
aSOFTWARE_CATX[$software_id]=6
1055+
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#soju'
1056+
aSOFTWARE_DEPS[$software_id]='188'
10501057

10511058
# Camera & Surveillance
10521059
#--------------------------------------------------------------------------------
@@ -12097,6 +12104,70 @@ If no WireGuard (auto)start is included, but you require it, please do the follo
1209712104

1209812105
unset -v choice_required domain port invalid_text server_ip
1209912106
fi
12107+
12108+
if To_Install 213 soju # soju
12109+
then
12110+
# Dependencies
12111+
aDEPS=('make' 'scdoc' 'gcc' 'libsqlite3-dev' 'libpam-dev')
12112+
12113+
# Download
12114+
local fallback_url='https://github.com/emersion/soju/releases/download/v0.8.0/soju-0.8.0.tar.gz'
12115+
Download_Install "$(curl -sSfL 'https://api.github.com/repos/emersion/soju/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/soju-[^"\/]*\.tar\.gz"$/{print $4}')"
12116+
12117+
# Build
12118+
G_EXEC cd soju-*
12119+
G_EXEC_OUTPUT=1 G_EXEC make all "-j$(nproc)" config_path='/mnt/dietpi_userdata/soju/config' GOFLAGS='-tags=pam,libsqlite3'
12120+
12121+
# Install
12122+
local commands=('soju' 'sojuctl' 'sojudb')
12123+
local manpages=('doc/soju.1' 'doc/sojuctl.1')
12124+
G_EXEC cp "${commands[@]}" /usr/local/bin/
12125+
G_EXEC mkdir -p /usr/local/share/man/man1
12126+
G_EXEC cp "${manpages[@]}" /usr/local/share/man/man1/
12127+
12128+
# Config
12129+
if [[ ! -f '/mnt/dietpi_userdata/soju/config' ]]
12130+
then
12131+
# We shall default to on-disk chat logs
12132+
# It's a lossy format, as stated under `message-store` subsection in https://soju.im/doc/soju.1.html#CONFIG_FILE
12133+
# But it's the recommended setting as per https://git.sr.ht/~emersion/soju/tree/master/doc/getting-started.md
12134+
G_EXEC mkdir -p /mnt/dietpi_userdata/soju
12135+
cat <<- '_EOF_' > /mnt/dietpi_userdata/soju/config
12136+
db sqlite3 /mnt/dietpi_userdata/soju/data.db
12137+
message-store fs /mnt/dietpi_userdata/soju/logs
12138+
listen irc+insecure://
12139+
listen unix+admin://
12140+
_EOF_
12141+
fi
12142+
12143+
# User
12144+
Create_User -d /mnt/dietpi_userdata/soju soju
12145+
G_EXEC chown 'soju:soju' -R /mnt/dietpi_userdata/soju
12146+
G_EXEC chmod 0660 -R /mnt/dietpi_userdata/soju
12147+
G_EXEC chmod 0770 /mnt/dietpi_userdata/soju
12148+
12149+
# Service: https://github.com/emersion/soju/blob/master/contrib/soju.service
12150+
# - CAP_NET_BIND_SERVICE needed for builtin identd server: https://github.com/emersion/soju/blob/master/doc/packaging.md#binding-to-privileged-ports
12151+
cat << '_EOF_' > /etc/systemd/system/soju.service
12152+
[Unit]
12153+
Description=soju IRC bouncer service
12154+
Documentation=https://soju.im/
12155+
Documentation=man:soju(1) man:sojuctl(1)
12156+
Wants=network-online.target
12157+
After=network-online.target
12158+
12159+
[Service]
12160+
User=soju
12161+
RuntimeDirectory=soju
12162+
WorkingDirectory=/mnt/dietpi_userdata/soju
12163+
AmbientCapabilities=CAP_NET_BIND_SERVICE
12164+
ExecStart=/usr/local/bin/soju
12165+
ExecReload=/bin/kill -HUP $MAINPID
12166+
12167+
[Install]
12168+
WantedBy=multi-user.target
12169+
_EOF_
12170+
fi
1210012171
}
1210112172

1210212173
# $1: 0=None -1=Dropbear -2=OpenSSH
@@ -14229,6 +14300,24 @@ _EOF_
1422914300
[[ -d '/mnt/dietpi_userdata/spotifyd' ]] && G_EXEC rm -R /mnt/dietpi_userdata/spotifyd
1423014301
fi
1423114302

14303+
if To_Uninstall 213 # soju
14304+
then
14305+
Remove_Service soju 1 1
14306+
local x
14307+
local commands=('soju' 'sojuctl' 'sojudb')
14308+
local manpages=('soju.1' 'sojuctl.1')
14309+
for x in "${commands[@]}"
14310+
do
14311+
[[ -f /usr/local/bin/$x ]] && G_EXEC rm "/usr/local/bin/$x"
14312+
done
14313+
for x in "${manpages[@]}"
14314+
do
14315+
[[ -f /usr/local/share/man/man1/$x ]] && G_EXEC rm "/usr/local/share/man/man1/$x"
14316+
done
14317+
[[ -d '/usr/local/share/man/man1' ]] && G_EXEC rmdir -p --ignore-fail-on-non-empty /usr/local/share/man/man1
14318+
[[ -d '/mnt/dietpi_userdata/soju' ]] && G_EXEC rm -Rf /mnt/dietpi_userdata/soju
14319+
fi
14320+
1423214321
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Finalising uninstall'
1423314322

1423414323
# Uninstall finished, set all uninstalled software to state 0 (not installed)

0 commit comments

Comments
 (0)