Skip to content

Commit fc500f5

Browse files
author
gau1991
committed
Merge branch 'feature/susebuilderrepo' into develop
2 parents c995e8c + 6760f29 commit fc500f5

File tree

12 files changed

+121
-168
lines changed

12 files changed

+121
-168
lines changed

config/bash_completion.d/ee_auto.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _ee_complete()
1111
# SETUP THE BASE LEVEL (everything after "ee")
1212
if [ $COMP_CWORD -eq 1 ]; then
1313
COMPREPLY=( $(compgen \
14-
-W "stack site debug clean secure import-slow-log log update sync" \
14+
-W "stack site debug clean secure import-slow-log log update sync info" \
1515
-- $cur) )
1616

1717

ee/cli/plugins/debug.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ def debug_nginx(self):
8484
.split())
8585
except Exception as e:
8686
debug_address = ['0.0.0.0/0']
87+
88+
# Check if IP address is 127.0.0.1 then enable debug globally
89+
if debug_address == ['127.0.0.1'] or debug_address == []:
90+
debug_address = ['0.0.0.0/0']
91+
8792
for ip_addr in debug_address:
8893
if not ("debug_connection "+ip_addr in open('/etc/nginx/'
8994
'nginx.conf', encoding='utf-8').read()):
@@ -226,7 +231,7 @@ def debug_php(self):
226231
def debug_fpm(self):
227232
"""Start/Stop PHP5-FPM debug"""
228233
# PHP5-FPM start global debug
229-
if (self.app.pargs.php == 'on'and not self.app.pargs.site_name):
234+
if (self.app.pargs.fpm == 'on' and not self.app.pargs.site_name):
230235
if not EEShellExec.cmd_exec(self, "grep \"log_level = debug\" "
231236
"/etc/php5/fpm/php-fpm.conf"):
232237
Log.info(self, "Setting up PHP5-FPM log_level = debug")
@@ -247,7 +252,7 @@ def debug_fpm(self):
247252
self.msg = self.msg + ['/var/log/php5/fpm.log']
248253

249254
# PHP5-FPM stop global debug
250-
elif (self.app.pargs.php == 'on' and not self.app.pargs.site_name):
255+
elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name):
251256
if EEShellExec.cmd_exec(self, "grep \"log_level = debug\" "
252257
"/etc/php5/fpm/php-fpm.conf"):
253258
Log.info(self, "Disabling PHP5-FPM log_level = debug")

ee/cli/plugins/info.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,10 @@ def info_nginx(self):
4848
worker_processes = nc.get('worker_processes')[1]
4949
worker_connections = nc.get([('events',), 'worker_connections'])[1]
5050
keepalive_timeout = nc.get([('http',), 'keepalive_timeout'])[1]
51-
if os.path.isfile('/etc/nginx/conf.d/ee-nginx.conf'):
52-
nc.loadf('/etc/nginx/conf.d/ee-nginx.conf')
53-
fastcgi_read_timeout = nc.get('fastcgi_read_timeout')[1]
54-
client_max_body_size = nc.get('client_max_body_size')[1]
55-
else:
56-
fastcgi_read_timeout = nc.get([('http',),
57-
'fastcgi_read_timeout'])[1]
58-
client_max_body_size = nc.get([('http',),
59-
'client_max_body_size'])[1]
51+
fastcgi_read_timeout = nc.get([('http',),
52+
'fastcgi_read_timeout'])[1]
53+
client_max_body_size = nc.get([('http',),
54+
'client_max_body_size'])[1]
6055
data = dict(version=version, allow=allow, user=user,
6156
worker_processes=worker_processes,
6257
keepalive_timeout=keepalive_timeout,

ee/cli/plugins/site_functions.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,7 @@ def site_package_check(self, stype):
560560
'wpsubdomain']:
561561
Log.debug(self, "Setting apt_packages variable for Nginx")
562562

563-
if EEVariables.ee_platform_distro == 'debian':
564-
check_nginx = 'nginx-extras'
565-
else:
566-
check_nginx = 'nginx-custom'
567-
568-
if not EEAptGet.is_installed(self, check_nginx):
563+
if not EEAptGet.is_installed(self, 'nginx-custom'):
569564
apt_packages = apt_packages + EEVariables.ee_nginx
570565
else:
571566
# Fix for Nginx white screen death

ee/cli/plugins/stack.py

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,9 @@ def pre_pref(self, apt_packages):
153153

154154
if set(EEVariables.ee_nginx).issubset(set(apt_packages)):
155155
Log.info(self, "Adding repository for NGINX, please wait...")
156-
if EEVariables.ee_platform_distro == 'debian':
157-
Log.debug(self, 'Adding Dotdeb/nginx GPG key')
158-
EERepo.add(self, repo_url=EEVariables.ee_nginx_repo)
159-
else:
160-
EERepo.add(self, ppa=EEVariables.ee_nginx_repo)
161-
Log.debug(self, 'Adding ppa of Nginx')
156+
EERepo.add(self, repo_url=EEVariables.ee_nginx_repo)
157+
Log.debug(self, 'Adding ppa of Nginx')
158+
EERepo.add_key(self, EEVariables.ee_nginx_key)
162159

163160
if set(EEVariables.ee_php).issubset(set(apt_packages)):
164161
Log.info(self, "Adding repository for PHP, please wait...")
@@ -205,37 +202,16 @@ def post_pref(self, apt_packages, packages):
205202
EEService.reload_service(self, 'postfix')
206203

207204
if set(EEVariables.ee_nginx).issubset(set(apt_packages)):
208-
if ((not EEShellExec.cmd_exec(self, "grep -q -Hr EasyEngine "
209-
"/etc/nginx")) and os.path.isfile('/etc/nginx/nginx.conf')):
210-
nc = NginxConfig()
211-
Log.debug(self, 'Loading file /etc/nginx/nginx.conf ')
212-
nc.loadf('/etc/nginx/nginx.conf')
213-
nc.set('worker_processes', 'auto')
214-
nc.append(('worker_rlimit_nofile', '100000'), position=2)
215-
nc.remove(('events', ''))
216-
nc.append({'name': 'events', 'param': '', 'value':
217-
[('worker_connections', '4096'),
218-
('multi_accept', 'on')]}, position=4)
219-
nc.set([('http',), 'keepalive_timeout'], '30')
220-
Log.debug(self, "Writting nginx configuration to "
221-
"file /etc/nginx/nginx.conf ")
222-
nc.savef('/etc/nginx/nginx.conf')
223-
224-
# Custom Nginx configuration by EasyEngine
225-
if EEVariables.ee_platform_distro == 'ubuntu':
226-
data = dict(version=EEVariables.ee_version,
227-
Ubuntu=True)
228-
else:
229-
data = dict(version=EEVariables.ee_version,
230-
Debian=True)
231-
Log.debug(self, 'Writting the nginx configuration to '
232-
'file /etc/nginx/conf.d/ee-nginx.conf ')
233-
ee_nginx = open('/etc/nginx/conf.d/ee-nginx.conf',
234-
encoding='utf-8', mode='w')
235-
self.app.render((data), 'nginx-core.mustache',
236-
out=ee_nginx)
237-
ee_nginx.close()
238-
205+
if not (os.path.isfile('/etc/nginx/common/wpfc.conf')):
206+
# Change EasyEngine Version in nginx.conf file
207+
EEFileUtils.searchreplace(self, "/etc/nginx/nginx.conf",
208+
"# add_header",
209+
"add_header")
210+
211+
EEFileUtils.searchreplace(self, "/etc/nginx/nginx.conf",
212+
"\"EasyEngine\"",
213+
"\"EasyEngine {0}\""
214+
.format(EEVariables.ee_version))
239215
data = dict()
240216
Log.debug(self, 'Writting the nginx configuration to '
241217
'file /etc/nginx/conf.d/blockips.conf')
@@ -1475,12 +1451,7 @@ def install(self, packages=[], apt_packages=[], disp_msg=True):
14751451
if self.app.pargs.nginx:
14761452
Log.debug(self, "Setting apt_packages variable for Nginx")
14771453

1478-
if EEVariables.ee_platform_distro == 'debian':
1479-
check_nginx = 'nginx-extras'
1480-
else:
1481-
check_nginx = 'nginx-custom'
1482-
1483-
if not EEAptGet.is_installed(self, check_nginx):
1454+
if not EEAptGet.is_installed(self, 'nginx-custom'):
14841455
apt_packages = apt_packages + EEVariables.ee_nginx
14851456
else:
14861457
Log.debug(self, "Nginx already installed")

ee/cli/plugins/stack_services.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ def start(self):
3434
self.app.pargs.hhvm = True
3535

3636
if self.app.pargs.nginx:
37-
if EEVariables.ee_platform_distro == 'debian':
38-
check_nginx = 'nginx-extras'
39-
else:
40-
check_nginx = 'nginx-custom'
41-
42-
if EEAptGet.is_installed(self, check_nginx):
37+
if EEAptGet.is_installed(self, 'nginx-custom'):
4338
services = services + ['nginx']
4439
else:
4540
Log.info(self, "Nginx is not installed")
@@ -105,12 +100,7 @@ def stop(self):
105100
self.app.pargs.hhvm = True
106101

107102
if self.app.pargs.nginx:
108-
if EEVariables.ee_platform_distro == 'debian':
109-
check_nginx = 'nginx-extras'
110-
else:
111-
check_nginx = 'nginx-custom'
112-
113-
if EEAptGet.is_installed(self, check_nginx):
103+
if EEAptGet.is_installed(self, 'nginx-custom'):
114104
services = services + ['nginx']
115105
else:
116106
Log.info(self, "Nginx is not installed")
@@ -176,12 +166,7 @@ def restart(self):
176166
self.app.pargs.hhvm = True
177167

178168
if self.app.pargs.nginx:
179-
if EEVariables.ee_platform_distro == 'debian':
180-
check_nginx = 'nginx-extras'
181-
else:
182-
check_nginx = 'nginx-custom'
183-
184-
if EEAptGet.is_installed(self, check_nginx):
169+
if EEAptGet.is_installed(self, 'nginx-custom'):
185170
services = services + ['nginx']
186171
else:
187172
Log.info(self, "Nginx is not installed")
@@ -247,12 +232,7 @@ def status(self):
247232
self.app.pargs.hhvm = True
248233

249234
if self.app.pargs.nginx:
250-
if EEVariables.ee_platform_distro == 'debian':
251-
check_nginx = 'nginx-extras'
252-
else:
253-
check_nginx = 'nginx-custom'
254-
255-
if EEAptGet.is_installed(self, check_nginx):
235+
if EEAptGet.is_installed(self, 'nginx-custom'):
256236
services = services + ['nginx']
257237
else:
258238
Log.info(self, "Nginx is not installed")
@@ -317,12 +297,7 @@ def reload(self):
317297
self.app.pargs.postfix = True
318298

319299
if self.app.pargs.nginx:
320-
if EEVariables.ee_platform_distro == 'debian':
321-
check_nginx = 'nginx-extras'
322-
else:
323-
check_nginx = 'nginx-custom'
324-
325-
if EEAptGet.is_installed(self, check_nginx):
300+
if EEAptGet.is_installed(self, 'nginx-custom'):
326301
services = services + ['nginx']
327302
else:
328303
Log.info(self, "Nginx is not installed")

ee/cli/plugins/stack_upgrade.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,7 @@ def default(self):
140140
Log.info(self, "Mail server is not installed")
141141

142142
if self.app.pargs.nginx:
143-
if EEVariables.ee_platform_distro == 'debian':
144-
check_nginx = 'nginx-extras'
145-
else:
146-
check_nginx = 'nginx-custom'
147-
148-
if EEAptGet.is_installed(self, check_nginx):
143+
if EEAptGet.is_installed(self, 'nginx-custom'):
149144
apt_packages = apt_packages + EEVariables.ee_nginx
150145
else:
151146
Log.info(self, "Nginx is not already installed")
@@ -191,33 +186,7 @@ def default(self):
191186

192187
# Post Actions after package updates
193188
if set(EEVariables.ee_nginx).issubset(set(apt_packages)):
194-
# Fix whitescreen of death beacuse of missing value
195-
# fastcgi_param SCRIPT_FILENAME $request_filename; in file
196-
# /etc/nginx/fastcgi_params
197-
if not EEFileUtils.grep(self, '/etc/nginx/fastcgi_params',
198-
'SCRIPT_FILENAME'):
199-
with open('/etc/nginx/fastcgi_params',
200-
encoding='utf-8', mode='a') as ee_nginx:
201-
ee_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
202-
'\t$request_filename;\n')
203-
204-
# Fix "ssl_prefer_server_ciphers" directive is duplicate
205-
# that is arrived in latest Debian update
206-
if EEVariables.ee_platform_distro == 'ubuntu':
207-
data = dict(version=EEVariables.ee_version, Ubuntu=True)
208-
else:
209-
data = dict(version=EEVariables.ee_version, Debian=True)
210-
Log.debug(self, 'Writting the nginx configuration to '
211-
'file /etc/nginx/conf.d/ee-nginx.conf ')
212-
ee_nginx = open('/etc/nginx/conf.d/ee-nginx.conf',
213-
encoding='utf-8', mode='w')
214-
self.app.render((data), 'nginx-core.mustache', out=ee_nginx)
215-
ee_nginx.close()
216-
217-
EEGit.add(self, ["/etc/nginx"], msg="Updated Nginx")
218-
219189
EEService.restart_service(self, 'nginx')
220-
221190
if set(EEVariables.ee_php).issubset(set(apt_packages)):
222191
EEService.restart_service(self, 'php5-fpm')
223192
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):

ee/core/addswap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def add(self):
1818
"""Swap addition with EasyEngine"""
1919
if EEVariables.ee_ram < 512:
2020
if EEVariables.ee_swap < 1000:
21-
Log.info(self, "Adding SWAP")
21+
Log.info(self, "Adding SWAP file, please wait...")
2222

2323
# Install dphys-swapfile
2424
EEAptGet.update(self)

ee/core/nginxhashbucket.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,6 @@ def hashbucket(self):
3636
else:
3737
print(line, end='')
3838

39-
elif os.path.isfile('/etc/nginx/conf.d/ee-nginx.conf'):
40-
if EEFileUtils.grep(self, "/etc/nginx/conf.d/ee-nginx.conf",
41-
"server_names_hash_bucket_size"):
42-
for line in fileinput.FileInput("/etc/nginx/conf.d/ee-nginx.conf",
43-
inplace=1):
44-
if "server_names_hash_bucket_size" in line:
45-
print("server_names_hash_bucket_size {0};"
46-
.format(ngx_hash))
47-
else:
48-
print(line, end='')
49-
50-
else:
51-
with open('/etc/nginx/conf.d/ee-nginx.conf', 'a') as conf:
52-
conf.write("server_names_hash_bucket_size {0};\n"
53-
.format(ngx_hash))
5439
else:
5540
EEFileUtils.searchreplace(self, '/etc/nginx/nginx.conf',
5641
"gzip_disable \"msie6\";",

ee/core/variables.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class EEVariables():
1212
"""Intialization of core variables"""
1313

1414
# EasyEngine version
15-
ee_version = "3.1.9"
15+
ee_version = "3.1.10"
1616

1717
# EasyEngine packages versions
1818
ee_wp_cli = "0.19.1"
@@ -76,13 +76,21 @@ class EEVariables():
7676

7777
# EasyEngine stack installation varibales
7878
# Nginx repo and packages
79-
if ee_platform_distro == 'ubuntu':
80-
ee_nginx_repo = "ppa:rtcamp/nginx"
81-
ee_nginx = ["nginx-custom", "nginx-common"]
82-
elif ee_platform_distro == 'debian':
83-
ee_nginx_repo = ("deb http://packages.dotdeb.org {codename} all"
84-
.format(codename=ee_platform_codename))
85-
ee_nginx = ["nginx-extras", "nginx-common"]
79+
if ee_platform_codename == 'precise':
80+
ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
81+
"/rtCamp:/EasyEngine/xUbuntu_12.04/ /")
82+
elif ee_platform_codename == 'trusty':
83+
ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
84+
"/rtCamp:/EasyEngine/xUbuntu_14.04/ /")
85+
elif ee_platform_codename == 'wheezy':
86+
ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
87+
"/rtCamp:/EasyEngine/Debian_7.0/ /")
88+
elif ee_platform_codename == 'jessie':
89+
ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
90+
"/rtCamp:/EasyEngine/Debian_8.0/ /")
91+
92+
ee_nginx = ["nginx-custom", "nginx-common"]
93+
ee_nginx_key = '3050AC3CD2AE6F03'
8694

8795
# PHP repo and packages
8896
if ee_platform_distro == 'ubuntu':

0 commit comments

Comments
 (0)