Skip to content

Commit

Permalink
Merge branch 'swizzin:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kthxbai authored Apr 22, 2023
2 parents a039f50 + 31d9a5f commit 249be71
Show file tree
Hide file tree
Showing 25 changed files with 3,884 additions and 175 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Changelog

## [3.7.1]

## April 15, 2023

### Updated
- rutorrent: version 4.0.2, 4.0.3 compatibility

### Fixed
- rtorrent:
- resolve lockfile crash
- patch xmlrpc-c for newer architectures
- support 10gbit throttles
- lower repo priority on the installation options
- nextcloud: version pinned everything except jammy
- lounge: remove problematic `npm config set`

## [3.7.0]

## April 2, 2023

This release is mainly aimed at improving the ruTorrent issues as a result of a recent surge in development, but a few other improvements made it in as well.

### New
- New application: jfa-go

### Changed
- qbittorrent: disabled 4.5 branch on buster due to gcc incompatibilities
- rtorrent: compiliation improvements and better LTO settings thanks to @stickz
- rtorrent: installation speed improvements thanks to @stickz
- php: will now set path in the pool config, avoiding the need to manually set path in ruTorrent configs
- readme: removed more feathub links

### Fixed
- rtx: revert to filemanager pinning on 4.0 rutorrent version
- rtx: better tag detection of your current installation
- rtx: ensure rutorrent directory is a git safe.dir
- rutorrent: better version matching, avoid beta releases now that 4.0 is stable
- rutorrent: botched scgi creation
- quota: fix rutorrent diskspace creation (use existing function rather than duplicate code)
- wireguard: finally found the pesky bug causing rt kernel to be installed in buster (should be generally more functional in buster now as well)
- box list: not showing package names

## [3.6.0]

## January 21, 2023
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

[![CodeFactor](https://www.codefactor.io/repository/github/liaralabs/swizzin/badge)](https://www.codefactor.io/repository/github/liaralabs/swizzin) [![Discord](https://img.shields.io/discord/577667871727943696?logo=discord&logoColor=white)](https://discord.gg/sKjs9UM) ![GitHub](https://img.shields.io/github/license/liaralabs/swizzin) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/liaralabs/swizzin) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/liaralabs/swizzin)

# 3.6.0 Stable
# 3.7.1 Stable

[website](https://swizzin.ltd) \| [docs](https://swizzin.ltd/getting-started) \| [discord](https://discord.gg/bDFqAUF)

Please use Discord for all community functions, [feathub](https://feathub.com/liaralabs/swizzin) for feature requests and leave issues for actual issues.

Please use [Discord](https://discord.gg/bDFqAUF) for all community functions, and [GitHub discussions](https://github.com/swizzin/swizzin/discussions) for feature requests and to raise issues.

## What is swizzin?
Swizzin is a light, modular seedbox solution that can be installed on Debian 10/11 or Ubuntu 20.04/22.04. The QuickBox package repo has been ported over for your installing pleasure, including the panel -- if you so choose!
Expand Down
2 changes: 1 addition & 1 deletion scripts/box
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function _list() {
spacing=$(echo $'\t' | pr -Te15)
description=$(grep -i -m 1 \\\[\'$app $locale | cut -d= -f2 | sed "s/ '//g" | sed "s/';//g" | sed "s/\\\'/'/g")
if [[ -z $description ]]; then description="Description missing"; fi
printf "${sgformat}" "$i"
printf "${sgformat}" "$app"
echo -e "${description}\n" | fmt --goal=50 | sed -e "2,\$s/^/$spacing/"

done
Expand Down
54 changes: 54 additions & 0 deletions scripts/install/jfago.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
#
# authors: SavageCore
#
# Licensed under GNU General Public License v3.0 GPL-3 (in short)

# Add the jfa-go official repository and key to our installation so we can use apt-get to install it.
echo_progress_start "Setting up jfa-go repository"
curl -s "https://apt.hrfee.dev/hrfee.pubkey.gpg" | gpg --dearmor > /usr/share/keyrings/jfa-go-archive-keyring.gpg 2>> "${log}"
echo "deb [signed-by=/usr/share/keyrings/jfa-go-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://apt.hrfee.dev trusty main" > /etc/apt/sources.list.d/jfa-go.list
echo_progress_done "Repository added"

# Install jfa-go using apt functions.
# Install crudini to edit the config file
apt_update
apt_install jfa-go crudini

# Configure the nginx proxypass using positional parameters.
if [[ -f /install/.nginx.lock ]]; then
bash /usr/local/bin/swizzin/nginx/jfago.sh
systemctl -q restart nginx.service
else
echo_info "jfago will run on port 8056"
fi

# Create systemd service
echo_progress_start "Setting up systemd service"
jfagobinary=$(which jfa-go)
cat > "/etc/systemd/system/jfago.service" << ADC
[Unit]
Description=An account management system for Jellyfin.
[Service]
ExecStart=$jfagobinary -config /root/.config/jfa-go/config.ini -data /root/.config/jfa-go/
[Install]
WantedBy=multi-user.target
ADC

systemctl daemon-reload -q
echo_progress_done "Service installed"

# Start the service
echo_progress_start "Enabling and starting jfago to create config file"
systemctl -q enable jfago --now
echo_progress_done

crudini --set /root/.config/jfa-go/config.ini ui url_base /jfa-go

# This file is created after installation to prevent reinstalling. You will need to remove the app first which deletes this file.
touch /install/.jfago.lock
echo_success "jfago installed but not configured"
echo_info "Edit /root/.config/jfa-go/config.ini to configure and then restart the service with systemctl restart jfago"
exit
5 changes: 0 additions & 5 deletions scripts/install/lounge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ function _install() {

useradd lounge --system -m -d /opt/lounge

npm -g config set user root || {
echo_error "npm config step failed"
exit 1
}

echo_progress_start "Installing lounge from npm"
yarn --non-interactive global add thelounge >> $log 2>&1 || {
echo_error "Lounge failed to install"
Expand Down
10 changes: 4 additions & 6 deletions scripts/install/nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ else
#a2enmod rewrite > /dev/null 2>&1
cd /tmp

#Nextcloud 16 no longer supports php7.0, so 15 is the last supported release for Debian 9/Xenial
#Nextcloud 21 no longer supports php7.2 so 20 is the latest supported release for Bionic
echo_progress_start "Downloading and extracting Nextcloud"
codename=$(lsb_release -cs)
case $codename in
stretch)
version=latest-15
buster)
version=latest-23
;;
bionic)
version=latest-20
focal | bullseye)
version=latest-25
;;
*)
version=latest
Expand Down
1 change: 1 addition & 0 deletions scripts/install/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ for version in $phpv; do
-e "s/;opcache.max_accelerated_files=2000/opcache.max_accelerated_files=4000/" \
-e "s/;opcache.revalidate_freq=2/opcache.revalidate_freq=240/" /etc/php/$version/fpm/php.ini
phpenmod -v $version opcache
sed -i 's/;env\[PATH\]/env[PATH]/g' /etc/php/$version/fpm/pool.d/www.conf
done
echo_progress_done "PHP config modified"

Expand Down
33 changes: 3 additions & 30 deletions scripts/install/quota.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,36 +105,9 @@ function _installquota() {
fi

if [[ -d /srv/rutorrent ]]; then
cat > /srv/rutorrent/plugins/diskspace/action.php << 'DSKSP'
<?php
#################################################################################
## [Quick Box - action.php modified for quota systems use]
#################################################################################
# QUICKLAB REPOS
# QuickLab _ packages: https://github.com/QuickBox/quickbox_rutorrent-plugins
# LOCAL REPOS
# Local _ packages : ~/QuickBox/rtplugins
# Author : QuickBox.IO
# URL : https://plaza.quickbox.io
#
#################################################################################
require_once( '../../php/util.php' );
if (isset($quotaUser) && file_exists('/install/.quota.lock')) {
$total = shell_exec("sudo /usr/bin/quota -wu ".$quotaUser."| tail -n 1 | sed -e 's|^[ \t]*||' | awk '{print $3*1024}'");
$used = shell_exec("sudo /usr/bin/quota -wu ".$quotaUser."| tail -n 1 | sed -e 's|^[ \t]*||' | awk '{print $2*1024}'");
$free = sprintf($total - $used);
cachedEcho('{ "total": '.$total.', "free": '.$free.' }',"application/json");
} else {
cachedEcho('{ "total": '.disk_total_space($topDirectory).', "free": '.disk_free_space($topDirectory).' }',"application/json");
}
?>
DSKSP
if [[ $primaryroot == "root" ]]; then
sed -i 's/MOUNT/\//g' /srv/rutorrent/plugins/diskspace/action.php
elif [[ $primaryroot == "home" ]]; then
sed -i 's/MOUNT/\/home/g' /srv/rutorrent/plugins/diskspace/action.php
fi

#shellcheck source=sources/functions/rutorrent
. /etc/swizzin/sources/functions/rutorrent
rutorrent_fix_quota
fi
}

Expand Down
1 change: 1 addition & 0 deletions scripts/install/rtorrent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ if [[ -n $noexec ]]; then
fi
depends_rtorrent
if [[ ! $rtorrentver == repo ]]; then
configure_rtorrent
echo_progress_start "Building xmlrpc-c from source"
build_xmlrpc-c
echo_progress_done
Expand Down
26 changes: 12 additions & 14 deletions scripts/install/wireguard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,19 @@ function _selectiface() {
}

function _install_wg() {
if [[ $distribution == "Debian" ]]; then
if [[ ! $codename == "stretch" ]]; then

case ${codename} in
buster)
check_debian_backports
else
echo_info "Adding debian unstable repository and limiting packages"
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 10\n\nPackage: *\nPin: release a=stretch-backports\nPin-Priority: 250' > /etc/apt/preferences.d/limit-unstable
fi
elif [[ $codename == "bionic" ]]; then
#This *should* be enabled by default but you know what they say about assumptions.
check_ubuntu_updates
fi
PKGS+=(wireguard-dkms qrencode iptables)
;;
*)
PKGS=(wireguard qrencode iptables)
;;
esac

apt_update
apt_install --recommends wireguard qrencode iptables
apt_install --recommends ${PKGS[@]}

if [[ ! -d /etc/wireguard ]]; then
mkdir /etc/wireguard
Expand Down Expand Up @@ -164,8 +162,8 @@ EOWGC
. /etc/swizzin/sources/functions/utils
. /etc/swizzin/sources/functions/backports

distribution=$(lsb_release -is)
codename=$(lsb_release -cs)
distribution=$(_os_distro)
codename=$(_os_codename)
ip=$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')
if [[ -f /install/.wireguard.lock ]]; then
wgiface=$(cat /install/.wireguard.lock)
Expand Down
18 changes: 18 additions & 0 deletions scripts/nginx/jfago.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
#
# Create our nginx application conf for jfa-go
cat > /etc/nginx/apps/jfago.conf <<- NGINXCONF
location ^~ /jfa-go {
proxy_pass http://localhost:8056/jfa-go;
http2_push_preload on;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header X-Forwarded-Protocol \$scheme;
proxy_set_header X-Forwarded-Host \$http_host;
proxy_buffering off;
}
NGINXCONF
23 changes: 23 additions & 0 deletions scripts/remove/jfago.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

systemctl disable --now jfago -q

rm -rf /root/.config/jfa-go

apt_remove jfa-go

rm -f /usr/share/keyrings/jfa-go-archive-keyring.gpg
rm -f /etc/apt/sources.list.d/jfa-go.list

apt_update

rm -f /etc/systemd/system/jfago.service

systemctl daemon-reload -q

if [[ -f /install/.nginx.lock ]]; then
rm /etc/nginx/apps/jfago.conf
systemctl reload nginx
fi

rm /install/.jfago.lock
28 changes: 11 additions & 17 deletions scripts/rtx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ function _check_for_rutorrent() {
exit 1
fi
}

function _check_rutorrent_safe_dir() {
if ! $(git config --global --get safe.directory | grep -q '/srv/rutorrent'); then
git config --global --add safe.directory /srv/rutorrent
fi
}
. /etc/swizzin/sources/globals.sh
. /etc/swizzin/sources/functions/rutorrent
_check_for_rutorrent
_check_rutorrent_safe_dir

function _intro() {
whiptail --title "ruTorrent Extras Manager" --msgbox "Welcome to rtx! Using this script you can choose to install and remove the plugins and themes for ruTorrent. Use the arrow keys to navigate, spacebar to toggle the currently selected item and enter to continue." 15 50
Expand Down Expand Up @@ -86,7 +93,7 @@ function _themes() {
function _itplugs() {
arg=("$@")
result=("${arg[@]:1}")
tag=$(git -C /srv/rutorrent describe --tags | grep -oP 'v\d\.\d+(\-beta\.?\d?+)?(\.?\d+?)?([^-]?)')
tag=$(git -C /srv/rutorrent describe --tags --abbrev=0)
installa=()
plugs=(_getdir _noty _noty2 _task autotools check_port chunks cookies cpuload create data datadir diskspace edit erasedata extratio extsearch feeds filedrop filemanager filemanager-media filemanager-share geoip history httprpc ipad loginmgr lookat mediainfo mobile pausewebui ratio ratiocolor retrackers rpc rss rssurlrewrite rutracker_check scheduler screenshots seedingtime show_peers_like_wtorrent source spectrogram theme throttle tracklabels trafic unpack uploadeta xmpp)

Expand Down Expand Up @@ -166,12 +173,9 @@ function _itplugs() {
?>
FMCONF
;;
v4.0-beta.1)
git clone https://github.com/nelu/rutorrent-filemanager filemanager >> /dev/null 2>&1
git -C /srv/rutorrent/plugins/filemanager checkout 234f5f20841ad3d1e3c095e6c6954a875fc8a6ea >> /dev/null 2>&1
;;
*)
git clone https://github.com/nelu/rutorrent-filemanager filemanager >> /dev/null 2>&1
git -C /srv/rutorrent/plugins/filemanager checkout 234f5f20841ad3d1e3c095e6c6954a875fc8a6ea >> /dev/null 2>&1
;;
esac
;;
Expand All @@ -182,14 +186,9 @@ FMCONF
ln -s /srv/rutorrent/plugins/fileshare/share.php /srv/fancyindex/share.php > /dev/null 2>&1
sed -i 's/$downloadpath .*/$downloadpath = '"'https:\/\/'"'.$_SERVER['"'HTTP_HOST'"'] . '"'\/fancyindex\/share.php'"';/g' /srv/rutorrent/plugins/fileshare/conf.php
;;
v4.0-beta.1)
git clone https://github.com/nelu/rutorrent-filemanager-share.git filemanager-share > /dev/null 2>&1
git -C /srv/rutorrent/plugins/filemanager-share checkout 08abb838ec1e76d59051e3da5f3be69afeef31a1 > /dev/null 2>&1
ln -s /srv/rutorrent/plugins/filemanager-share/share.php /srv/fancyindex/share.php > /dev/null 2>&1
sed -i 's/$downloadpath .*/$downloadpath = '"'https:\/\/'"'.$_SERVER['"'HTTP_HOST'"'] . '"'\/fancyindex\/share.php'"';/g' /srv/rutorrent/plugins/filemanager-share/conf.php
;;
*)
git clone https://github.com/nelu/rutorrent-filemanager-share.git filemanager-share > /dev/null 2>&1
git -C /srv/rutorrent/plugins/filemanager-share checkout 08abb838ec1e76d59051e3da5f3be69afeef31a1 > /dev/null 2>&1
ln -s /srv/rutorrent/plugins/filemanager-share/share.php /srv/fancyindex/share.php > /dev/null 2>&1
sed -i 's/$downloadpath .*/$downloadpath = '"'https:\/\/'"'.$_SERVER['"'HTTP_HOST'"'] . '"'\/fancyindex\/share.php'"';/g' /srv/rutorrent/plugins/filemanager-share/conf.php
;;
Expand All @@ -198,14 +197,9 @@ FMCONF
;;
filemanager-media)
case $tag in
v4.0-beta.1)
git clone https://github.com/nelu/rutorrent-filemanager-media.git filemanager-media > /dev/null 2>&1
git -C /srv/rutorrent/plugins/filemanager-media checkout f1b92a1a9de1e81561877953a8599596510078d2 > /dev/null 2>&1
ln -s /srv/rutorrent/plugins/filemanager-media/stream.php /srv/fancyindex/stream.php > /dev/null 2>&1
sed -i 's/$streampath .*/$streampath = '"'https:\/\/'"'.$_SERVER['"'HTTP_HOST'"'] . '"'\/fancyindex\/stream.php'"';/g' /srv/rutorrent/plugins/filemanager-media/conf.php
;;
*)
git clone https://github.com/nelu/rutorrent-filemanager-media.git filemanager-media > /dev/null 2>&1
git -C /srv/rutorrent/plugins/filemanager-media checkout f1b92a1a9de1e81561877953a8599596510078d2 > /dev/null 2>&1
ln -s /srv/rutorrent/plugins/filemanager-media/stream.php /srv/fancyindex/stream.php > /dev/null 2>&1
sed -i 's/$streampath .*/$streampath = '"'https:\/\/'"'.$_SERVER['"'HTTP_HOST'"'] . '"'\/fancyindex\/stream.php'"';/g' /srv/rutorrent/plugins/filemanager-media/conf.php
;;
Expand Down
9 changes: 9 additions & 0 deletions scripts/tests/jfago.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

. /etc/swizzin/sources/functions/tests

check_service "jfago" || BAD=true
check_port "8056" || BAD=true
check_nginx "jfa-go" || BAD=true

evaluate_bad "jfago"
1 change: 1 addition & 0 deletions scripts/update/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function update_nginx() {
-e "s/;opcache.max_accelerated_files=2000/opcache.max_accelerated_files=4000/" \
-e "s/;opcache.revalidate_freq=2/opcache.revalidate_freq=240/" /etc/php/$version/fpm/php.ini
phpenmod -v $version opcache
sed -i 's/;env\[PATH\]/env[PATH]/g' /etc/php/$version/fpm/pool.d/www.conf
fi
done

Expand Down
Loading

0 comments on commit 249be71

Please sign in to comment.