From e1f008fcc14a81c623719cacf7e8e94f12bbb1ef Mon Sep 17 00:00:00 2001 From: Mohannad Otaibi Date: Sat, 10 Jun 2023 04:50:31 +0300 Subject: [PATCH] .. --- docker_env_file.example => .env.example | 0 README.md | 31 +++++++++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) rename docker_env_file.example => .env.example (100%) diff --git a/docker_env_file.example b/.env.example similarity index 100% rename from docker_env_file.example rename to .env.example diff --git a/README.md b/README.md index d3d6e47..0e9204c 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,29 @@ # py_dockerized_scrypt_hasher - Docker version to expose a Python (Flask) API endpoint that hashes to scrypt (firebase) - -```bash -docker pull ghcr.io/6degrees/py_dockerized_scrypt_hasher_service:latest -``` +Docker version to expose a Python (Flask) API endpoint that hashes to scrypt (firebase) ## Setup -1. First, you need some configuration variables from your firebase project, you can get them from firebase->authentication-> little three dots top right of users table - -2. create an `docker_env_file` file in the project root directory, next to Dockerfile with the below content. (You can rename the `docker_env_file.example` and use it) +1. Get config variables from your firestore project + 1. firebase->authentication-> little three dots top right of users table +2. Create an `.env` file with the below content - ```bash + ```bash base64_signer_key=__get_from_your_firebase_project__ base64_salt_separator=__get_from_your_firebase_project__ rounds=__get_from_your_firebase_project__ mem_cost=__get_from_your_firebase_project__ ``` -3. Next, run the below commands in the project folder (next to Dockerfile) +3. Pull the image + `docker pull ghcr.io/6degrees/docker_py_scrypt_hasher:latest` +4. Run ```bash - git clone this repo - cd firebasescrypt - docker build -t firebasescrypt - docker run -p 5959 --env-file ./docker_env_file firebasescrypt + docker run -d -p 5959 --name docker_py_scrypt_hasher ghcr.io/6degrees/docker_py_scrypt_hasher:latest ``` -Now you have a flask endpoint running at your machine at `http://127.0.0.1:5959` (unless you changed the port or put on a server) +Now you have a flask endpoint running at your machine at `http://127.0.0.1:5959` (unless you changed the port) ## Usage @@ -38,9 +33,9 @@ Example: ## Credits -- https://stackoverflow.com/questions/12315398/check-if-a-string-is-encoded-in-base64-using-python -- https://github.com/JaakkoL/firebase-scrypt-python +- +- ## Licenses -No licenses, no nothing, just copy and paste all you want \ No newline at end of file +No licenses, no nothing, just copy and paste all you want