Codebase list python-faraday / 19ce3a6
Import new upstream release Sophie Brun 7 years ago
6 changed file(s) with 273 addition(s) and 175 deletion(s). Raw diff Collapse all Expand all
0 python-faraday (2.4.0-0kali1) kali-dev; urgency=medium
1
2 * Import new upstream release
3
4 -- Sophie Brun <[email protected]> Tue, 21 Mar 2017 16:34:05 +0100
5
06 python-faraday (2.3.1-0kali1) kali-dev; urgency=medium
17
28 * Import new upstream release
2121 *.py usr/share/python-faraday/
2222 faraday-terminal.zsh usr/share/python-faraday/
2323 debian/helper-script/* usr/bin/
24 VERSION usr/share/python-faraday/
0 --- a/faraday.py
1 +++ b/faraday.py
2 @@ -487,7 +487,7 @@ def checkVersion():
3 f_version = f.read().strip()
4 if not args.update:
5 if getInstanceConfiguration().getVersion() is not None and getInstanceConfiguration().getVersion() != f_version:
6 - logger.warning("You have different version of Faraday since your last run.\nRun ./faraday.py --update to update configuration!")
7 + logger.warning("You have different version of Faraday since your last run.\nRun python-faraday.py --update to update configuration!")
8 if query_yes_no('Do you want to close Faraday?', 'yes'):
9 sys.exit(-1)
10
11 @@ -542,7 +542,7 @@ def main():
12 checkConfiguration(args.gui)
13 setConf()
14 checkCouchUrl()
15 - #checkVersion()
16 + checkVersion()
17
18 check_faraday_version()
19
0 --- a/server/modules/info.py
1 +++ b/server/modules/info.py
2 @@ -9,9 +9,8 @@ from server.app import app
3
4 @app.route('/info', methods=['GET'])
5 def show_info():
6 - faraday_directory = os.path.dirname(os.path.realpath('faraday.py'))
7
8 - file_path = os.path.join(faraday_directory, 'VERSION')
9 + file_path = '/usr/share/python-faraday/VERSION'
10
11 with open(file_path, 'r') as version_file:
12 version = version_file.read().strip()
55 Last-Update: 2016-08-18
66 ---
77 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
8 --- a/faraday.py
9 +++ b/faraday.py
10 @@ -198,44 +198,6 @@ def query_user_bool(question, default=Tr
11 "(or 'y' or 'n').\n")
12
13
14 -def checkDependencies():
15 - """Dependency resolver based on a previously specified CONST_REQUIREMENTS_FILE.
16 -
17 - Currently checks a list of dependencies from a file and asks for user
18 - confirmation on whether to install it with a specific version or not.
19 -
20 - """
21 -
22 - if not args.ignore_deps:
23 - try:
24 - import pip
25 - modules = []
26 - f = open(FARADAY_REQUIREMENTS_FILE)
27 - for line in f:
28 - if not line.find('#'):
29 - break
30 - else:
31 - modules.append(line.strip('\n'))
32 - f.close()
33 - pip_dist = [dist.project_name.lower() for dist in pip.get_installed_distributions()]
34 - for module in modules:
35 - if module.lower() not in pip_dist:
36 - try:
37 - __import__(module)
38 - except ImportError:
39 - if query_user_bool("Missing module %s."
40 - " Do you wish to install it?" % module):
41 - pip.main(['install', "%s" %
42 - module, '--user'])
43 -
44 - else:
45 - return False
46 - except ImportError:
47 - pass
48 -
49 - return True
50 -
51 -
52 def startProfiler(app, output, depth):
53 """Profiler handler.
54
55 @@ -469,27 +431,6 @@ def update():
56 logger.info("Update process finished with no errors")
57 logger.info("Faraday will start now.")
58
59 -def checkUpdates():
60 - import requests
61 - uri = getInstanceConfiguration().getUpdatesUri()
62 - resp = u"OK"
63 - try:
64 - f = open(FARADAY_VERSION_FILE)
65 -
66 - getInstanceConfiguration().setVersion(f.read().strip())
67 - getInstanceConfiguration().setAppname("Faraday - Penetration Test IDE Community")
68 - parameter = {"version": getInstanceConfiguration().getVersion()}
69 -
70 - f.close()
71 - resp = requests.get(uri, params=parameter, timeout=1, verify=True)
72 - resp = resp.text.strip()
73 - except Exception as e:
74 - logger.error(e)
75 - if not resp == u'OK':
76 - logger.info("You have available updates. Run ./faraday.py --update to catchup!")
77 - else:
78 - logger.info("No updates available, enjoy Faraday.")
79 -
80
81 def checkCouchUrl():
82 import requests
83 @@ -506,23 +447,6 @@ def checkCouchUrl():
84 # Non fatal error
85 pass
86
87 -def checkVersion():
88 - try:
89 - f = open(FARADAY_VERSION_FILE)
90 - f_version = f.read().strip()
91 - if not args.update:
92 - if getInstanceConfiguration().getVersion() != None and getInstanceConfiguration().getVersion() != f_version:
93 - logger.warning("You have different version of Faraday since your last run.\nRun ./faraday.py --update to update configuration!")
94 - if query_yes_no('Do you want to close Faraday?', 'yes'):
95 - sys.exit(-1)
96 -
97 - getInstanceConfiguration().setVersion(f_version)
98 - f.close()
99 -
100 - except Exception as e:
101 - getLogger("launcher").error("It seems that something's wrong with your version\nPlease contact customer support")
102 - sys.exit(-1)
103 -
104
105 def init():
106 """Initializes what is needed before starting.
107 @@ -550,20 +474,20 @@ def main():
108 os.chdir(FARADAY_BASE)
109
110 init()
111 - if checkDependencies():
112 - printBanner()
113 - logger.info("Dependencies met.")
114 - if args.cert_path:
115 - os.environ[REQUESTS_CA_BUNDLE_VAR] = args.cert_path
116 - checkConfiguration(args.gui)
117 - setConf()
118 - checkCouchUrl()
119 - checkVersion()
120 - update()
121 - checkUpdates()
122 - startFaraday()
123 - else:
124 - logger.error("Dependencies not met. Unable to start Faraday.")
125 +# if checkDependencies():
126 + printBanner()
127 + # logger.info("Dependencies met.")
128 + if args.cert_path:
129 + os.environ[REQUESTS_CA_BUNDLE_VAR] = args.cert_path
130 + checkConfiguration(args.gui)
131 + setConf()
132 + checkCouchUrl()
133 +# checkVersion()
134 + update()
135 +# checkUpdates()
136 + startFaraday()
137 +# else:
138 +# logger.error("Dependencies not met. Unable to start Faraday.")
139
140
141 if __name__ == '__main__':
1428 --- a/faraday-server.py
1439 +++ b/faraday-server.py
144 @@ -11,7 +11,6 @@ import server.config
10 @@ -11,7 +11,7 @@ import server.config
14511 import server.couchdb
146
12 import server.utils.logger
14713 from server.utils import daemonize
148 -from utils.dependencies import DependencyChecker
14 -from utils import dependencies
15 +#from utils import dependencies
14916 from utils.user_input import query_yes_no
15017
15118 logger = server.utils.logger.get_logger(__name__)
152 @@ -57,42 +56,12 @@ def setup_environment():
19 @@ -21,28 +21,28 @@ def setup_environment(check_deps=False):
15320 # Configuration files generation
15421 server.config.copy_default_config_to_local()
15522
156 - # Dependencies installation
157 - missing_packages = check_dependencies()
158 - if len(missing_packages) > 0:
159 - install_packages(missing_packages)
160 -
23 - if check_deps:
24 +# if check_deps:
25
26 # Check dependencies
27 - installed_deps, missing_deps = dependencies.check_dependencies(
28 - requirements_file=server.config.REQUIREMENTS_FILE)
29 -
30 - logger.info("Checking dependencies...")
31 -
32 - if missing_deps:
33 -
34 - install_deps = query_yes_no("Do you want to install them?", default="no")
35 -
36 - if install_deps:
37 - dependencies.install_packages(missing_deps)
38 - logger.info("Dependencies installed. Please launch Faraday Server again.")
39 - sys.exit(0)
40 - else:
41 - logger.error("Dependencies not met. Please refer to the documentation in order to install them. [%s]",
42 - ", ".join(missing_deps))
43 - sys.exit(1)
44 -
45 - logger.info("Dependencies met")
46 +# installed_deps, missing_deps = dependencies.check_dependencies(
47 +# requirements_file=server.config.REQUIREMENTS_FILE)
48 +#
49 +# logger.info("Checking dependencies...")
50 +#
51 +# if missing_deps:
52 +#
53 +# install_deps = query_yes_no("Do you want to install them?", default="no")
54 +#
55 +# if install_deps:
56 +# dependencies.install_packages(missing_deps)
57 +# logger.info("Dependencies installed. Please launch Faraday Server again.")
58 +# sys.exit(0)
59 +# else:
60 +# logger.error("Dependencies not met. Please refer to the documentation in order to install them. [%s]",
61 +# ", ".join(missing_deps))
62 +# sys.exit(1)
63 +#
64 +# logger.info("Dependencies met")
65
16166 # Web configuration file generation
16267 server.config.gen_web_config()
163
164 # Reports DB creation
165 server.couchdb.push_reports()
166
167 -def check_dependencies():
168 - checker = DependencyChecker(server.config.REQUIREMENTS_FILE)
169 - missing = checker.check_dependencies()
170 - return missing
171 -
172 -def install_packages(packages):
173 - if ask_to_install(packages):
174 - logger.info("Dependencies installed. Please launch Faraday Server again")
175 - sys.exit(0)
176 - else:
177 - logger.error("Dependencies not met")
178 - sys.exit(1)
179 -
180 -def ask_to_install(missing_packages):
181 - logger.warning("The following packages are not installed:")
182 - for package in missing_packages:
183 - logger.warning("%s" % package)
184 -
185 - if query_yes_no("Do you want to install them?", default="no"):
186 - checker = DependencyChecker(server.config.REQUIREMENTS_FILE)
187 - checker.install_packages(missing_packages)
188 - return True
189 -
190 - return False
191 -
192 def import_workspaces():
193 import server.importer
194 server.importer.import_workspaces()
68 @@ -92,7 +92,7 @@ def main():
69 parser.add_argument('--debug', action='store_true', help='run Faraday Server in debug mode')
70 parser.add_argument('--start', action='store_true', help='run Faraday Server in background')
71 parser.add_argument('--stop', action='store_true', help='stop Faraday Server')
72 - parser.add_argument('--nodeps', action='store_true', help='Skip dependency check')
73 +# parser.add_argument('--nodeps', action='store_true', help='Skip dependency check')
74 parser.add_argument('--no-setup', action='store_true', help=argparse.SUPPRESS)
75 args = parser.parse_args()
76
77 @@ -110,7 +110,7 @@ def main():
78 server.config.ssl.set('enabled', 'true')
79
80 if not args.no_setup:
81 - setup_environment(not args.nodeps)
82 + setup_environment()
83 import_workspaces()
84
85 if args.start:
19586 --- a/updates/updater.py
19687 +++ b/updates/updater.py
19788 @@ -24,19 +24,19 @@ from persistence.server.models import cr
226117
227118
228119 # logger.info('Upgrading DBs to latest version')
120 --- a/faraday.py
121 +++ b/faraday.py
122 @@ -18,7 +18,7 @@ import sys
123
124 from config.configuration import getInstanceConfiguration
125 from config.globals import *
126 -from utils import dependencies
127 +#from utils import dependencies
128 from utils.logs import getLogger, setUpLogger
129 from utils.profilehooks import profile
130 from utils.user_input import query_yes_no
131 @@ -121,11 +121,11 @@ def getParserArgs():
132 default=False,
133 help="Enable dev mode. This will use the user config and plugin folder.")
134
135 - parser.add_argument('--ignore-deps',
136 - action="store_true",
137 - dest="ignore_deps",
138 - default=False,
139 - help="Ignore python dependencies resolution.")
140 +# parser.add_argument('--ignore-deps',
141 +# action="store_true",
142 +# dest="ignore_deps",
143 +# default=False,
144 +# help="Ignore python dependencies resolution.")
145
146 parser.add_argument('--update',
147 action="store_true",
148 @@ -171,37 +171,37 @@ def getParserArgs():
149 default=False,
150 help="Enables debug mode. Default = disabled")
151
152 - parser.add_argument('--nodeps', action='store_true', help='Skip dependency check')
153 +# parser.add_argument('--nodeps', action='store_true', help='Skip dependency check')
154
155 # args = parser.parse_args(['@parser_args.cfg'])
156 return parser.parse_args()
157
158
159 -def check_dependencies_or_exit():
160 - """Dependency resolver based on a previously specified CONST_REQUIREMENTS_FILE.
161 -
162 - Currently checks a list of dependencies from a file and exits if they are not met.
163 -
164 - """
165 -
166 - installed_deps, missing_deps = dependencies.check_dependencies(requirements_file=FARADAY_REQUIREMENTS_FILE)
167 -
168 - logger.info("Checking dependencies...")
169 -
170 - if missing_deps:
171 -
172 - install_deps = query_yes_no("Do you want to install them?", default="no")
173 -
174 - if install_deps:
175 - dependencies.install_packages(missing_deps)
176 - logger.info("Dependencies installed. Please launch Faraday Server again.")
177 - sys.exit(0)
178 - else:
179 - logger.error("Dependencies not met. Please refer to the documentation in order to install them. [%s]",
180 - ", ".join(missing_deps))
181 - sys.exit(1)
182 -
183 - logger.info("Dependencies met")
184 +#def check_dependencies_or_exit():
185 +# """Dependency resolver based on a previously specified CONST_REQUIREMENTS_FILE.
186 +#
187 +# Currently checks a list of dependencies from a file and exits if they are not met.
188 +#
189 +# """
190 +#
191 +# installed_deps, missing_deps = dependencies.check_dependencies(requirements_file=FARADAY_REQUIREMENTS_FILE)
192 +#
193 +# logger.info("Checking dependencies...")
194 +#
195 +# if missing_deps:
196 +#
197 +# install_deps = query_yes_no("Do you want to install them?", default="no")
198 +#
199 +# if install_deps:
200 +# dependencies.install_packages(missing_deps)
201 +# logger.info("Dependencies installed. Please launch Faraday Server again.")
202 +# sys.exit(0)
203 +# else:
204 +# logger.error("Dependencies not met. Please refer to the documentation in order to install them. [%s]",
205 +# ", ".join(missing_deps))
206 +# sys.exit(1)
207 +#
208 +# logger.info("Dependencies met")
209
210
211 def startProfiler(app, output, depth):
212 @@ -439,26 +439,26 @@ def update():
213 logger.info("Faraday will start now.")
214
215
216 -def checkUpdates():
217 - import requests
218 - uri = getInstanceConfiguration().getUpdatesUri()
219 - resp = u"OK"
220 - try:
221 - f = open(FARADAY_VERSION_FILE)
222 -
223 - getInstanceConfiguration().setVersion(f.read().strip())
224 - getInstanceConfiguration().setAppname("Faraday - Penetration Test IDE Community")
225 - parameter = {"version": getInstanceConfiguration().getVersion()}
226 -
227 - f.close()
228 - resp = requests.get(uri, params=parameter, timeout=1, verify=True)
229 - resp = resp.text.strip()
230 - except Exception as e:
231 - logger.error(e)
232 - if not resp == u'OK':
233 - logger.info("You have available updates. Run ./faraday.py --update to catchup!")
234 - else:
235 - logger.info("No updates available, enjoy Faraday.")
236 +#def checkUpdates():
237 +# import requests
238 +# uri = getInstanceConfiguration().getUpdatesUri()
239 +# resp = u"OK"
240 +# try:
241 +# f = open(FARADAY_VERSION_FILE)
242 +#
243 +# getInstanceConfiguration().setVersion(f.read().strip())
244 +# getInstanceConfiguration().setAppname("Faraday - Penetration Test IDE Community")
245 +# parameter = {"version": getInstanceConfiguration().getVersion()}
246 +#
247 +# f.close()
248 +# resp = requests.get(uri, params=parameter, timeout=1, verify=True)
249 +# resp = resp.text.strip()
250 +# except Exception as e:
251 +# logger.error(e)
252 +# if not resp == u'OK':
253 +# logger.info("You have available updates. Run ./faraday.py --update to catchup!")
254 +# else:
255 +# logger.info("No updates available, enjoy Faraday.")
256
257
258 def checkCouchUrl():
259 @@ -529,8 +529,8 @@ def main():
260 setupFolders(CONST_FARADAY_FOLDER_LIST)
261 setUpLogger(args.debug)
262
263 - if not args.nodeps:
264 - check_dependencies_or_exit()
265 +# if not args.nodeps:
266 +# check_dependencies_or_exit()
267
268 printBanner()
269 if args.cert_path:
270 @@ -538,12 +538,12 @@ def main():
271 checkConfiguration(args.gui)
272 setConf()
273 checkCouchUrl()
274 - checkVersion()
275 + #checkVersion()
276
277 check_faraday_version()
278
279 update()
280 - checkUpdates()
281 + #checkUpdates()
282 startFaraday()
283
284
00 remove-unwanted-checks.diff
11 copy-images-directory.patch
22 fix-syntax-error.patch
3 fix-path-to-VERSION.patch
4 fix-checkVersion.patch