This repository has been archived by the owner on Mar 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ireceptorplus-inesctec/master
Final changes to repo
- Loading branch information
Showing
7 changed files
with
151 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DB_DATABASE=keycloak | ||
DB_USER=keycloak | ||
DB_PASSWORD=password | ||
DB_HOST=localhost | ||
DB_PORT=5433 | ||
DB_POOL_SIZE=20 | ||
KEYCLOAK_URL=http://localhost:8080/auth | ||
REALM=master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
FROM ubuntu:20.04 | ||
FROM python:3.9-alpine3.15 | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y build-essential python3-pip python3-dev | ||
COPY requirements.txt /tmp/requirements.txt | ||
|
||
WORKDIR /app | ||
|
||
COPY ./requirements.txt ./requirements.txt | ||
RUN apk add --no-cache --virtual .build-deps gcc libc-dev \ | ||
&& pip install --no-cache-dir -r /tmp/requirements.txt \ | ||
&& apk del .build-deps gcc libc-dev | ||
|
||
RUN pip3 install -r requirements.txt | ||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
EXPOSE 5000 | ||
|
||
ENTRYPOINT [ "gunicorn" ] | ||
|
||
CMD [ "--workers=4", "--bind=0.0.0.0:8000", "api:app" ] | ||
CMD [ "--workers=4", "--bind=0.0.0.0:5000", "api:app" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Keycloak Extension API | ||
|
||
Service that extends the features of Keycloak by providing additional endpoints. The service connects directly to Keycloak's database. | ||
|
||
Docker image available at: https://hub.docker.com/r/irpinesctec/keycloak_extension_api | ||
|
||
### Requirements | ||
|
||
- Python 3 | ||
- Keycloak running based on a PostreSQL database | ||
- Check `requirements.txt` for additional package requirements. Can be installed through PIP or Conda. | ||
|
||
### Running | ||
|
||
#### Natively | ||
|
||
1. Copy the `.env.example`and rename it to `.env`. | ||
Open the file and edit it to match your environment. | ||
|
||
2. Install requirements using your Python package manager of choice. With PIP: | ||
`pip install -r requirements.txt` | ||
|
||
3. `python3 api.py` | ||
|
||
#### Docker | ||
1. Copy the `db_connection.env.example`and rename it to `db_connection.env`. | ||
Open the file and edit it to match your environment. | ||
|
||
2. Edit the `docker-compose.yml` to match your requirements` | ||
|
||
3. `docker-compose up` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,5 @@ | ||
astroid==2.4.2 | ||
certifi==2020.4.5.1 | ||
chardet==3.0.4 | ||
click==7.1.2 | ||
Flask==1.1.2 | ||
gunicorn==20.0.4 | ||
idna==2.9 | ||
isort==4.3.21 | ||
itsdangerous==1.1.0 | ||
Jinja2==2.11.2 | ||
jsonify==0.5 | ||
lazy-object-proxy==1.4.3 | ||
MarkupSafe==1.1.1 | ||
mccabe==0.6.1 | ||
psycopg2-binary==2.8.5 | ||
pylint==2.5.3 | ||
python-dotenv==0.14.0 | ||
requests==2.23.0 | ||
six==1.15.0 | ||
toml==0.10.1 | ||
urllib3==1.25.9 | ||
Werkzeug==1.0.1 | ||
wrapt==1.12.1 | ||
requests==2.27.1 | ||
Flask==2.0.3 | ||
psycopg2-binary==2.9.3 | ||
python-dotenv==0.19.2 | ||
gunicorn==20.1.0 |