mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	2fauth: bump to debian 13 (#8123)
This commit is contained in:
		
							
								
								
									
										13
									
								
								ct/2fauth.sh
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								ct/2fauth.sh
									
									
									
									
									
								
							@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
 | 
				
			|||||||
var_ram="${var_ram:-512}"
 | 
					var_ram="${var_ram:-512}"
 | 
				
			||||||
var_disk="${var_disk:-2}"
 | 
					var_disk="${var_disk:-2}"
 | 
				
			||||||
var_os="${var_os:-debian}"
 | 
					var_os="${var_os:-debian}"
 | 
				
			||||||
var_version="${var_version:-12}"
 | 
					var_version="${var_version:-13}"
 | 
				
			||||||
var_unprivileged="${var_unprivileged:-1}"
 | 
					var_unprivileged="${var_unprivileged:-1}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
header_info "$APP"
 | 
					header_info "$APP"
 | 
				
			||||||
@@ -29,8 +29,8 @@ function update_script() {
 | 
				
			|||||||
    exit
 | 
					    exit
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
  if check_for_gh_release "2fauth" "Bubka/2FAuth"; then
 | 
					  if check_for_gh_release "2fauth" "Bubka/2FAuth"; then
 | 
				
			||||||
    $STD apt-get update
 | 
					    $STD apt update
 | 
				
			||||||
    $STD apt-get -y upgrade
 | 
					    $STD apt -y upgrade
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    msg_info "Creating Backup"
 | 
					    msg_info "Creating Backup"
 | 
				
			||||||
    mv "/opt/2fauth" "/opt/2fauth-backup"
 | 
					    mv "/opt/2fauth" "/opt/2fauth-backup"
 | 
				
			||||||
@@ -60,10 +60,11 @@ function update_script() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    msg_info "Cleaning Up"
 | 
					    msg_info "Cleaning Up"
 | 
				
			||||||
    if dpkg -l | grep -q 'php8.2'; then
 | 
					    if dpkg -l | grep -q 'php8.2'; then
 | 
				
			||||||
      $STD apt-get remove --purge -y php8.2*
 | 
					      $STD apt remove --purge -y php8.2*
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    $STD apt-get -y autoremove
 | 
					    $STD apt -y autoremove
 | 
				
			||||||
    $STD apt-get -y autoclean
 | 
					    $STD apt -y autoclean
 | 
				
			||||||
 | 
					    $STD apt -y clean
 | 
				
			||||||
    msg_ok "Cleanup Completed"
 | 
					    msg_ok "Cleanup Completed"
 | 
				
			||||||
    msg_ok "Updated Successfully"
 | 
					    msg_ok "Updated Successfully"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@
 | 
				
			|||||||
        "ram": 512,
 | 
					        "ram": 512,
 | 
				
			||||||
        "hdd": 2,
 | 
					        "hdd": 2,
 | 
				
			||||||
        "os": "debian",
 | 
					        "os": "debian",
 | 
				
			||||||
        "version": "12"
 | 
					        "version": "13"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,9 +14,9 @@ network_check
 | 
				
			|||||||
update_os
 | 
					update_os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Installing Dependencies"
 | 
					msg_info "Installing Dependencies"
 | 
				
			||||||
$STD apt-get install -y \
 | 
					$STD apt install -y \
 | 
				
			||||||
  lsb-release \
 | 
					        lsb-release \
 | 
				
			||||||
  nginx
 | 
					        nginx
 | 
				
			||||||
msg_ok "Installed Dependencies"
 | 
					msg_ok "Installed Dependencies"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli" PHP_FPM="YES" setup_php
 | 
					PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli" PHP_FPM="YES" setup_php
 | 
				
			||||||
@@ -31,26 +31,26 @@ $STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
 | 
				
			|||||||
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
 | 
					$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
 | 
				
			||||||
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
 | 
					$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  echo "2FAuth Credentials"
 | 
					        echo "2FAuth Credentials"
 | 
				
			||||||
  echo "Database User: $DB_USER"
 | 
					        echo "Database User: $DB_USER"
 | 
				
			||||||
  echo "Database Password: $DB_PASS"
 | 
					        echo "Database Password: $DB_PASS"
 | 
				
			||||||
  echo "Database Name: $DB_NAME"
 | 
					        echo "Database Name: $DB_NAME"
 | 
				
			||||||
} >>~/2FAuth.creds
 | 
					} >>~/2FAuth.creds
 | 
				
			||||||
msg_ok "Set up Database"
 | 
					msg_ok "Set up Database"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
 | 
					fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Setup 2FAuth"
 | 
					msg_info "Setup 2FAuth"
 | 
				
			||||||
cd /opt/2fauth
 | 
					cd /opt/2fauth || exit
 | 
				
			||||||
cp .env.example .env
 | 
					cp .env.example .env
 | 
				
			||||||
IPADDRESS=$(hostname -I | awk '{print $1}')
 | 
					IPADDRESS=$(hostname -I | awk '{print $1}')
 | 
				
			||||||
sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
 | 
					sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
 | 
				
			||||||
  -e "s|^DB_CONNECTION=$|DB_CONNECTION=mysql|" \
 | 
					        -e "s|^DB_CONNECTION=$|DB_CONNECTION=mysql|" \
 | 
				
			||||||
  -e "s|^DB_DATABASE=$|DB_DATABASE=$DB_NAME|" \
 | 
					        -e "s|^DB_DATABASE=$|DB_DATABASE=$DB_NAME|" \
 | 
				
			||||||
  -e "s|^DB_HOST=$|DB_HOST=127.0.0.1|" \
 | 
					        -e "s|^DB_HOST=$|DB_HOST=127.0.0.1|" \
 | 
				
			||||||
  -e "s|^DB_PORT=$|DB_PORT=3306|" \
 | 
					        -e "s|^DB_PORT=$|DB_PORT=3306|" \
 | 
				
			||||||
  -e "s|^DB_USERNAME=$|DB_USERNAME=$DB_USER|" \
 | 
					        -e "s|^DB_USERNAME=$|DB_USERNAME=$DB_USER|" \
 | 
				
			||||||
  -e "s|^DB_PASSWORD=$|DB_PASSWORD=$DB_PASS|" .env
 | 
					        -e "s|^DB_PASSWORD=$|DB_PASSWORD=$DB_PASS|" .env
 | 
				
			||||||
export COMPOSER_ALLOW_SUPERUSER=1
 | 
					export COMPOSER_ALLOW_SUPERUSER=1
 | 
				
			||||||
$STD composer update --no-plugins --no-scripts
 | 
					$STD composer update --no-plugins --no-scripts
 | 
				
			||||||
$STD composer install --no-dev --prefer-source --no-plugins --no-scripts
 | 
					$STD composer install --no-dev --prefer-source --no-plugins --no-scripts
 | 
				
			||||||
@@ -99,6 +99,7 @@ motd_ssh
 | 
				
			|||||||
customize
 | 
					customize
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Cleaning up"
 | 
					msg_info "Cleaning up"
 | 
				
			||||||
$STD apt-get -y autoremove
 | 
					$STD apt -y autoremove
 | 
				
			||||||
$STD apt-get -y autoclean
 | 
					$STD apt -y autoclean
 | 
				
			||||||
 | 
					$STD apt -y clean
 | 
				
			||||||
msg_ok "Cleaned"
 | 
					msg_ok "Cleaned"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user