Compare commits

..

No commits in common. "e1e8c67e5f7559fe1b7626b735fd9f2799c32030" and "66b2faac7c74c2a837c470ae7e8709b0ba39b721" have entirely different histories.

5 changed files with 3 additions and 19 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
keys/*
venv/*

View File

@ -6,9 +6,7 @@ COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update -y && apt-get upgrade -y RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y rsync ssh RUN apt-get install -y rsync
# TODO: Need to install ssh key here
COPY . ./ COPY . ./

View File

@ -24,12 +24,7 @@ def requestsync():
try: try:
# Run rsync # Run rsync
print("Sync requested... running now.") print("Sync requested... running now.")
subprocess.run(['rsync', subprocess.run(['rsync', '-ravzL', REMOTE_DIRECTORY, LOCAL_DEST], check=True)
'-ravzL',
'-e',
'ssh -i /root/.ssh/id_rsa',
REMOTE_DIRECTORY,
LOCAL_DEST], check=True)
return jsonify({'status': 'OK'}) return jsonify({'status': 'OK'})
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
return jsonify({"error": 'rsync failed', 'details': str(e)}), 500 return jsonify({"error": 'rsync failed', 'details': str(e)}), 500

View File

@ -6,6 +6,7 @@ services:
- "35350:35350" - "35350:35350"
volumes: volumes:
- /serve/data/basket:/serve/data/basket - /serve/data/basket:/serve/data/basket
- $HOME/.ssh:/root/.ssh
environment: environment:
- UID=${UID:-1000} - UID=${UID:-1000}
- GID=1000 - GID=1000

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -u -e -o pipefail
mkdir -p keys
ssh-keygen -f keys/id_rsa -t rsa
ssh-copy-id -i keys/id_rsa sinbad@margarita