Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
mo9a7i committed Jun 10, 2023
1 parent 911d325 commit e1f008f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
File renamed without changes.
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
- <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 licenses, no nothing, just copy and paste all you want

0 comments on commit e1f008f

Please sign in to comment.