beaucronin / wg-exercise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wg-exercise

Install and Run

The server can be run locally, or as a Docker container. The API is documented in swagger.yaml.

Local

A python virtual environment is recommended.

pip install -r requirements.txt
./run_local.sh

To specify a target directory, export the ROOT_DIR environment variable:

export ROOT_DIR=/some/dir
./run_local.sh

Docker

Assuming Docker is properly configured and the service is running

docker build -t wg-exercise:latest .
docker run -d -p 5000:5000 wg-exercise:latest

To specify a target directory, use Docker's standard environment variable functionality to set the ROOT_DIR variable:

docker run -d -p 5000:5000 -e ROOT_DIR=/some/dir wg-exercise:latest

Usage

Once the server has been brought up using one of the above methods, you can find it at http://localhost:5000/.

Test

The tests can be run via ./run_tests.sh. They are incomplete, but should be expanded to include various other cases that ensure file size, ownership, and permissions are properly returned.

About


Languages

Language:Python 74.3%Language:Dockerfile 18.2%Language:Shell 7.4%