diff --git a/.gitea/workflows/ci-main.yml b/.gitea/workflows/ci-main-ubuntu.yml similarity index 89% rename from .gitea/workflows/ci-main.yml rename to .gitea/workflows/ci-main-ubuntu.yml index 6745be9..98956fd 100644 --- a/.gitea/workflows/ci-main.yml +++ b/.gitea/workflows/ci-main-ubuntu.yml @@ -1,5 +1,5 @@ # -name: Deployment Verification +name: Deployment Verification Ubuntu on: push: diff --git a/modules/package_management.sh b/modules/package_management.sh index 6ca3c11..d461c6f 100644 --- a/modules/package_management.sh +++ b/modules/package_management.sh @@ -29,14 +29,35 @@ Acquire::http::Proxy "http://username:password@proxy.example.com:8080/"; Acquire::https::Proxy "http://username:password@proxy.example.com:8080/"; # For APT to use the system's proxy settings -Acquire::http::Proxy "http://$HTTP_PROXY"; -Acquire::https::Proxy "http://$HTTPS_PROXY"; -Acquire::ftp::proxy "http://$FTP_PROXY"; +Acquire::http::Proxy "http://${HTTP_PROXY}"; +Acquire::https::Proxy "http://${HTTPS_PROXY}"; +Acquire::ftp::proxy "ftp://${FTP_PROXY}"; # To disable proxy for specific hosts Acquire::http::Proxy::hostname.example.com "DIRECT"; EOF + apt-get update + + if [ $? -eq 0 ]; then + log_message "SUCCESS" "Package lists updated successfully" + else + cat > "$PROXY_FILE" << EOF +Acquire::http::Proxy "http://$HTTP_PROXY"; +Acquire::https::Proxy "http://$HTTPS_PROXY"; +Acquire::ftp::proxy "ftp://$FTP_PROXY"; +EOF + apt-get update + + if [ $? -eq 0 ]; then + log_message "SUCCESS" "Package lists updated successfully with proxy" + else + log_message "ERROR" "Failed to update package lists with proxy" + fi + + return 1 + fi + log_message "SUCCESS" "APT proxy documentation created. Edit $PROXY_FILE to configure proxies if needed" } @@ -49,6 +70,7 @@ update_upgrade_packages() { log_message "SUCCESS" "Package lists updated successfully" else log_message "ERROR" "Failed to update package lists" + return 1 fi @@ -59,6 +81,7 @@ update_upgrade_packages() { log_message "SUCCESS" "Packages upgraded successfully" else log_message "ERROR" "Failed to upgrade packages" + return 1 fi } @@ -72,8 +95,6 @@ install_essential_packages() { "software-properties-common" "curl" "wget" -# "ufw" -# "unattended-upgrades" "apt-listchanges" )