Skip to content

Commit 3e1753b

Browse files
authored
2fauth: bump to debian 13 (#8123)
1 parent 6863c77 commit 3e1753b

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

ct/2fauth.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
1111
var_ram="${var_ram:-512}"
1212
var_disk="${var_disk:-2}"
1313
var_os="${var_os:-debian}"
14-
var_version="${var_version:-12}"
14+
var_version="${var_version:-13}"
1515
var_unprivileged="${var_unprivileged:-1}"
1616

1717
header_info "$APP"
@@ -29,8 +29,8 @@ function update_script() {
2929
exit
3030
fi
3131
if check_for_gh_release "2fauth" "Bubka/2FAuth"; then
32-
$STD apt-get update
33-
$STD apt-get -y upgrade
32+
$STD apt update
33+
$STD apt -y upgrade
3434

3535
msg_info "Creating Backup"
3636
mv "/opt/2fauth" "/opt/2fauth-backup"
@@ -60,10 +60,11 @@ function update_script() {
6060

6161
msg_info "Cleaning Up"
6262
if dpkg -l | grep -q 'php8.2'; then
63-
$STD apt-get remove --purge -y php8.2*
63+
$STD apt remove --purge -y php8.2*
6464
fi
65-
$STD apt-get -y autoremove
66-
$STD apt-get -y autoclean
65+
$STD apt -y autoremove
66+
$STD apt -y autoclean
67+
$STD apt -y clean
6768
msg_ok "Cleanup Completed"
6869
msg_ok "Updated Successfully"
6970
fi

frontend/public/json/2fauth.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"ram": 512,
2424
"hdd": 2,
2525
"os": "debian",
26-
"version": "12"
26+
"version": "13"
2727
}
2828
}
2929
],

install/2fauth-install.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Dependencies"
17-
$STD apt-get install -y \
18-
lsb-release \
19-
nginx
17+
$STD apt install -y \
18+
lsb-release \
19+
nginx
2020
msg_ok "Installed Dependencies"
2121

2222
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;"
3131
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
3232
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
3333
{
34-
echo "2FAuth Credentials"
35-
echo "Database User: $DB_USER"
36-
echo "Database Password: $DB_PASS"
37-
echo "Database Name: $DB_NAME"
34+
echo "2FAuth Credentials"
35+
echo "Database User: $DB_USER"
36+
echo "Database Password: $DB_PASS"
37+
echo "Database Name: $DB_NAME"
3838
} >>~/2FAuth.creds
3939
msg_ok "Set up Database"
4040

4141
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
4242

4343
msg_info "Setup 2FAuth"
44-
cd /opt/2fauth
44+
cd /opt/2fauth || exit
4545
cp .env.example .env
4646
IPADDRESS=$(hostname -I | awk '{print $1}')
4747
sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
48-
-e "s|^DB_CONNECTION=$|DB_CONNECTION=mysql|" \
49-
-e "s|^DB_DATABASE=$|DB_DATABASE=$DB_NAME|" \
50-
-e "s|^DB_HOST=$|DB_HOST=127.0.0.1|" \
51-
-e "s|^DB_PORT=$|DB_PORT=3306|" \
52-
-e "s|^DB_USERNAME=$|DB_USERNAME=$DB_USER|" \
53-
-e "s|^DB_PASSWORD=$|DB_PASSWORD=$DB_PASS|" .env
48+
-e "s|^DB_CONNECTION=$|DB_CONNECTION=mysql|" \
49+
-e "s|^DB_DATABASE=$|DB_DATABASE=$DB_NAME|" \
50+
-e "s|^DB_HOST=$|DB_HOST=127.0.0.1|" \
51+
-e "s|^DB_PORT=$|DB_PORT=3306|" \
52+
-e "s|^DB_USERNAME=$|DB_USERNAME=$DB_USER|" \
53+
-e "s|^DB_PASSWORD=$|DB_PASSWORD=$DB_PASS|" .env
5454
export COMPOSER_ALLOW_SUPERUSER=1
5555
$STD composer update --no-plugins --no-scripts
5656
$STD composer install --no-dev --prefer-source --no-plugins --no-scripts
@@ -99,6 +99,7 @@ motd_ssh
9999
customize
100100

101101
msg_info "Cleaning up"
102-
$STD apt-get -y autoremove
103-
$STD apt-get -y autoclean
102+
$STD apt -y autoremove
103+
$STD apt -y autoclean
104+
$STD apt -y clean
104105
msg_ok "Cleaned"

0 commit comments

Comments
 (0)