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 [ -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 ! {
|
||||
apt-get update --allow-releaseinfo-change -qq >/dev/null 2>&1
|
||||
}; then
|
||||
|
||||
@@ -130,7 +130,6 @@ class WOStackController(CementBaseController):
|
||||
if pargs.all:
|
||||
pargs.web = True
|
||||
pargs.admin = True
|
||||
pargs.php73 = True
|
||||
pargs.php74 = True
|
||||
pargs.php80 = True
|
||||
pargs.php81 = True
|
||||
|
||||
@@ -32,7 +32,7 @@ def pre_pref(self, apt_packages):
|
||||
if not (WOVar.wo_distro == 'raspbian'):
|
||||
Log.info(self, "Adding repository for MySQL, please wait...")
|
||||
mysql_pref = (
|
||||
"Package: *\nPin: origin mariadb.mirrors.ovh.net"
|
||||
"Package: *\nPin: origin deb.mariadb.org"
|
||||
"\nPin-Priority: 1000\n")
|
||||
with open('/etc/apt/preferences.d/'
|
||||
'MariaDB.pref', 'w') as mysql_pref_file:
|
||||
@@ -41,7 +41,7 @@ def pre_pref(self, apt_packages):
|
||||
mariadb_ver = self.app.config.get(
|
||||
'mariadb', 'release')
|
||||
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")
|
||||
else:
|
||||
wo_mysql_repo_conf = WOVar.wo_mysql_repo
|
||||
|
||||
@@ -30,14 +30,14 @@ class WORepo():
|
||||
try:
|
||||
if not os.path.isfile(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('\n')
|
||||
repofile.close()
|
||||
elif repo_url not in open(repo_file_path,
|
||||
encoding='utf-8').read():
|
||||
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('\n')
|
||||
repofile.close()
|
||||
|
||||
@@ -169,7 +169,6 @@ class WOMysql():
|
||||
elif os.path.exists('/usr/bin/mysqladmin'):
|
||||
mariadb_admin = "/usr/bin/mysqladmin"
|
||||
else:
|
||||
Log.info(self, "MariaDB server isn't installed")
|
||||
return False
|
||||
if WOShellExec.cmd_exec(self, f"{mariadb_admin} ping"):
|
||||
return True
|
||||
|
||||
@@ -188,7 +188,7 @@ class WOVar():
|
||||
|
||||
# APT repositories
|
||||
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")
|
||||
mariadb_repo_key = "https://mariadb.org/mariadb_release_signing_key.pgp"
|
||||
if wo_distro == 'ubuntu':
|
||||
|
||||
Reference in New Issue
Block a user