Skip to content

Commit

Permalink
fix some mistake in pre commit (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-ssd authored Jun 21, 2024
2 parents 5975624 + ebaccf3 commit 73105c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG BASE_IMAGE_TAG=3.8.18-slim-bookworm
FROM python:$BASE_IMAGE_TAG as builder
ENV VIRTUAL_ENV=/opt/privacyidea
WORKDIR $VIRTUAL_ENV
RUN apt-get update && apt-get install -y python3-dev gcc libpq-dev libkrb5-dev curl
RUN apt-get update && apt-get install -y python3-dev gcc libpq-dev libkrb5-dev
COPY requirements.txt requirements.txt
RUN python3 -m venv "$VIRTUAL_ENV" && . $VIRTUAL_ENV/bin/activate && pip3 install wheel && pip3 install -r requirements.txt

Expand All @@ -18,7 +18,7 @@ ENV PI_SKIP_BOOTSTRAP=false \

COPY prebuildfs /
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN install_packages ca-certificates gettext-base tini tree jq libpq5 && \
RUN install_packages ca-certificates gettext-base tini tree jq libpq5 realmd krb5-user curl && \
mkdir -p "$PI_DATA_DIR" "$PI_CFG_DIR" && \
chown -R nobody:nogroup "$PI_DATA_DIR" "$PI_CFG_DIR"
USER nobody
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ The Khalibre privacyIDEA container can create a default admin user by setting th
| `PI_DB_USER` | Database user | |
| `PI_DB_PASSWORD` | Database password | |
| `PI_DB_NAME` | Database name | |
| `PI_DB_HOST` | Database host | |
| `PI_DB_PORT` | Database port | depnds on PI_DB_VENDOR default for each type |
| `PI_DB_HOST` | Database host. For on postgres use it support multiple hosts with comma separated | |
| `PI_DB_PORT` | Database port. For on postgres use it support multiple hosts with comma separated | depnds on PI_DB_VENDOR default for each type |
| `PI_DB_ARGS` | Addiitional DB attributes | |
| `SQLALCHEMY_DATABASE_URI` | Full SQL connection strinng | |
| `SQLALCHEMY_DATABASE_URI` | Full SQL connection string. If set it will override all PI_DB_* settings | |
| `PI_CACHE_TYPE` | privacyIDEA cache type | simple |
| `PI_PEPPER` | This is used to encrypt the admin passwords | |
| `PI_AUDIT_NO_SIGN` | If you by any reason want to avoid signing audit entries set it true | false |
Expand Down
7 changes: 4 additions & 3 deletions rootfs/usr/local/bin/configure_privacyidea.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ function generate_pi_config {
echo "[ERROR] $var_name should be defined"
exit 1
else
# Remove single and double quotes
# Remove single, double quotes and spaces
var_value=${var_value//\'/}
var_value=${var_value//\"/}
var_value=${var_value// /}
eval "$var_name='$var_value'"
fi
}
Expand All @@ -71,10 +72,10 @@ function generate_pi_config {

# Define the SQLAlchemy database URI using the necessary variables
if [ -z "$PI_DB_ARGS" ]; then
export SQLALCHEMY_DATABASE_URI="${PI_DB_VENDOR}+psycopg2://${PI_DB_USER}:${encoded_password}@/${PI_DB_NAME}?host=${PI_DB_HOST// /}&port=${PI_DB_PORT:-5432}"
export SQLALCHEMY_DATABASE_URI="${PI_DB_VENDOR}+psycopg2://${PI_DB_USER}:${encoded_password}@/${PI_DB_NAME}?host=${PI_DB_HOST}&port=${PI_DB_PORT:-5432}"
else
check_and_clean_vars "PI_DB_ARGS"
export SQLALCHEMY_DATABASE_URI="${PI_DB_VENDOR}+psycopg2://${PI_DB_USER}:${encoded_password}@/${PI_DB_NAME}?host=${PI_DB_HOST// /}&port=${PI_DB_PORT:-5432}&${PI_DB_ARGS//,/&}"
export SQLALCHEMY_DATABASE_URI="${PI_DB_VENDOR}+psycopg2://${PI_DB_USER}:${encoded_password}@/${PI_DB_NAME}?host=${PI_DB_HOST}&port=${PI_DB_PORT:-${PI_DB_HOST//[!,]/}}&${PI_DB_ARGS//,/&}"
fi
;;

Expand Down

0 comments on commit 73105c1

Please sign in to comment.