Prechádzať zdrojové kódy

Ubuntu 20 and MySql 8 support

Andrea Pollastri 5 rokov pred
rodič
commit
374db6b116

+ 20 - 0
storage/app/scripts/hostadd.sh

@@ -6,6 +6,8 @@ DBROOT=???
 BASE_PATH=
 USER_SHELL=/bin/bash
 
+VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
+
 while [ -n "$1" ] ; do
     case $1 in
     -u | --user )
@@ -128,6 +130,20 @@ sudo chown -R www-data: /home/$USER_NAME
 sudo systemctl restart nginx.service
 
 
+if [ "$VERSION" = "20.04" ]; then
+
+DBNAME=$USER_NAME
+DBUSER=$USER_NAME
+/usr/bin/mysql -u cipi -p$DBROOT <<EOF
+CREATE DATABASE IF NOT EXISTS $DBNAME;
+use mysql;
+CREATE USER $DBUSER@'%' IDENTIFIED BY '$DBPASS';
+GRANT ALL PRIVILEGES ON $DBNAME.* TO $DBUSER@'%' WITH GRANT OPTION;
+FLUSH PRIVILEGES;
+EOF
+
+else
+
 DBNAME=$USER_NAME
 DBUSER=$USER_NAME
 /usr/bin/mysql -u root -p$DBROOT <<EOF
@@ -137,6 +153,10 @@ GRANT USAGE ON *.* TO '$DBUSER'@'localhost' IDENTIFIED BY '$DBPASS' WITH MAX_QUE
 GRANT ALL PRIVILEGES ON $DBNAME.* TO $DBUSER@'localhost';
 EOF
 
+fi
+
+
+
 
 sudo mkdir /home/$USER_NAME/git/
 sudo cp /cipi/github /home/$USER_NAME/git/deploy

+ 6 - 0
storage/app/scripts/install.sh

@@ -423,6 +423,12 @@ sleep 3s
 sudo add-apt-repository -y ppa:certbot/certbot
 sudo apt-get -y install python-certbot-nginx
 
+if [ "$VERSION" = "20.04" ]; then
+sudo snap install --beta --classic certbot
+else
+
+fi
+
 echo "Let's Encrypt: OK!"
 sleep 3s