|
@ -74,7 +74,7 @@ class EEStackController(CementBaseController): |
|
|
"$(hostname -f)\" | debconf-set-selections") |
|
|
"$(hostname -f)\" | debconf-set-selections") |
|
|
if set(EEVariables.ee_mysql).issubset(set(apt_packages)): |
|
|
if set(EEVariables.ee_mysql).issubset(set(apt_packages)): |
|
|
print("Adding repository for mysql ... ") |
|
|
print("Adding repository for mysql ... ") |
|
|
EERepo.add(ppa=EEVariables.ee_mysql_repo) |
|
|
EERepo.add(repo_url=EEVariables.ee_mysql_repo) |
|
|
EERepo.add_key('1C4CBDCDCD2EFD2A') |
|
|
EERepo.add_key('1C4CBDCDCD2EFD2A') |
|
|
chars = ''.join(random.sample(string.ascii_letters, 8)) |
|
|
chars = ''.join(random.sample(string.ascii_letters, 8)) |
|
|
print("Pre-seeding mysql variables ... ") |
|
|
print("Pre-seeding mysql variables ... ") |
|
@ -86,6 +86,16 @@ class EEStackController(CementBaseController): |
|
|
"percona-server-server/root_password_again " |
|
|
"percona-server-server/root_password_again " |
|
|
"password {chars}\" | " |
|
|
"password {chars}\" | " |
|
|
"debconf-set-selections".format(chars=chars)) |
|
|
"debconf-set-selections".format(chars=chars)) |
|
|
|
|
|
mysql_config = """ |
|
|
|
|
|
[mysqld] |
|
|
|
|
|
user = root |
|
|
|
|
|
password = {chars} |
|
|
|
|
|
""".format(chars=chars) |
|
|
|
|
|
config = configparser.ConfigParser() |
|
|
|
|
|
config.read_string(mysql_config) |
|
|
|
|
|
with open(os.path.expanduser("~")+'/.my.cnf', 'w') as configfile: |
|
|
|
|
|
config.write(configfile) |
|
|
|
|
|
|
|
|
if set(EEVariables.ee_nginx).issubset(set(apt_packages)): |
|
|
if set(EEVariables.ee_nginx).issubset(set(apt_packages)): |
|
|
print("Adding repository for nginx ... ") |
|
|
print("Adding repository for nginx ... ") |
|
|
if EEVariables.ee_platform_distro == 'Debian': |
|
|
if EEVariables.ee_platform_distro == 'Debian': |
|
@ -182,6 +192,23 @@ class EEStackController(CementBaseController): |
|
|
with open('/etc/mysql/my.cnf', 'w') as configfile: |
|
|
with open('/etc/mysql/my.cnf', 'w') as configfile: |
|
|
config.write(configfile) |
|
|
config.write(configfile) |
|
|
|
|
|
|
|
|
|
|
|
if set(EEVariables.ee_dovecot).issubset(set(apt_packages)): |
|
|
|
|
|
EEShellExec.cmd_exec("adduser --uid 5000 --home /var/vmail" |
|
|
|
|
|
"--disabled-password --gecos '' vmail") |
|
|
|
|
|
EEShellExec.cmd_exec("openssl req -new -x509 -days 3650 -nodes" |
|
|
|
|
|
" -subj /commonName={HOSTNAME}/emailAddre" |
|
|
|
|
|
"ss={EMAIL} -out /etc/ssl/certs/dovecot." |
|
|
|
|
|
"pem -keyout /etc/ssl/private/dovecot.pem" |
|
|
|
|
|
.format(HOSTNAME=EEVariables.ee_fqdn, |
|
|
|
|
|
EMAIL=EEVariables.ee_email)) |
|
|
|
|
|
EEShellExec.cmd_exec("chmod 0600 /etc/ssl/private/dovecot.pem") |
|
|
|
|
|
|
|
|
|
|
|
# Custom Dovecot configuration by EasyEngine |
|
|
|
|
|
data = dict() |
|
|
|
|
|
ee_dovecot = open('/etc/dovecot/conf.d/99-ee.conf', 'w') |
|
|
|
|
|
self.app.render((data), 'dovecot.mustache', out=ee_dovecot) |
|
|
|
|
|
ee_dovecot.close() |
|
|
|
|
|
|
|
|
if len(packages): |
|
|
if len(packages): |
|
|
if any('/usr/bin/wp' == x[1] for x in packages): |
|
|
if any('/usr/bin/wp' == x[1] for x in packages): |
|
|
EEShellExec.cmd_exec("chmod +x /usr/bin/wp") |
|
|
EEShellExec.cmd_exec("chmod +x /usr/bin/wp") |
|
@ -314,7 +341,6 @@ class EEStackController(CementBaseController): |
|
|
|
|
|
|
|
|
self.pre_pref(apt_packages) |
|
|
self.pre_pref(apt_packages) |
|
|
if len(apt_packages): |
|
|
if len(apt_packages): |
|
|
pkg.update() |
|
|
|
|
|
pkg.install(apt_packages) |
|
|
pkg.install(apt_packages) |
|
|
if len(packages): |
|
|
if len(packages): |
|
|
EEDownload.download(packages) |
|
|
EEDownload.download(packages) |
|
|