diff --git a/backend/Dockerfile b/backend/Dockerfile index b06cd7d..8eb7a25 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -4,9 +4,6 @@ WORKDIR /app COPY requirements.txt . -RUN apt-get -y update -RUN apt-get -y install sqlite3 - RUN pip install -r requirements.txt COPY /src . diff --git a/backend/Dockerfile.prod b/backend/Dockerfile.prod index 61f536d..1bd4a72 100644 --- a/backend/Dockerfile.prod +++ b/backend/Dockerfile.prod @@ -6,8 +6,6 @@ RUN apt-get -y update && apt-get -y upgrade COPY requirements.txt . -RUN apt-get -y install sqlite3 - RUN pip install -r requirements.txt COPY /src . diff --git a/backend/requirements.txt b/backend/requirements.txt index 3458910..75a45e2 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,4 +1,3 @@ -autopep8==1.5.7 blinker==1.4 click==7.1.2 Deprecated==1.2.12 @@ -17,13 +16,11 @@ MarkupSafe==1.1.1 passlib==1.7.4 pendulum==2.1.2 py-buzz==1.0.3 -pycodestyle==2.7.0 PyJWT==2.1.0 python-dateutil==2.8.1 python-dotenv==0.17.1 pytzdata==2020.1 six==1.16.0 SQLAlchemy==1.4.15 -toml==0.10.2 Werkzeug==1.0.1 wrapt==1.12.1 diff --git a/backend/src/app.py b/backend/src/app.py index 470e4cf..8f49861 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -113,7 +113,7 @@ def refresh(): $ curl http://localhost:5000/api/refresh -X GET \ -H "Authorization: Bearer " """ - old_token = flask.request.get_data() + old_token = request.get_data() new_token = guard.refresh_jwt_token(old_token) ret = {'access_token': new_token} return ret, 200 @@ -141,10 +141,10 @@ def protected(): return {'message': f'protected endpoint (allowed user {flask_praetorian.current_user().username})'} -@app.route('/api/rcv_pw', methods=['GET']) +@app.route('/api/protected/rcv_pw', methods=['GET']) def get_password(): pw = get_random_password() - ret = {'random_password': pw} + ret = {'password': pw} return ret, 200 diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 9c7cbf9..10c3e2d 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -8,8 +8,6 @@ services: backend-prod: image: caminsha/bt-backend container_name: backend-prod - volumes: - - "./database.db:/app/database.db:z" environment: DEBUG: "no" PORT: 5050 @@ -22,6 +20,6 @@ services: environment: - MONGO_URI=mongodb://mongodb:27017/behametrics mongodb: - image: mongo:4.0.25 + image: mongo:4.0.1 container_name: "behametrics-mongo" command: mongod --smallfiles diff --git a/docker-compose.yml b/docker-compose.yml index deac250..46dafc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,6 @@ services: environment: - MONGO_URI=mongodb://mongodb:27017/behametrics mongodb: - image: mongo:4.0.25 + image: mongo:4.0.1 container_name: "behametrics-mongo" command: mongod --smallfiles diff --git a/frontend/public/index.html b/frontend/public/index.html index 8be889f..fa21ab4 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -31,10 +31,7 @@ BA - Marco Camenzind - +