forked from p15670423/monkey
island: Decouple PBAFileDownload from environment_singleton
This commit is contained in:
parent
4190797ca2
commit
be0f7ac881
|
@ -155,7 +155,7 @@ def init_api_resources(api, data_dir):
|
||||||
api.add_resource(TelemetryFeed, "/api/telemetry-feed", "/api/telemetry-feed/")
|
api.add_resource(TelemetryFeed, "/api/telemetry-feed", "/api/telemetry-feed/")
|
||||||
api.add_resource(Log, "/api/log", "/api/log/")
|
api.add_resource(Log, "/api/log", "/api/log/")
|
||||||
api.add_resource(IslandLog, "/api/log/island/download", "/api/log/island/download/")
|
api.add_resource(IslandLog, "/api/log/island/download", "/api/log/island/download/")
|
||||||
api.add_resource(PBAFileDownload, "/api/pba/download/<string:path>")
|
api.add_resource(PBAFileDownload, "/api/pba/download/<string:filename>")
|
||||||
api.add_resource(T1216PBAFileDownload, T1216_PBA_FILE_DOWNLOAD_PATH)
|
api.add_resource(T1216PBAFileDownload, T1216_PBA_FILE_DOWNLOAD_PATH)
|
||||||
api.add_resource(
|
api.add_resource(
|
||||||
FileUpload,
|
FileUpload,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import flask_restful
|
import flask_restful
|
||||||
from flask import send_from_directory
|
from flask import send_from_directory
|
||||||
|
|
||||||
import monkey_island.cc.environment.environment_singleton as env_singleton
|
from monkey_island.cc.services.post_breach_files import PostBreachFilesService
|
||||||
|
|
||||||
__author__ = "VakarisZ"
|
__author__ = "VakarisZ"
|
||||||
|
|
||||||
|
@ -12,5 +12,6 @@ class PBAFileDownload(flask_restful.Resource):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Used by monkey. can't secure.
|
# Used by monkey. can't secure.
|
||||||
def get(self, path):
|
def get(self, filename):
|
||||||
return send_from_directory(env_singleton.env.get_config().data_dir_abs_path, path)
|
custom_pba_dir = PostBreachFilesService.get_custom_pba_directory()
|
||||||
|
return send_from_directory(custom_pba_dir, filename)
|
||||||
|
|
Loading…
Reference in New Issue