Skip to content

Commit

Permalink
fix: do not only lockup the default upload_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoFgrx committed Jul 5, 2024
1 parent 18471ca commit d310da7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import base64

from flask import request
from flask import request, current_app
from flask_restx import Namespace, Resource, abort
from sqlalchemy import text

Expand Down Expand Up @@ -488,7 +488,7 @@ def post():

# get base64 file located at full_scenario_location and send it to Chall-Manager
# ex: b07afae94edec5d8a74c8d7b590feb63/deploy.zip
full_scenario_location = os.path.join(os.getcwd(), "CTFd", "uploads", scenario.location)
full_scenario_location = os.path.join(current_app.config.get("UPLOAD_FOLDER"), scenario.location)
try:
with open(full_scenario_location, "rb") as f:
# TODO add hash checksum
Expand Down Expand Up @@ -603,7 +603,7 @@ def patch():

print("new_scenario = ", new_scenario)

full_scenario_location = os.path.join(os.getcwd(), "CTFd", "uploads", new_scenario.location)
full_scenario_location = os.path.join(current_app.config.get("UPLOAD_FOLDER"), scenario.location)
try:
with open(full_scenario_location, "rb") as f:
# TODO add hash checksum
Expand Down

0 comments on commit d310da7

Please sign in to comment.