From de7fd5e5814d3e25ebbc594c2f06498c7b372d29 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Fri, 21 Apr 2023 19:07:32 +0200 Subject: added Dockerfile (thanks @jwetzell) --- qc_decrypt/Dockerfile | 11 +++++++++++ qc_decrypt/Makefile | 2 +- qc_decrypt/README.md | 16 ++++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 qc_decrypt/Dockerfile diff --git a/qc_decrypt/Dockerfile b/qc_decrypt/Dockerfile new file mode 100644 index 0000000..b8daecc --- /dev/null +++ b/qc_decrypt/Dockerfile @@ -0,0 +1,11 @@ +FROM gcc:12.2 AS builder +COPY ./ /usr/src/myapp +WORKDIR /usr/src/myapp +RUN make + +FROM debian:11-slim +COPY --from=builder /usr/src/myapp/qc_decrypt /usr/bin/qc_decrypt +RUN mkdir /data +WORKDIR /data +ENTRYPOINT [ "/usr/bin/qc_decrypt" ] + diff --git a/qc_decrypt/Makefile b/qc_decrypt/Makefile index a0e82db..d446c7a 100644 --- a/qc_decrypt/Makefile +++ b/qc_decrypt/Makefile @@ -1,5 +1,5 @@ all: - @gcc -I/opt/homebrew/opt/openssl/include -L/opt/homebrew/opt/openssl/lib -lcrypto qc_decrypt.c -o qc_decrypt + @gcc -lcrypto qc_decrypt.c -o qc_decrypt clean: @rm -rf qc_decrypt \ No newline at end of file diff --git a/qc_decrypt/README.md b/qc_decrypt/README.md index b434975..e16b33e 100644 --- a/qc_decrypt/README.md +++ b/qc_decrypt/README.md @@ -1,9 +1,21 @@ NeuralDSP QuadCortex file decryptor. -Compile with `make` (requires gcc and openssl-dev installed), then pass the serial number found in `/etc/qc_sn` as command line argument: +Build the image: ```sh -./qc_decrypt QA00XXXXX /path/to/encrypted.json/cns/ldr/... > decrypted.dat +docker build . -t qc_decrypt +``` + +To decrypt user files (pass the serial number found in `/etc/qc_sn` as command line argument): + +```sh +docker run -v/path/to/your/files/:/data qc_decrypt QA00XXXXX /data/encrypted.json +``` + +To decrypt update files instead, provide an empty serial: + +```sh +docker run -v/path/to/your/files/:/data qc_decrypt "" /data/encrypted.json ``` ## License -- cgit v1.2.3