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 Sep 7, 2023
2 parents 249be71 + 9dc0c50 commit ceaab81
Show file tree
Hide file tree
Showing 92 changed files with 1,875 additions and 372 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ body:
label: What OS are you using?
multiple: false
options:
- Debian 12 (Bookworm)
- Ubuntu 22.04 (Jammy)
- Debian 11 (Bullseye)
- Ubuntu 20.04 (Focal)
- Debian 10 (Buster)
- Ubuntu 18.04 (Xenial)
- Debian 9 (Stretch)
validations:
required: true
- type: dropdown
Expand Down
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ contact_links:
- name: "Troubleshooting Guide"
url: https://swizzin.ltd/docs/guides/troubleshooting
about: "Please make sure to follow these steps before submitting a bug."
- name: "Feature Requests"
url: https://feathub.com/liaralabs/swizzin
about: In case you'd like something new, search here or create a new suggestion.
- name: "GitHub Discussions"
url: https://github.com/liaralabs/swizzin/discussions
about: Please ask and answer non-bug-related questions here.
Expand Down
17 changes: 8 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

## Change Categories
<!-- DELETE WHICHEVER BULLET DOES NOT APPLY -->
- Bug fix <!-- non-breaking change which fixes an issue -->
- New feature <!-- non-breaking change which adds functionality -->
- Breaking change <!-- fix or feature that would cause existing functionality to not work as expected -->
- Bug fix <!-- non-breaking change which fixes an issue -->
- New feature <!-- non-breaking change which adds functionality -->
- Breaking change <!-- fix or feature that would cause existing functionality to not work as expected -->
- Change in `functions` <!-- e.g. `utils`, `os`, `apt`, `ask`, etc. -->
- Project structure <!-- major rewrites, large directory changes, etc. -->
- Contribution flow <!-- IDE changes, `.github` dir, etc. -->
- Project structure <!-- major rewrites, large directory changes, etc. -->
- Contribution flow <!-- IDE changes, `.github` dir, etc. -->

## Checklist
<!-- Please note that we also require you to check the CONTRIBUTORS.md file, this is just a short list-->
Expand All @@ -26,9 +26,7 @@
- PR link:
- [ ] Changes to panel have been made OR are not necessary
- PR link:
- [ ] Code is formatted [(See more)](https://github.com/swizzin/swizzin/blob/master/CONTRIBUTING.md#editor-plugins-and-tooling)
- [ ] Code conforms to project structure [(See more)](https://swizzin.ltd/dev/structure)
- [ ] Shellcheck isn't screaming [(See more)](https://github.com/swizzin/swizzin/blob/master/CONTRIBUTING.md#editor-plugins-and-tooling)
- [ ] Prints to terminal are handled [(See more)](https://github.com/swizzin/swizzin/blob/master/CONTRIBUTING.md#printing-into-the-terminal)
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] Testing was done
Expand All @@ -50,10 +48,9 @@ Please use these emojis here to fill the table below. It will nicely auto-format
|-------- |-------- |-------- |-------- |---------- |
| Jammy | | | | |
| Focal | | | | |
| Bionic | | | | |
| Bookworm | | | | |
| Bullseye | | | | |
| Buster | | | | |
| Stretch | | | | |
| Raspbian | ⚫️ | | ⚫️ | ⚫️ |

### ✅❎ Passed
Expand All @@ -62,6 +59,8 @@ Please use these emojis here to fill the table below. It will nicely auto-format

### ❌❌ Currently failing



<!-- EXAMPLES :
- Fresh app install without nginx
- With only one user
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/sh-checker.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/maxwinterstein/shfmt-py
rev: v3.4.3.1
hooks:
- id: shfmt
args: ["-w", "-ci", "-sr", "-i", "4"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
args: ["--severity=error"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 # Use the ref you want to point at
hooks:
- id: check-executables-have-shebangs
3 changes: 2 additions & 1 deletion .shellcheckrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
enable=add-default-case
enable=avoid-nullary-conditions
enable=avoid-deprecate-which
enable=avoid-quote-safe-variables
enable=avoid-quote-safe-variables
disable=SC2068 # Double quote array expansions to avoid re-splitting elements.
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Changelog

## [3.9.1]

## July 16, 2023

### Development:
- add pre-commit.ci integration

### Fixed:
- mango: stop offering to install mango on arm because it's unsupported
- updates: add echos to all update actions
- rtorrent: build shared libs for curl (should fix compile errors related to zlib)
- rtorrent: autoremove after repo clean (should fix segfaults related to xmlrpc-c)

## [3.9.0]

## June 26, 2023

### New:

- os: bookworm support
- os: use gcc-12 in Jammy

### Changed:

- deluge: compile flags are more optmized
- qbittorrent: use O3 compile flag

### Fixed:

- nzbhydra: broken variable
- mylar: urllib3 pip depends
- curl: use cmake
- curl: don't use curl to install curl
- rtorrent: udns can't use ipv6

## [3.8.0]

## May 4, 2023

### New:

- rtorrent: add UDNS install option
- rtorrent: compile a fancier, featureful version of curl

### Changed:

- rutorrent: enable localhostedmode (will load much faster now!)
- autodl: change some downloading logic
- rutorrent: install ffmpeg by default
- rutorrent: update config for v4.1.4

### Fixed:

- let's encrypt: respects ecc certs for hooks
- sabnzbd: python packaging logic for v4 (python3 < 3.8)
- bazarr: python packing logic improvements and remove EOL support (python3 < 3.8)
- rtorrent: limit piece preloading to torrents uploading at 50KB/s+ (no updater script for this. [It's a simple config change if you want this](https://github.com/swizzin/swizzin/commit/cd3519824a8b7dc631d2d709533024533c87aac8))
- nginx: remove duplicate packages from install params
- rutorrent: arm64 support for filemanager (reinstall the plugin if this is you)

## [3.7.1]

## April 15, 2023
Expand Down
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# TL;DR:

1. Familiarize yourself with the documentation and code available at [swizzin Dev Docs](https://swizzin.ltd/dev/).
1. Make sure your PRs are from and targeted to the `develop` branch.
1. PRs should meet specific criteria, including a completed checklist
- If your PR doesn't meet the criteria, mark it as "Draft PR" and optionally prepend the title with `WIP:`.
1. Follow the 4-space indentation style in bash code, use `shellcheck` to catch errors, and add helpful comments for reusable code.
- Use recommended VSCode extensions, and install required plugins/tools using `pre-commit install`.
1. Place new software installations in `/opt`, configurations in `~/.config/`, and logs in `/root/logs`.
1. Ensure scripts are compatible with unattended installations through environment variables.
1. Use the provided `apt` handling functions and override default behaviors using available options.
1. Use the functions exported from `sources/functions/color_echo` for terminal prints and logging.
1. Use service files for application management
1. Describe user management for your application when necessary.
1. Create documentation pages on the [Swizzin Docs](https://github.com/liaralabs/docs.swizzin.ltd) repo for new applications.

----
# Contributing guidelines
Here are a couple things to take into account when contributing to swizzin.

Expand All @@ -23,6 +40,9 @@ Please note that Extensions for VSCode should pop up as "recommended extensions"

### Required
Please make sure that you have the following plugins and tools installed and working correctly.

**NOTE**: You can install these with [`pre-commit install`](https://pre-commit.com/#install) and they will be applied before you make your commit

- `shellcheck` [VSCode Plugin](https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck) and [Binary](https://www.shellcheck.net/) (**version 0.7.1 or higher**)
- If you are not using VS Code with the plugin above, please make sure to catch **anything** that `shellcheck` does not like.
- Wherever you deem appropriate, add `#shellcheck disable=...` _inline_ to suppress the warnings.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

[![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.7.1 Stable
# 3.9.1 Stable

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

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!
Swizzin is a light, modular seedbox solution that can be installed on Debian 10/11/12 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!

Box has been revamped to reduce and consolidate the amount of commands you need to remember to manage your seedbox. More on this below. In addition to that, additional add-on packages can be installed during installation. No need to wait until the installer finishes! Now with unattended installs!

Expand Down Expand Up @@ -70,7 +70,7 @@ bash <(curl -sL git.io/swizzin) --env /path/to/your/env/file/here.env

Long-term support branches only:

- Debian 10/11
- Debian 10/11/12
- Ubuntu 20.04/22.04

## Support and Help
Expand Down
2 changes: 1 addition & 1 deletion scripts/box
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function _update() {

#Checking for EOL releases
case "$(_os_codename)" in
"focal" | "buster" | "bullseye" | "jammy")
"focal" | "buster" | "bullseye" | "jammy" | "bookworm")
echo_log_only "OS supported"
;;
*)
Expand Down
1 change: 1 addition & 0 deletions scripts/deluge.UpdateTracker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
# from https://github.com/s0undt3ch/Deluge/blob/master/deluge/ui/console/commands/update-tracker.py
# update-tracker.py
#
Expand Down
5 changes: 4 additions & 1 deletion scripts/install/autodl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ function _installautodl() {

function _autoconf() {
echo_progress_start "Downloading autodl source code"
curl -sL http://git.io/vlcND | grep -Po '(?<="browser_download_url":).*?[^\\].zip"' | sed 's/"//g' | xargs wget -O /tmp/autodl-irssi.zip --quiet
wget -q "$(curl -sL http://git.io/vlcND | jq .assets[0].browser_download_url -r)" -O /tmp/autodl-irssi.zip >> $log 2>&1 || {
echo_error "Autodl download failed, please check the log"
exit 1
}
echo_progress_done "Download finished"
for u in "${users[@]}"; do
echo_progress_start "Configuring autodl for $u"
Expand Down
30 changes: 18 additions & 12 deletions scripts/install/bazarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,26 @@ codename=$(lsb_release -cs)
_install() {

user=$(cut -d: -f1 < /root/.master.info)
if [[ $codename =~ ("bionic"|"stretch") ]]; then
#shellcheck source=sources/functions/pyenv
. /etc/swizzin/sources/functions/pyenv
pyenv_install
pyenv_install_version 3.7.7
pyenv_create_venv 3.7.7 /opt/.venv/bazarr
chown -R "${user}": /opt/.venv/bazarr
else
apt_install python3-pip python3-dev python3-venv
mkdir -p /opt/.venv/bazarr
python3 -m venv /opt/.venv/bazarr
chown -R "${user}": /opt/.venv/bazarr
. /etc/swizzin/sources/functions/pyenv
systempy3_ver=$(get_candidate_version python3)

if dpkg --compare-versions ${systempy3_ver} lt 3.8.0; then
PYENV=True
fi

case ${PYENV} in
True)
pyenv_install
pyenv_install_version 3.11.3
pyenv_create_venv 3.11.3 /opt/.venv/bazarr
chown -R ${user}: /opt/.venv/bazarr
;;
*)
apt_install python3-pip python3-dev python3-venv
python3_venv ${user} bazarr
;;
esac

if [[ $(_os_arch) =~ "arm" ]]; then
apt_install libxml2-dev libxslt1-dev python3-libxml2 python3-lxml unrar-free ffmpeg libatlas-base-dev
fi
Expand Down
9 changes: 2 additions & 7 deletions scripts/install/ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,5 @@
# including (via compiler) GPL-licensed code must also be made available
# under the GPL along with build & install instructions.

export distribution=$(lsb_release -is)
export release=$(lsb_release -rs)
export codename=$(lsb_release -cs)

apt_install ffmpeg

touch /install/.ffmpeg.lock
. /etc/swizzin/sources/functions/ffmpeg
ffmpeg_install
4 changes: 2 additions & 2 deletions scripts/install/jackett.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cd /home/$username
wget "https://github.com/Jackett/Jackett/releases/download/${version}/Jackett.Binaries.Linux${arch}.tar.gz" >> "$log" 2>&1
tar -xvzf Jackett.Binaries.*.tar.gz > /dev/null 2>&1
rm -f Jackett.Binaries.*.tar.gz
chown ${username}.${username} -R Jackett
chown ${username}:${username} -R Jackett
echo_progress_done

echo_progress_start "Installing systemd service"
Expand Down Expand Up @@ -106,7 +106,7 @@ cat > /home/${username}/.config/Jackett/ServerConfig.json << JSC
}
JSC

chown ${username}.${username} -R /home/${username}/.config
chown ${username}:${username} -R /home/${username}/.config

echo_progress_done "Jackett configured"

Expand Down
2 changes: 1 addition & 1 deletion scripts/install/jellyfin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ create_self_ssl "${username}"
#
# Generate our NET core ssl format cert from the default certs created using the ssl function and give it the required permissions.
openssl pkcs12 -export -nodes -out "/home/${username}/.ssl/${username}-self-signed.pfx" -inkey "/home/${username}/.ssl/${username}-self-signed.key" -in "/home/${username}/.ssl/${username}-self-signed.crt" -passout pass:
chown "${username}.${username}" -R "/home/${username}/.ssl"
chown "${username}:${username}" -R "/home/${username}/.ssl"
chmod -R g+r "/home/${username}/.ssl"
#
# Create the required directories for this application.
Expand Down
8 changes: 3 additions & 5 deletions scripts/install/mango.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ function _install_mango() {
mango_latest=$(github_latest_version getmango/Mango)

case "$(_os_arch)" in
"arm64")
dlurl="https://github.com/getmango/Mango/releases/download/${mango_latest}/mango-arm64v8.o"
;;
"arm32")
dlurl="https://github.com/getmango/Mango/releases/download/${mango_latest}/mango-arm32v7.o"
"arm32" | "arm64")
echo_error "Currently unsupported but might be in the future. Please check back later!\nhttps://github.com/hkalexling/Mango/issues/131"
exit 1
;;
"amd64")
dlurl="https://github.com/getmango/Mango/releases/download/${mango_latest}/mango"
Expand Down
8 changes: 2 additions & 6 deletions scripts/install/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ if [[ -n $(pidof apache2) ]]; then
fi

case $codename in
stretch)
mcrypt="php-mcrypt"
geoip="php-geoip"
;;
bionic | focal | buster | bullseye)
focal | buster | bullseye)
mcrypt=
geoip="php-geoip"
;;
Expand All @@ -51,7 +47,7 @@ case $codename in
;;
esac

APT="nginx libnginx-mod-http-fancyindex subversion ssl-cert php-fpm libfcgi0ldbl php-cli php-dev php-xml php-curl php-xmlrpc php-json php-mbstring php-opcache php-xml php-zip ${geoip} ${mcrypt}"
APT="nginx libnginx-mod-http-fancyindex subversion ssl-cert php-fpm libfcgi0ldbl php-cli php-dev php-xml php-curl php-xmlrpc php-json php-mbstring php-opcache php-zip ${geoip} ${mcrypt}"

apt_install $APT
mkdir -p /srv
Expand Down
Loading

0 comments on commit ceaab81

Please sign in to comment.