Skip to content

Commit

Permalink
decrypt a folder
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-f committed Aug 29, 2023
1 parent 4f8715f commit 952bcd1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
13 changes: 12 additions & 1 deletion examples/json_to_audio.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import copy
import os.path

from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES
Expand Down Expand Up @@ -50,7 +53,15 @@ def main():
help="Path of the output ogg file",
default="audio.ogg", type=str)
args = parser.parse_args()
get_sf(args)
if os.path.isdir(args.document_gz):
documents = [filepath for filepath in os.listdir(args.document_gz) if filepath.endswith(".json.gz")]
for document in documents:
args_cp = copy.copy(args)
args_cp.document_gz = os.path.join(args.document_gz, document)
args_cp.ogg_file = os.path.join(args.document_gz, document[:document.rfind(".json.gz")]+".ogg")
get_sf(args_cp)
else:
get_sf(args)


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions services/ansible_openvpn/docker/dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ COPY . /dashboard

COPY flask_service.sh /etc/entrypoint.d/

RUN chmod +x /etc/entrypoint.d/flask_service.sh \
--mount=type=cache,target=/root/.cache/pip \
pip3 install -r requirements.txt
RUN chmod +x /etc/entrypoint.d/flask_service.sh

RUN --mount=type=cache,target=/root/.cache/pip \
pip3 install -r requirements.txt

10 changes: 10 additions & 0 deletions services/ansible_openvpn/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ services:
network_mode: "service:openvpn"
volumes:
- semaphore-data:/home/semaphore/data/:z
- dashboard_pubkeys:/home/semaphore/authorized_keys:z
depends_on:
- mysql # for postgres, change to: postgres
- openvpn
Expand Down Expand Up @@ -178,10 +179,19 @@ services:
build:
context: dashboard
target: builder
environment:
- SSH_USERS=dashboard:1001:1001
ports:
- '8000:8000'
volumes:
- dashboard_keys:/etc/ssh/keys
- dashboard_pubkeys:/etc/authorized_keys/dashboard
volumes:
semaphore-mysql:
dashboard_keys:
driver: local
dashboard_pubkeys:
driver: local
semaphore-data: # storage of raw sensor data
certs:
driver: local
Expand Down
3 changes: 3 additions & 0 deletions services/ansible_openvpn/playbooks/fetch_and_process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- ansible.builtin.debug:
msg: Fetch and process

- name: Sync RPI inventory
ansible.builtin.import_playbook: fetch_openvpn_hosts.yml

- name: Fetch RPI data using rsync
ansible.builtin.import_playbook: fetch_rpi_data.yml

Expand Down

0 comments on commit 952bcd1

Please sign in to comment.