def get(self): """Handles GET request to the resource. Returns: JSON object including version info """ schema = {'meta': {'version': version.get_version()}, 'objects': []} response = jsonify(schema) response.status_code = HTTP_STATUS_CODE_OK return response
def _export_sketch(self, sketch): """Returns a ZIP file with the exported content of a sketch.""" file_object = io.BytesIO() sketch_is_archived = sketch.get_status.status == 'archived' if sketch_is_archived: _ = self._unarchive_sketch(sketch) story_exporter = story_export_manager.StoryExportManager.get_exporter( 'html') meta = { 'user': current_user.username, 'time': datetime.datetime.utcnow().isoformat(), 'sketch_id': sketch.id, 'sketch_name': sketch.name, 'sketch_description': sketch.description, 'timesketch_version': version.get_version(), } with zipfile.ZipFile(file_object, mode='w') as zip_file: zip_file.writestr('METADATA', data=json.dumps(meta)) for story in sketch.stories: export.export_story(story, sketch, story_exporter, zip_file) for aggregation in sketch.aggregations: export.export_aggregation(aggregation, sketch, zip_file) for view in sketch.views: self._export_view(view, sketch, zip_file) for group in sketch.aggregationgroups: export.export_aggregation_group(group, sketch, zip_file) self._export_events_with_comments(sketch, zip_file) self._export_starred_events(sketch, zip_file) self._export_tagged_events(sketch, zip_file) # TODO (kiddi): Add in aggregation group support. if sketch_is_archived: _ = self._archive_sketch(sketch) file_object.seek(0) return send_file( file_object, mimetype='zip', attachment_filename='timesketch_export.zip')
def run(self): """Return the version information of Timesketch.""" return 'Timesketch version: {0:s}'.format(version.get_version())
try: requirement = str(req.req) except AttributeError: requirement = str(req) yield requirement timesketch_description = ( 'Timesketch is a web based tool for collaborative forensic timeline ' 'analysis. Using sketches you and your collaborators can easily organize ' 'timelines and analyze them all at the same time. Add meaning to ' 'your raw data with rich annotations, comments, tags and stars.') setup( name='timesketch', version=version.get_version(), description='Digital forensic timeline analysis', long_description=timesketch_description, license='Apache License, Version 2.0', url='http://www.timesketch.org/', maintainer='Timesketch development team', maintainer_email='*****@*****.**', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Operating System :: OS Independent', 'Programming Language :: Python', ], data_files=[ ('share/timesketch', glob.glob(os.path.join('data', '*.*'))), ('share/timesketch/linux',