Backup and synchronize your data with Py-BackApp
Note
Project was tested on python 3.12.7
Project uses only built-in python libraries, so the only requirement is Python
git clone https://github.com/Atomowyy/py-backapp && cd py-backapp
Note
Change directory to client
Run with no arguments or with -i
flag to start interactive mode
python backapp.py
python backapp.py -i
python backapp.py -h
usage: backapp.py [-h] [-i] [--username USERNAME] [--server SERVER] [--port PORT] [-g] [-v] [--local LOCAL]
[--remote REMOTE] [-l] [-r] [-R] [-u] [-d] [-s] [-S]
This is the client side of py-backapp, backup and synchronize your files with the server.If no argument is
specified the program starts in interactive mode
options:
-h, --help show this help message and exit
-i, --interactive start py-backapp in interactive mode
--username USERNAME set username in config.json
--server SERVER set server in config.json
--port PORT set port in config.json
-g, --gettoken authorize user on the server and get a token
-v, --verifytoken verify if current token is valid
--local LOCAL path to local resource
--remote REMOTE path to remote resource
-l, --list list contents of remote dir
-r, --remove remove remote resources
-R, --removeall remove all users' remote resources
-u, --upload upload local resources to the server
-d, --download download remote resources from the server
-s, --syncfile compare local and remote file and get the newer one
-S, --syncdir synchronize local directory with the remote one
source code: https://github.com/Atomowyy/py-backapp
Note
Change directory to server
python server.py
Note
Change directory to server
Users are stored in users_db.json
python users_db_add_user.py
Generate a 2048-bit RSA private key:
openssl genrsa -out ./server/certificates/py-backapp-server.key 2048
Generate a certificate signing request:
openssl req -new -key ./server/certificates/py-backapp-server.key -out ./certificates/py-backapp-server.csr
Generate self-signed certificate, valid for 365 days:
openssl x509 -req -days 365 -in ./server/certificates/py-backapp-server.csr -signkey ./certificates/py-backapp-server.key -out ./certificates/py-backapp-server.crt
Verify certificate and key:
openssl x509 -in ./server/certificates/py-backapp-server.crt -noout -text
openssl rsa -in ./server/certificates/py-backapp-server.key -noout -text
Modify ceritficates in server.py
or set the env variables
# FIXME: use your certificates, default certificates are for development purposes only and shouldn't be used
CERTFILE = os.getenv('CERTFILE', 'certificates/py-backapp-server.crt')
KEYFILE = os.getenv('KEYFILE', 'certificates/py-backapp-server.key')
export CERTFILE=certificates/py-backapp-server.crt
export KEYFILE=certificates/py-backapp-server.key
docker image build -f ./server/server.Dockerfile -t py-backapp:test .
docker container run -p 1234:1234 py-backapp:test
docker container run -it -p 1234:1234 py-backapp:test /bin/bash
docker-compose -f docker-compose.yml up