7 | 7 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
8 | 8 |
--- a/faraday.py
|
9 | 9 |
+++ b/faraday.py
|
10 | |
@@ -126,10 +126,6 @@ def getParserArgs():
|
|
10 |
@@ -125,10 +125,6 @@ def getParserArgs():
|
11 | 11 |
default=False,
|
12 | 12 |
help="Ignore python dependencies resolution.")
|
13 | 13 |
|
|
18 | 18 |
parser.add_argument('--cert', action="store", dest="cert_path",
|
19 | 19 |
default=None,
|
20 | 20 |
help="Path to the valid CouchDB certificate")
|
21 | |
@@ -199,44 +195,6 @@ def query_user_bool(question, default=Tr
|
|
21 |
@@ -198,44 +194,6 @@ def query_user_bool(question, default=Tr
|
22 | 22 |
"(or 'y' or 'n').\n")
|
23 | 23 |
|
24 | 24 |
|
|
63 | 63 |
def startProfiler(app, output, depth):
|
64 | 64 |
"""Profiler handler.
|
65 | 65 |
|
66 | |
@@ -458,40 +416,6 @@ _/ ____\_____ ____________ __| _/__
|
|
66 |
@@ -457,40 +415,6 @@ _/ ____\_____ ____________ __| _/__
|
67 | 67 |
logger.info("Starting Faraday IDE.")
|
68 | 68 |
|
69 | 69 |
|
|
104 | 104 |
def checkCouchUrl():
|
105 | 105 |
import requests
|
106 | 106 |
try:
|
107 | |
@@ -507,24 +431,6 @@ def checkCouchUrl():
|
|
107 |
@@ -506,24 +430,6 @@ def checkCouchUrl():
|
108 | 108 |
# Non fatal error
|
109 | 109 |
pass
|
110 | 110 |
|
|
129 | 129 |
def init():
|
130 | 130 |
"""Initializes what is needed before starting.
|
131 | 131 |
|
132 | |
@@ -551,20 +457,12 @@ def main():
|
|
132 |
@@ -550,20 +456,12 @@ def main():
|
133 | 133 |
os.chdir(FARADAY_BASE)
|
134 | 134 |
|
135 | 135 |
init()
|
|
158 | 158 |
if __name__ == '__main__':
|
159 | 159 |
--- a/faraday-server.py
|
160 | 160 |
+++ b/faraday-server.py
|
161 | |
@@ -54,36 +54,8 @@ def setup_environment(cli_arguments):
|
162 | |
if cli_arguments.debug:
|
163 | |
set_logging_level(server.config.DEBUG)
|
164 | |
|
|
161 |
@@ -57,42 +57,12 @@ def setup_environment():
|
|
162 |
# Configuration files generation
|
|
163 |
server.config.copy_default_config_to_local()
|
|
164 |
|
|
165 |
- # Dependencies installation
|
165 | 166 |
- missing_packages = check_dependencies()
|
166 | |
-
|
167 | 167 |
- if len(missing_packages) > 0:
|
168 | |
- answer = ask_to_install(missing_packages)
|
169 | |
- if answer:
|
170 | |
- logger.info(
|
171 | |
- "Dependencies installed. Please launch Faraday Server again")
|
172 | |
- sys.exit(0)
|
173 | |
- else:
|
174 | |
- logger.error("Dependencies not met")
|
175 | |
- sys.exit(1)
|
176 | |
-
|
|
168 |
- install_packages(missing_packages)
|
|
169 |
-
|
|
170 |
# Web configuration file generation
|
177 | 171 |
server.config.gen_web_config()
|
|
172 |
|
|
173 |
# Reports DB creation
|
|
174 |
server.couchdb.push_reports()
|
178 | 175 |
|
179 | 176 |
-def check_dependencies():
|
180 | 177 |
- checker = DependencyChecker(server.config.REQUIREMENTS_FILE)
|
181 | 178 |
- missing = checker.check_dependencies()
|
182 | 179 |
- return missing
|
183 | 180 |
-
|
|
181 |
-def install_packages(packages):
|
|
182 |
- if ask_to_install(packages):
|
|
183 |
- logger.info("Dependencies installed. Please launch Faraday Server again")
|
|
184 |
- sys.exit(0)
|
|
185 |
- else:
|
|
186 |
- logger.error("Dependencies not met")
|
|
187 |
- sys.exit(1)
|
|
188 |
-
|
184 | 189 |
-def ask_to_install(missing_packages):
|
185 | |
- logger = get_logger(__name__)
|
186 | 190 |
- logger.warning("The following packages are not installed:")
|
187 | 191 |
- for package in missing_packages:
|
188 | 192 |
- logger.warning("%s" % package)
|
189 | |
- res = query_yes_no("Do you want to install them?", default="no")
|
190 | |
- if res:
|
|
193 |
-
|
|
194 |
- if query_yes_no("Do you want to install them?", default="no"):
|
191 | 195 |
- checker = DependencyChecker(server.config.REQUIREMENTS_FILE)
|
192 | 196 |
- checker.install_packages(missing_packages)
|
193 | |
- return res
|
194 | |
-
|
195 | |
def setup_and_run_server(cli_arguments):
|
196 | |
import server.web
|
197 | |
import server.database
|
|
197 |
- return True
|
|
198 |
-
|
|
199 |
- return False
|
|
200 |
-
|
|
201 |
def import_workspaces():
|
|
202 |
import server.importer
|
|
203 |
server.importer.import_workspaces()
|