Merge pull request #673 from WordOps/updating-configuration
Use MariaDB dynamic mirror
This commit is contained in:
3
install
3
install
@@ -811,9 +811,6 @@ wo_init() {
|
|||||||
###
|
###
|
||||||
|
|
||||||
if [ -z "$wo_travis" ]; then
|
if [ -z "$wo_travis" ]; then
|
||||||
if [ -f /etc/apt/preferences.d/MariaDB.pref ]; then
|
|
||||||
sed -i 's/sfo1.mirrors.digitalocean.com/mariadb.mirrors.ovh.net/' /etc/apt/preferences.d/MariaDB.pref >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
if ! {
|
if ! {
|
||||||
apt-get update --allow-releaseinfo-change -qq >/dev/null 2>&1
|
apt-get update --allow-releaseinfo-change -qq >/dev/null 2>&1
|
||||||
}; then
|
}; then
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ class WOStackController(CementBaseController):
|
|||||||
if pargs.all:
|
if pargs.all:
|
||||||
pargs.web = True
|
pargs.web = True
|
||||||
pargs.admin = True
|
pargs.admin = True
|
||||||
pargs.php73 = True
|
|
||||||
pargs.php74 = True
|
pargs.php74 = True
|
||||||
pargs.php80 = True
|
pargs.php80 = True
|
||||||
pargs.php81 = True
|
pargs.php81 = True
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ def pre_pref(self, apt_packages):
|
|||||||
if not (WOVar.wo_distro == 'raspbian'):
|
if not (WOVar.wo_distro == 'raspbian'):
|
||||||
Log.info(self, "Adding repository for MySQL, please wait...")
|
Log.info(self, "Adding repository for MySQL, please wait...")
|
||||||
mysql_pref = (
|
mysql_pref = (
|
||||||
"Package: *\nPin: origin mariadb.mirrors.ovh.net"
|
"Package: *\nPin: origin deb.mariadb.org"
|
||||||
"\nPin-Priority: 1000\n")
|
"\nPin-Priority: 1000\n")
|
||||||
with open('/etc/apt/preferences.d/'
|
with open('/etc/apt/preferences.d/'
|
||||||
'MariaDB.pref', 'w') as mysql_pref_file:
|
'MariaDB.pref', 'w') as mysql_pref_file:
|
||||||
@@ -41,7 +41,7 @@ def pre_pref(self, apt_packages):
|
|||||||
mariadb_ver = self.app.config.get(
|
mariadb_ver = self.app.config.get(
|
||||||
'mariadb', 'release')
|
'mariadb', 'release')
|
||||||
wo_mysql_repo_conf = ("deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] "
|
wo_mysql_repo_conf = ("deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] "
|
||||||
"http://mariadb.mirrors.ovh.net/MariaDB/repo/"
|
"https://deb.mariadb.org/"
|
||||||
f"{mariadb_ver}/{WOVar.wo_distro} {WOVar.wo_platform_codename} main")
|
f"{mariadb_ver}/{WOVar.wo_distro} {WOVar.wo_platform_codename} main")
|
||||||
else:
|
else:
|
||||||
wo_mysql_repo_conf = WOVar.wo_mysql_repo
|
wo_mysql_repo_conf = WOVar.wo_mysql_repo
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ class WORepo():
|
|||||||
try:
|
try:
|
||||||
if not os.path.isfile(repo_file_path):
|
if not os.path.isfile(repo_file_path):
|
||||||
with open(repo_file_path,
|
with open(repo_file_path,
|
||||||
encoding='utf-8', mode='a') as repofile:
|
encoding='utf-8', mode='w') as repofile:
|
||||||
repofile.write(repo_url)
|
repofile.write(repo_url)
|
||||||
repofile.write('\n')
|
repofile.write('\n')
|
||||||
repofile.close()
|
repofile.close()
|
||||||
elif repo_url not in open(repo_file_path,
|
elif repo_url not in open(repo_file_path,
|
||||||
encoding='utf-8').read():
|
encoding='utf-8').read():
|
||||||
with open(repo_file_path,
|
with open(repo_file_path,
|
||||||
encoding='utf-8', mode='a') as repofile:
|
encoding='utf-8', mode='w') as repofile:
|
||||||
repofile.write(repo_url)
|
repofile.write(repo_url)
|
||||||
repofile.write('\n')
|
repofile.write('\n')
|
||||||
repofile.close()
|
repofile.close()
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ class WOMysql():
|
|||||||
elif os.path.exists('/usr/bin/mysqladmin'):
|
elif os.path.exists('/usr/bin/mysqladmin'):
|
||||||
mariadb_admin = "/usr/bin/mysqladmin"
|
mariadb_admin = "/usr/bin/mysqladmin"
|
||||||
else:
|
else:
|
||||||
Log.info(self, "MariaDB server isn't installed")
|
|
||||||
return False
|
return False
|
||||||
if WOShellExec.cmd_exec(self, f"{mariadb_admin} ping"):
|
if WOShellExec.cmd_exec(self, f"{mariadb_admin} ping"):
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class WOVar():
|
|||||||
|
|
||||||
# APT repositories
|
# APT repositories
|
||||||
wo_mysql_repo = ("deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] "
|
wo_mysql_repo = ("deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] "
|
||||||
"http://mariadb.mirrors.ovh.net/MariaDB/repo/"
|
"https://deb.mariadb.org/"
|
||||||
f"{mariadb_ver}/{wo_distro} {wo_platform_codename} main")
|
f"{mariadb_ver}/{wo_distro} {wo_platform_codename} main")
|
||||||
mariadb_repo_key = "https://mariadb.org/mariadb_release_signing_key.pgp"
|
mariadb_repo_key = "https://mariadb.org/mariadb_release_signing_key.pgp"
|
||||||
if wo_distro == 'ubuntu':
|
if wo_distro == 'ubuntu':
|
||||||
|
|||||||
Reference in New Issue
Block a user