fix(fleet): downgrade version from 13 to 12 in configuration files and scripts

fix(invidious): correct indentation in version retrieval
fix(fleet-install): switch from MariaDB to MySQL setup and update database creation logic
fix(tools): add MySQL repository handling in helper functions
This commit is contained in:
MickLesk
2026-05-18 14:27:58 +02:00
parent d73ac9566f
commit dd0b3c6538
5 changed files with 66 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"

View File

@@ -46,7 +46,7 @@ function update_script() {
msg_info "Rebuilding Invidious"
cd /opt/invidious
INVIDIOUS_VERSION="$(cat ~/.invidious 2>/dev/null || echo "unknown")"
INVIDIOUS_VERSION="$(cat ~/.invidious 2>/dev/null || echo "unknown")"
INVIDIOUS_VERSION="${INVIDIOUS_VERSION#v}"
sed -i \
-e "s~^\(\s*CURRENT_BRANCH\s*=\).*~\1 \"master\"~" \

View File

@@ -13,8 +13,15 @@ setting_up_container
network_check
update_os
setup_mariadb
MARIADB_DB_NAME="fleet" MARIADB_DB_USER="fleet" setup_mariadb_db
setup_mysql
msg_info "Setting up MySQL Database"
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS fleet CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -uroot -e "CREATE USER IF NOT EXISTS 'fleet'@'localhost' IDENTIFIED BY '${DB_PASS}';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON fleet.* TO 'fleet'@'localhost';"
mysql -uroot -e "FLUSH PRIVILEGES;"
msg_ok "Set up MySQL Database"
msg_info "Installing Dependencies"
$STD apt install -y redis-server
@@ -27,9 +34,9 @@ chmod +x /opt/fleet/fleet
PRIVATE_KEY=$(openssl rand -hex 32)
cat <<EOF >/opt/fleet/.env
FLEET_MYSQL_ADDRESS=127.0.0.1:3306
FLEET_MYSQL_DATABASE=${MARIADB_DB_NAME}
FLEET_MYSQL_USERNAME=${MARIADB_DB_USER}
FLEET_MYSQL_PASSWORD=${MARIADB_DB_PASS}
FLEET_MYSQL_DATABASE=fleet
FLEET_MYSQL_USERNAME=fleet
FLEET_MYSQL_PASSWORD=${DB_PASS}
FLEET_SERVER_ADDRESS=0.0.0.0:8080
FLEET_SERVER_TLS=false
FLEET_SERVER_PRIVATE_KEY=${PRIVATE_KEY}
@@ -47,8 +54,8 @@ msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/fleet.service
[Unit]
Description=Fleet
After=network.target mariadb.service redis-server.service
Requires=mariadb.service redis-server.service
After=network.target mysql.service redis-server.service
Requires=mysql.service redis-server.service
[Service]
Type=simple

View File

@@ -23,7 +23,7 @@
"ram": 2048,
"hdd": 8,
"os": "Debian",
"version": "13"
"version": "12"
}
}
],

View File

@@ -894,6 +894,55 @@ Suites: $distro_codename-pgdg
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/postgresql.gpg
EOF
return 0
;;
mysql)
if [[ -z "$repo_url" || -z "$gpg_key_url" ]]; then
msg_error "MySQL repository requires repo_url and gpg_key_url"
return 65
fi
cleanup_old_repo_files "mysql"
if ! download_gpg_key "$gpg_key_url" "/etc/apt/keyrings/mysql.gpg" "dearmor"; then
msg_error "Failed to import MySQL GPG key"
return 7
fi
chmod 644 "/etc/apt/keyrings/mysql.gpg"
local distro_codename
distro_codename=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release)
if [[ "$distro_id" == "debian" ]]; then
case "$distro_codename" in
bookworm | bullseye) suite="$distro_codename" ;;
*) suite="bookworm" ;;
esac
elif [[ "$distro_id" == "ubuntu" ]]; then
case "$distro_codename" in
noble | jammy) suite="$distro_codename" ;;
*) suite="noble" ;;
esac
else
suite=$(get_fallback_suite "$distro_id" "$distro_codename" "$repo_url")
fi
local component
if [[ "$version" == "8.4" ]]; then
component="mysql-8.4-lts"
else
component="mysql-${version}"
fi
cat >/etc/apt/sources.list.d/mysql.sources <<EOF
Types: deb
URIs: ${repo_url}/
Suites: ${suite}
Components: ${component}
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/mysql.gpg
EOF
return 0
;;