Skip to content

Commit 1ac085d

Browse files
committed
merge conflict resolved python => master
2 parents 44ddca3 + 32acf57 commit 1ac085d

File tree

22 files changed

+1379
-1240
lines changed

22 files changed

+1379
-1240
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ sudo ee site create example.com --wp # Install required packages & setup
2121
## Update EasyEngine
2222

2323

24-
Update Procedure For EasyEngine to version 3.0.6
24+
Update procedure for EasyEngine to latest version
2525

26+
#### For current installed version prior to 3.0.6
2627
```bash
2728
wget -qO ee rt.cx/ee && sudo bash ee
29+
30+
```
31+
#### Current version is 3.0.6
32+
```
33+
ee update
2834
```
2935

3036
## More Site Creation Commands
@@ -85,7 +91,7 @@ ee site create example.com --mysql # create example.com with php & mysql supp
8591

8692
## Careers
8793

88-
We are looking for [Python Developers] (https://rtcamp.com/careers/python-developer/) to join our team.
94+
We are looking for [Python Developers] (https://rtcamp.com/careers/python-developer/) to join our team.
8995

9096
We offer work from home, so you can join EasyEngine team anywhere! _[Why Python?] (https://rtcamp.com/blog/easyengine-3-roadmap/#whypython)_
9197

config/bash_completion.d/ee_auto.rc

Lines changed: 2 additions & 2 deletions
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" \
14+
-W "stack site debug clean secure import-slow-log log update" \
1515
-- $cur) )
1616

1717

@@ -74,7 +74,7 @@ _ee_complete()
7474
# HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE
7575
"install" | "purge" | "remove" )
7676
COMPREPLY=( $(compgen \
77-
-W "--web --admin --mail --nginx --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --memcache --dovecot --all" \
77+
-W "--web --admin --mail --nginx --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --memcache --dovecot --all --mailscanner" \
7878
-- $cur) )
7979
;;
8080
"start" | "stop" | "reload" | "restart" | "status")

config/plugins.d/update.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Example Plugin Configuration for EasyEngine
2+
3+
[update]
4+
5+
### If enabled, load a plugin named `example` either from the Python module
6+
### `ee.cli.plugins.example` or from the file path
7+
### `/var/lib/ee/plugins/example.py`
8+
enable_plugin = true

docs/ee.8

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ ee site update example.com [ --php | --mysql] [[--wp | --wpsubdir | --wpsubdomai
1717
.TP
1818
ee site delete example.com [--db | --files | --all | --no-prompt ]
1919
.TP
20-
ee debug [ -i | --nginx | --rewrite | --php | --fpm | --mysql ] [--stop ]
20+
ee debug [ -i | --all=on/off |--nginx=on/off | --rewrite=on/off | --php=on/off | --fpm=on/off | --mysql=on/off ]
2121
.TP
22-
ee debug example.com [ -i | --nginx | --rewrite | --wp ] [--stop ]
22+
ee debug example.com [ -i | --all=on/off | --nginx=on/off | --rewrite=on/off | --wp=on/off ]
2323
.TP
2424
ee secure [ --auth | --port | --ip ]
2525
.SH DESCRIPTION
2626
EasyEngine aka ee is the opensource project developed with the purpose to automate web-server configuration.
2727
.br
28-
EasyEngine is the collection of shell scripts that provides automation for the web-server
28+
EasyEngine is the collection of python script that provides automation for the web-server
2929
.br
3030
installation, site creation, services debugging & monitoring.
3131
.SH OPTIONS
@@ -95,7 +95,7 @@ Change directory to webroot of specified site in subshell.
9595
.br
9696
monitor access and error logs for site specified.
9797
.TP
98-
.B list [ enable | available ]
98+
.B list [ --enabled | --disabled ]
9999
.br
100100
Lists all available sites from /etc/nginx/sites-enabled/
101101
.br
@@ -143,21 +143,21 @@ Update site configuration according to specified options.
143143
.br
144144
Delete site i.e webroot, database, ad configuration permenantly.
145145
.TP
146-
.B debug [ -i | --nginx | --php | --mysql | --rewrite | --fpm ] [ --start | --stop ]
146+
.B debug [ -i | --nginx=on/off | --php=on/off | --mysql=on/off | --rewrite=on/off | --fpm=on/off ]
147147
.br
148-
Starts server level debugging. If used without arguments starts debugging
148+
Starts server level debugging. If this is used without arguments it will start debugging
149149
.br
150-
all services, else debug only service provided with argument. Stop
150+
all services.Else it will debug only service provided with argument.This will Stop
151151
.br
152-
Debugging if used with --stop argument.
152+
Debugging if used with --all=off argument.
153153
.TP
154-
.B debug example.com [ -i | --nginx | --rewrite | --wp ] [ --start | --stop ]
154+
.B debug example.com [ -i | --nginx=on/off | --rewrite=on/off | --wp=on/off | --all=on/off ]
155155
.br
156-
Starts site level debugging. If used without arguments starts debugging all
156+
Starts site level debugging. If this is used without arguments it will start debugging all
157157
.br
158-
services, else debug only service provided with argument. Stop Debugging
158+
services.Else it will debug only service provided with argument.This will Stop Debugging
159159
.br
160-
if used with --stop argument.
160+
if used with --all=off argument.
161161
.TP
162162
.B secure [ --auth | --port ]
163163
.br
@@ -174,35 +174,35 @@ Clean NGINX fastCGI cache if no option specified.
174174
.br
175175
setup intractive mode while used with debug.
176176
.TP
177-
.B --nginx
177+
.B --nginx=on/off
178178
.br
179179
used with ee debug command. used to start or stop nginx debugging.
180180
.TP
181-
.B --php
181+
.B --php=on/off
182182
.br
183183
used with ee debug command. used to start or stop php debugging.
184184
.TP
185-
.B --mysql
185+
.B --mysql=on/off
186186
.br
187187
used with ee debug command. used to start or stop mysql debugging.
188188
.TP
189-
.B --rewrite
189+
.B --rewrite=on/off
190190
.br
191191
used with ee debug command. used to start or stop nginx rewrite rules debugging.
192192
.TP
193-
.B --fpm
193+
.B --fpm=on/off
194194
.br
195195
used with ee debug command. used to start or stop fpm debugging.
196196
.TP
197-
.B --wp
197+
.B --wp=on/off
198198
.br
199-
used with ee debug command. used to start or stop wordpress site debugging.
199+
used with ee debug command. used to start or stop wordpress site debugging.
200200
.TP
201-
.B --start
201+
.B --all=on/off
202202
.br
203203
used with ee debug command. used to stop debugging.
204204
.TP
205-
.B --stop
205+
.B --all=off
206206
.br
207207
used with ee debug command. used to stop debugging.
208208
.TP

ee/cli/plugins/clean.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import urllib.request
1111

1212

13-
def clean_plugin_hook(app):
13+
def ee_clean_hook(app):
1414
# do something with the ``app`` object here.
1515
pass
1616

@@ -31,6 +31,7 @@ class Meta:
3131
(['--opcache'],
3232
dict(help='Clean OpCache', action='store_true'))
3333
]
34+
usage = "ee clean [options]"
3435

3536
@expose(hide=True)
3637
def default(self):
@@ -86,4 +87,4 @@ def load(app):
8687
# register the plugin class.. this only happens if the plugin is enabled
8788
handler.register(EECleanController)
8889
# register a hook (function) to run after arguments are parsed.
89-
hook.register('post_argument_parsing', clean_plugin_hook)
90+
hook.register('post_argument_parsing', ee_clean_hook)

ee/cli/plugins/debug.py

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,8 @@
1414
import signal
1515
import subprocess
1616

17-
usage = """
18-
Usage: ee debug {<sitename>} {arguments}
19-
20-
arguments usage:
21-
--all --all=on start debugging all server parameters.
22-
--all=off stop debugging all server parameters
23-
--nginx --nginx=on start debugging nginx server configuration for site
24-
--nginx=off stop debugging nginx server configuration for site
25-
--rewrite --rewrite=on start debugging nginx rewrite rules for site
26-
--rewrite=off stop debugging nginx rewrite rules for site
27-
--php --php=on start debugging server php configuration
28-
--php=off stop debugging server php configuration
29-
--fpm --fpm=on start debugging fastcgi configuration
30-
--fpm=off stop debugging fastcgi configuration
31-
--mysql --mysql=on start debugging mysql server
32-
--mysql=off stop debugging mysql server
33-
--wp --wp=on start wordpress debugging
34-
--wp=off stop wordpress debugging
35-
36-
"""
37-
38-
39-
def debug_plugin_hook(app):
17+
18+
def ee_debug_hook(app):
4019
# do something with the ``app`` object here.
4120
pass
4221

@@ -89,6 +68,7 @@ class Meta:
8968
(['site_name'],
9069
dict(help='Website Name', nargs='?', default=None))
9170
]
71+
usage = "ee debug [<site_name>] [options] "
9272

9373
@expose(hide=True)
9474
def debug_nginx(self):
@@ -493,9 +473,10 @@ def default(self):
493473
and (not self.app.pargs.all)
494474
and (not self.app.pargs.site_name)):
495475
if self.app.pargs.stop or self.app.pargs.start:
496-
print("--start/stop option is deprecated in ee3.0.5", usage)
476+
print("--start/stop option is deprecated since ee3.0.5")
477+
self.app.args.print_help()
497478
else:
498-
print(usage)
479+
self.app.args.print_help()
499480

500481
if self.app.pargs.all == 'on':
501482
if self.app.pargs.site_name:
@@ -519,7 +500,7 @@ def default(self):
519500
and (not self.app.pargs.fpm) and (not self.app.pargs.mysql)
520501
and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
521502
and self.app.pargs.site_name):
522-
print(usage)
503+
self.app.args.print_help()
523504
# self.app.pargs.nginx = 'on'
524505
# self.app.pargs.wp = 'on'
525506
# self.app.pargs.rewrite = 'on'
@@ -570,4 +551,4 @@ def load(app):
570551
# register the plugin class.. this only happens if the plugin is enabled
571552
handler.register(EEDebugController)
572553
# register a hook (function) to run after arguments are parsed.
573-
hook.register('post_argument_parsing', debug_plugin_hook)
554+
hook.register('post_argument_parsing', ee_debug_hook)

ee/cli/plugins/import_slow_log.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os
77

88

9-
def import_slow_log_plugin_hook(app):
9+
def ee_import_slow_log_hook(app):
1010
pass
1111

1212

@@ -16,6 +16,7 @@ class Meta:
1616
stacked_on = 'base'
1717
stacked_type = 'nested'
1818
description = 'Import MySQL slow log to Anemometer database'
19+
usage = "ee import-slow-log"
1920

2021
@expose(hide=True)
2122
def default(self):
@@ -67,4 +68,4 @@ def load(app):
6768
handler.register(EEImportslowlogController)
6869

6970
# register a hook (function) to run after arguments are parsed.
70-
hook.register('post_argument_parsing', import_slow_log_plugin_hook)
71+
hook.register('post_argument_parsing', ee_import_slow_log_hook)

ee/cli/plugins/info.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import configparser
1111

1212

13-
def info_plugin_hook(app):
13+
def ee_info_hook(app):
1414
# do something with the ``app`` object here.
1515
pass
1616

@@ -33,6 +33,7 @@ class Meta:
3333
dict(help='Get Nginx configuration information',
3434
action='store_true')),
3535
]
36+
usage = "ee info [options]"
3637

3738
@expose(hide=True)
3839
def info_nginx(self):
@@ -199,4 +200,4 @@ def load(app):
199200
handler.register(EEInfoController)
200201

201202
# register a hook (function) to run after arguments are parsed.
202-
hook.register('post_argument_parsing', info_plugin_hook)
203+
hook.register('post_argument_parsing', ee_info_hook)

ee/cli/plugins/log.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import glob
1212

1313

14-
def log_plugin_hook(app):
14+
def ee_log_hook(app):
1515
# do something with the ``app`` object here.
1616
pass
1717

@@ -43,6 +43,7 @@ class Meta:
4343
(['site_name'],
4444
dict(help='Website Name', nargs='?', default=None))
4545
]
46+
usage = "ee log [<site_name>] [options]"
4647

4748
@expose(hide=True)
4849
def default(self):
@@ -137,4 +138,4 @@ def load(app):
137138
# register the plugin class.. this only happens if the plugin is enabled
138139
handler.register(EELogController)
139140
# register a hook (function) to run after arguments are parsed.
140-
hook.register('post_argument_parsing', log_plugin_hook)
141+
hook.register('post_argument_parsing', ee_log_hook)

ee/core/models.py renamed to ee/cli/plugins/models.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class SiteDB(Base):
77
Databse model for site table
88
"""
99
__tablename__ = 'sites'
10+
__table_args__ = {'extend_existing': True}
1011
id = Column(Integer, primary_key=True)
1112
sitename = Column(String, unique=True)
1213

@@ -23,10 +24,18 @@ class SiteDB(Base):
2324
is_ssl = Column(Boolean, unique=False, default=False)
2425
storage_fs = Column(String)
2526
storage_db = Column(String)
27+
db_name = Column(String)
28+
db_user = Column(String)
29+
db_password = Column(String)
30+
db_host = Column(String)
31+
is_hhvm = Column(Boolean, unique=False, default=False)
32+
is_pagespeed = Column(Boolean, unique=False, default=False)
2633

2734
def __init__(self, sitename=None, site_type=None, cache_type=None,
2835
site_path=None, site_enabled=None,
29-
is_ssl=None, storage_fs=None, storage_db=None):
36+
is_ssl=None, storage_fs=None, storage_db=None, db_name=None,
37+
db_user=None, db_password=None, db_host='localhost',
38+
hhvm=None, pagespeed=None):
3039
self.sitename = sitename
3140
self.site_type = site_type
3241
self.cache_type = cache_type
@@ -35,7 +44,12 @@ def __init__(self, sitename=None, site_type=None, cache_type=None,
3544
self.is_ssl = is_ssl
3645
self.storage_fs = storage_fs
3746
self.storage_db = storage_db
38-
47+
self.db_name = db_name
48+
self.db_user = db_user
49+
self.db_password = db_password
50+
self.db_host = db_host
51+
self.is_hhvm = hhvm
52+
self.is_pagespeed = pagespeed
3953
# def __repr__(self):
4054
# return '<Site %r>' % (self.site_type)
4155
#

0 commit comments

Comments
 (0)