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-Software | Kavita: An open-source comics/mangas/ebooks with a built-in web reader #6610

Merged
merged 8 commits into from
Sep 21, 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
1 change: 1 addition & 0 deletions .github/workflows/dietpi-software.bash
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ Process_Software()
#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;;
212) aSERVICES[i]='kavita' aTCP[i]='2036'; (( $arch < 10 )) && aDELAY[i]=180; (( $arch == 10 )) && aDELAY[i]=30;;
*) :;;
esac
done
Expand Down
1 change: 1 addition & 0 deletions .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ shopt -s extglob
aSOFTWARE_NAME8_22[i]=${aSOFTWARE_NAME8_21[i]}
done
aSOFTWARE_NAME8_22[141]='ADS-B Feeder'
aSOFTWARE_NAME8_22[212]='Kavita'

# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
for i in "${aSOFTWARE_NAME8_22[@]}"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ v8.22

New software:
- ADS-B Feeder | Track airplanes using SDRs and feed the data to ADS-B aggregators. Many thanks to @dirkhh for maintaining and implementing this software option: https://github.com/MichaIng/DietPi/pull/6587
- Kavita | This open source comics/mangas/ebooks media server with a built-in web reader has been added to our software catalogue. Many thanks to @drahen for implementing this software option: https://github.com/MichaIng/DietPi/pull/6610

Enhancements:
- Images | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. The partition is removed automatically on first boot, after copying all supported config files/scripts. Related CLI flags have been added to our build scripts: "--add-fat-part" for dietpi-imager and "--no-fat-part" for dietpi-build. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ Links to hardware and software manufacturers, sources and build instructions use
- [MediaWiki](https://github.com/wikimedia/mediawiki)
- [Homebridge](https://github.com/homebridge/homebridge)
- [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image)
- [Kavita](https://github.com/Kareadita/Kavita)

---

Expand Down
1 change: 1 addition & 0 deletions dietpi/dietpi-services
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ _EOF_
'jellyfin'
'snapclient'
'spotifyd'
'kavita'

# - Download/BitTorrent
'medusa'
Expand Down
83 changes: 83 additions & 0 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,16 @@ Available commands:
aSOFTWARE_DEPS[$software_id]='5 7'
# - RISC-V: No archive: https://github.com/navidrome/navidrome/releases/
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0
#------------------
software_id=212
aSOFTWARE_NAME[$software_id]='Kavita'
aSOFTWARE_DESC[$software_id]='open source comics/mangas/ebooks media server with a built-in web reader'
aSOFTWARE_CATX[$software_id]=2
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#kavita'
# - ARMv6: ARM binaries are ARMv7+ Only
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
# - No RISC-V support yet: https://github.com/Kareadita/Kavita/releases
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0

# BitTorrent & Download
#--------------------------------------------------------------------------------
Expand Down Expand Up @@ -6427,6 +6437,73 @@ _EOF_
Download_Test_Media
fi

if To_Install 212 kavita # Kavita
then
# .NET dependency: https://github.com/dotnet/core/blob/main/Documentation/linux-prereqs.md
case $G_DISTRO in
5) aDEPS=('libicu63');;
6) aDEPS=('libicu67');;
*) aDEPS=('libicu72');;
esac

case $G_HW_ARCH in
MichaIng marked this conversation as resolved.
Show resolved Hide resolved
2) local arch='arm';;
3) local arch='arm64';;
*) local arch='x64';;
esac

local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.7.8/kavita-linux-$arch.tar.gz"
Download_Install "$(curl -sSfL 'https://api.github.com/repos/Kareadita/Kavita/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/kavita-linux-$arch\.tar\.gz\"$/{print \$4}")"
G_EXEC chmod +x Kavita/Kavita

# Change default port to 2036 to avoid conflict with Shairport Sync
G_CONFIG_INJECT '"Port":' ' "Port": 2036,' Kavita/config/appsettings.json

# Reinstall: Preserve config dir
if [[ -d '/opt/kavita' ]]
then
if [[ -d '/opt/kavita/config' ]]
then
G_EXEC rm -R Kavita/config
G_EXEC mv /opt/kavita/config Kavita/
fi
G_EXEC rm -R /opt/kavita
fi
G_EXEC mv Kavita /opt/kavita

# User
Create_User -g dietpi -d /opt/kavita kavita
G_EXEC chown -R kavita:root /opt/kavita

# Data
G_EXEC mkdir -p /mnt/dietpi_userdata/{ebooks,comics}
MichaIng marked this conversation as resolved.
Show resolved Hide resolved
G_EXEC chown kavita:dietpi /mnt/dietpi_userdata/{ebooks,comics}
G_EXEC chmod 0775 /mnt/dietpi_userdata/{ebooks,comics}

# Service: https://wiki.kavitareader.com/en/install/linux-install
cat << '_EOF_' > /etc/systemd/system/kavita.service
[Unit]
Description=Kavita Server (DietPi)
Wants=network-online.target
After=network-online.target remote-fs.target
drahen marked this conversation as resolved.
Show resolved Hide resolved
StartLimitIntervalSec=60
StartLimitBurst=5

[Service]
SyslogIdentifier=Kavita
User=kavita
WorkingDirectory=/opt/kavita
ExecStart=/opt/kavita/Kavita
TimeoutStopSec=20
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target
_EOF_
G_DIETPI-NOTIFY 2 'Please wait for a few minutes to let the application starts. By default it runs on port 2036.'
fi

if To_Install 68 # Remote.It
then
case $G_HW_ARCH in
Expand Down Expand Up @@ -13215,6 +13292,12 @@ If no WireGuard (auto)start is included, but you require it, please do the follo
G_EXEC rm -Rf /opt/navidrome /mnt/dietpi_userdata/navidrome
fi

if To_Uninstall 212 # Kavita
then
Remove_Service kavita 1
G_EXEC rm -Rf /opt/Kavita
fi

if To_Uninstall 71 # WebIOPi
then
Remove_Service webiopi
Expand Down