mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-07-09 23:47:38 +00:00
MariaDB CLI Update, Go Install Helper & Minor Cleanup (#4793)
* . * switch mysql to mariadb * fix some basenames * remove basename to correct filename * merge firefly from main
This commit is contained in:
@ -27,9 +27,9 @@ msg_info "Setting up MariaDB"
|
||||
DB_NAME=phpipam
|
||||
DB_USER=phpipam
|
||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "phpIPAM-Credentials"
|
||||
echo "phpIPAM Database User: $DB_USER"
|
||||
@ -41,9 +41,9 @@ msg_ok "Set up MariaDB"
|
||||
msg_info "Installing phpIPAM"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/phpipam/phpipam/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
cd /opt
|
||||
curl -fsSL "https://github.com/phpipam/phpipam/releases/download/v${RELEASE}/phpipam-v${RELEASE}.zip" -o $(basename "https://github.com/phpipam/phpipam/releases/download/v${RELEASE}/phpipam-v${RELEASE}.zip")
|
||||
curl -fsSL "https://github.com/phpipam/phpipam/releases/download/v${RELEASE}/phpipam-v${RELEASE}.zip" -o "phpipam-v${RELEASE}.zip"
|
||||
$STD unzip "phpipam-v${RELEASE}.zip"
|
||||
mysql -u root "${DB_NAME}" </opt/phpipam/db/SCHEMA.sql
|
||||
mariadb -u root "${DB_NAME}" </opt/phpipam/db/SCHEMA.sql
|
||||
cp /opt/phpipam/config.dist.php /opt/phpipam/config.php
|
||||
sed -i -e "s/\(\$disable_installer = \).*/\1true;/" \
|
||||
-e "s/\(\$db\['user'\] = \).*/\1'$DB_USER';/" \
|
||||
|
Reference in New Issue
Block a user