mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
Added disk decryption endpoint
This commit is contained in:
parent
d7a6b3ca12
commit
c4ab0a9f7f
7
main.py
7
main.py
|
@ -70,5 +70,12 @@ def getServiceStatus():
|
|||
smtp=smtpService.returncode,
|
||||
http=httpService.returncode
|
||||
)
|
||||
@app.route("/decryptDisk", methods=["POST"])
|
||||
def requestDiskDecryption():
|
||||
decryptionService = subprocess.Popen(["echo", "-n", request.headers['X-Decryption-Key'], "|", "cryptsetup", "luksOpen", "/dev/sdb", "decryptedVar"], stdout=subprocess.PIPE, shell=False)
|
||||
decryptionService.communicate()[0]
|
||||
return jsonify(
|
||||
status=decryptionService.returncode
|
||||
)
|
||||
if __name__ == '__main__':
|
||||
app.run(port=5050, debug=False)
|
||||
|
|
Loading…
Reference in a new issue