Skip to content

Commit 94cfc0a

Browse files
author
shital.rtcamp
committed
Merge branch 'python' of https://github.com/rtCamp/easyengine into python
2 parents b38e59f + c7ba0fa commit 94cfc0a

25 files changed

+349
-201
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ before_script:
2222
script:
2323
- sudo echo -e "[user]\n\tname = abc\n\temail = [email protected]" > ~/.gitconfig
2424
- sudo echo "Travis Banch = $TRAVIS_BRANCH"
25-
- sudo apt-get install git python3-setuptools python3-dev python3-apt
25+
- sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt
2626
- sudo python3 setup.py install
2727
- sudo ee --help
2828
- sudo ee stack install

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 rtCamp solutions private limited
3+
Copyright (c) 2015 rtCamp Solutions Private Limited
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,21 @@ EasyEngine (ee) is a python tool, which makes it easy to manage your wordpress s
1919
- Ubuntu 12.04 & 14.04
2020
- Debian 7
2121

22-
### This is Beta version. Donot Try on Production/Live servers
2322

2423
## Quick Start
2524

2625
```bash
27-
wget http://rt.cx/eebeta && sudo bash eebeta # install easyengine 3.0.0-beta
26+
wget -q http://rt.cx/ee && sudo bash ee # install easyengine 3.0.0-beta
2827
sudo ee site create example.com --wp # Install required packages & setup WordPress on example.com
2928
```
3029

3130
## Update EasyEngine
3231

3332

34-
Update Procedure For EasyEngine to version 3.0.0-beta
33+
Update Procedure For EasyEngine to version 3.0
3534

3635
```bash
37-
wget http://rt.cx/eebeta && sudo bash install
36+
wget -q http://rt.cx/ee && sudo bash ee
3837
```
3938

4039
## More Site Creation Commands
@@ -85,8 +84,8 @@ ee site create example.com --mysql # create example.com with php & mysql supp
8584

8685

8786
## Useful Links
88-
- [Documentation] (http://rtcamp.com/easyengine/docs/)
89-
- [FAQ] (http://rtcamp.com/easyengine/faq/)
87+
- [Documentation] (http://docs.rtcamp.com/easyengine/docs/)
88+
- [FAQ] (http://docs.rtcamp.com/easyengine/faq/)
9089
- [Conventions used] (http://rtcamp.com/wordpress-nginx/tutorials/conventions/)
9190

9291
## Donations

config/ee.conf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,30 @@ max_files = 7
4040

4141
[stack]
4242

43-
ip-address = 0.0.0.0/0 1.1.1.1 2.2.2.2
43+
### IP address that will be used in Nginx configurations while installing
44+
ip-address = 127.0.0.1
4445

4546
[mysql]
4647

48+
### MySQL database grant host name
4749
grant-host = localhost
4850

51+
### Ask for MySQL db name while site creation
4952
db-name = False
5053

54+
### Ask for MySQL user name while site creation
5155
db-user = False
5256

5357
[wordpress]
5458

59+
### Ask for WordPress prefix while site creation
5560
prefix = False
5661

62+
### User name for WordPress sites
5763
user =
5864

65+
### Password for WordPress sites
5966
password =
6067

68+
### EMail for WordPress sites
6169
email =

docs/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/cs.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/ds.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

ee/cli/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ def main():
9494
# Default Cement signals are SIGINT and SIGTERM, exit 0 (non-error)
9595
code = 0
9696
print(e)
97+
except Exception as e:
98+
code = 1
99+
print(e)
97100
finally:
98101
# Print an exception (if it occurred) and --debug was passed
99102
if app.debug:

ee/cli/plugins/debug.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def debug_nginx(self):
6363
debug_address = ['0.0.0.0/0']
6464
for ip_addr in debug_address:
6565
if not ("debug_connection "+ip_addr in open('/etc/nginx/'
66-
'nginx.conf').read()):
66+
'nginx.conf', encoding='utf-8').read()):
6767
Log.info(self, "Setting up Nginx debug connection"
6868
" for "+ip_addr)
6969
EEShellExec.cmd_exec(self, "sed -i \"/events {{/a\\ \\ \\ "
@@ -79,7 +79,8 @@ def debug_nginx(self):
7979

8080
# stop global debug
8181
elif not self.start and not self.app.pargs.site_name:
82-
if "debug_connection " in open('/etc/nginx/nginx.conf').read():
82+
if "debug_connection " in open('/etc/nginx/nginx.conf',
83+
encoding='utf-8').read():
8384
Log.info(self, "Disabling Nginx debug connections")
8485
EEShellExec.cmd_exec(self, "sed -i \"/debug_connection.*/d\""
8586
" /etc/nginx/nginx.conf")
@@ -146,7 +147,8 @@ def debug_php(self):
146147
data = dict(php="9001", debug="9001")
147148
Log.info(self, 'Writting the Nginx debug configration to file '
148149
'/etc/nginx/conf.d/upstream.conf ')
149-
ee_nginx = open('/etc/nginx/conf.d/upstream.conf', 'w')
150+
ee_nginx = open('/etc/nginx/conf.d/upstream.conf',
151+
encoding='utf-8', mode='w')
150152
self.app.render((data), 'upstream.mustache', out=ee_nginx)
151153
ee_nginx.close()
152154
self.trigger_php = True
@@ -165,7 +167,8 @@ def debug_php(self):
165167
data = dict(php="9000", debug="9001")
166168
Log.debug(self, 'Writting the Nginx debug configration to file'
167169
' /etc/nginx/conf.d/upstream.conf ')
168-
ee_nginx = open('/etc/nginx/conf.d/upstream.conf', 'w')
170+
ee_nginx = open('/etc/nginx/conf.d/upstream.conf',
171+
encoding='utf-8', mode='w')
169172
self.app.render((data), 'upstream.mustache', out=ee_nginx)
170173
ee_nginx.close()
171174
self.trigger_php = True
@@ -186,7 +189,8 @@ def debug_fpm(self):
186189
config.remove_option('global', 'include')
187190
config['global']['log_level'] = 'debug'
188191
config['global']['include'] = '/etc/php5/fpm/pool.d/*.conf'
189-
with open('/etc/php5/fpm/php-fpm.conf', 'w') as configfile:
192+
with open('/etc/php5/fpm/php-fpm.conf',
193+
encoding='utf-8', mode='w') as configfile:
190194
Log.debug(self, "Writting php5-FPM configuration into "
191195
"/etc/php5/fpm/php-fpm.conf")
192196
config.write(configfile)
@@ -206,7 +210,8 @@ def debug_fpm(self):
206210
config.remove_option('global', 'include')
207211
config['global']['log_level'] = 'notice'
208212
config['global']['include'] = '/etc/php5/fpm/pool.d/*.conf'
209-
with open('/etc/php5/fpm/php-fpm.conf', 'w') as configfile:
213+
with open('/etc/php5/fpm/php-fpm.conf',
214+
encoding='utf-8', mode='w') as configfile:
210215
Log.debug(self, "writting php5 configuration into "
211216
"/etc/php5/fpm/php-fpm.conf")
212217
config.write(configfile)
@@ -278,7 +283,7 @@ def debug_wp(self):
278283
" grep true".format(wp_config)):
279284
Log.info(self, "Starting WordPress debug")
280285
open("{0}/htdocs/wp-content/debug.log".format(webroot),
281-
'a').close()
286+
encoding='utf-8', mode='a').close()
282287
EEShellExec.cmd_exec(self, "chown {1}: {0}/htdocs/wp-"
283288
"content/debug.log"
284289
"".format(webroot,

ee/cli/plugins/secure.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,23 @@ def secure_auth(self):
6060
self.app.pargs.user_pass = password
6161
if password == "":
6262
self.app.pargs.user_pass = passwd
63+
Log.debug(self, "printf username:"
64+
"$(openssl passwd -crypt "
65+
"password 2> /dev/null)\n\""
66+
"> /etc/nginx/htpasswd-ee 2>/dev/null")
6367
EEShellExec.cmd_exec(self, "printf \"{username}:"
6468
"$(openssl passwd -crypt "
6569
"{password} 2> /dev/null)\n\""
6670
"> /etc/nginx/htpasswd-ee 2>/dev/null"
6771
.format(username=self.app.pargs.user_input,
68-
password=self.app.pargs.user_pass))
72+
password=self.app.pargs.user_pass),
73+
log=False)
6974
Log.info(self, "Successfully changed HTTP authentication"
7075
" username to : {username}"
71-
.format(username=self.app.pargs.user_input))
76+
.format(username=self.app.pargs.user_input), log=False)
7277
Log.info(self, "Successfully changed HTTP authentication"
7378
" password to : {password}"
74-
.format(password=self.app.pargs.user_pass))
79+
.format(password=self.app.pargs.user_pass), log=False)
7580

7681
@expose(hide=True)
7782
def secure_port(self):
@@ -92,12 +97,12 @@ def secure_port(self):
9297
if EEVariables.ee_platform_distro == 'Ubuntu':
9398
EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
9499
"{port} default_server ssl spdy;/\" "
95-
"/etc/nginx/sites-available/22222.conf"
100+
"/etc/nginx/sites-available/22222"
96101
.format(port=self.app.pargs.user_input))
97102
if EEVariables.ee_platform_distro == 'debian':
98103
EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
99104
"{port} default_server ssl;/\" "
100-
"/etc/nginx/sites-available/22222.conf"
105+
"/etc/nginx/sites-available/22222"
101106
.format(port=self.app.pargs.user_input))
102107
Log.info(self, "Successfully port changed {port}"
103108
.format(port=self.app.pargs.user_input))

0 commit comments

Comments
 (0)