-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker-compose: updates for ipa-tuura + keycloak
Test containers and Makefiles to build test environment included. 1. Container src/Containerfile -- defines systemd container to build src/Makefile -- defines container build steps in make form src/install/ipa-tuura.env -- ipa-tuura service env file for container src/install/ipa-tuura.service -- ipa-tuura systemd service file for container 2. Docker Compose docker-compose.yml -- defines containerized test env Makefile -- defines test env setup steps in make form .env -- Variables for Makefile data/configs/dnsmasq.conf -- config for dns container data/configs/nm_zone_test.conf -- config for dns container env.containers -- env vars for containers. mostly used by keycloak src/install/setup_bridge.sh -- add SCIM plugin config to keycloak for ipa-tuura bridge 3. Networking Info for containers reset to original Signed-off-by: Scott Poore <[email protected]>
- Loading branch information
Showing
10 changed files
with
270 additions
and
20 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
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,55 @@ | ||
include .env | ||
|
||
up: datadir cert plugin | ||
docker-compose up --detach | ||
|
||
stop: | ||
docker-compose stop | ||
|
||
down: stop | ||
docker-compose down | ||
|
||
datadir: | ||
ifeq (,$(wildcard data/keycloak)) | ||
mkdir -p data/keycloak | ||
endif | ||
|
||
#cert: datadir ipaca | ||
cert: datadir | ||
ifeq (,$(wildcard data/keycloak/server.crt)) | ||
cd data/configs && \ | ||
openssl req -x509 -nodes -newkey rsa:4096 -keyout server.key \ | ||
-out server.crt -sha256 -days 365 -subj '/CN=master.keycloak.test' && \ | ||
mv server.* ../keycloak && \ | ||
cd ../keycloak && \ | ||
keytool -import -keystore server.keystore \ | ||
-file server.crt -alias truststore \ | ||
-trustcacerts -storepass Secret123 -noprompt && \ | ||
chown 1000 server.* | ||
endif | ||
|
||
ipaca: | ||
ifeq (,$(wildcard data/keycloak/ipaca.crt)) | ||
cd data/keycloak && \ | ||
curl -o ipaca.crt http://master.ipa.test/ipa/config/ca.crt && \ | ||
chown 1000 server.* | ||
endif | ||
|
||
container: | ||
$(MAKE) -C src | ||
|
||
plugin: datadir | ||
ifeq (,$(wildcard data/keycloak/$(PLUGIN_JAR))) | ||
cd data/keycloak && \ | ||
wget https://github.com/justin-stephenson/scim-keycloak-user-storage-spi/archive/refs/tags/$(PLUGIN_TAG).tar.gz && \ | ||
tar zxvf $(PLUGIN_TAG).tar.gz && \ | ||
pushd $(PLUGIN_DIR) && \ | ||
mvn clean package && \ | ||
mv target/$(PLUGIN_JAR) ../ | ||
endif | ||
|
||
bridge: | ||
bash -c "src/install/setup_bridge.sh" | ||
|
||
clean: | ||
rm -rf data/keycloak/* |
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
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,2 +1,11 @@ | ||
# Environment variables set in all started containers | ||
CONTAINER=yes | ||
KEYCLOAK_ADMIN=admin | ||
KEYCLOAK_ADMIN_PASSWORD=Secret123 | ||
KC_HOSTNAME=master.keycloak.test | ||
KC_HOSTNAME_PORT=8443 | ||
KC_HTTPS_CERTIFICATE_FILE=/opt/keycloak/conf/server.crt | ||
KC_HTTPS_CERTIFICATE_KEY_FILE=/opt/keycloak/conf/server.key | ||
KC_HTTPS_TRUST_STORE_FILE=/opt/keycloak/conf/server.keystore | ||
KC_HTTPS_TRUST_STORE_PASSWORD=Secret123 | ||
KC_HTTP_RELATIVE_PATH=/auth |
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,42 @@ | ||
FROM fedora:latest | ||
|
||
MAINTAINER Scott Poore <[email protected]> | ||
|
||
ENV DJANGO_SUPERUSER_PASSWORD: Secret123 \ | ||
DJANGO_SUPERUSER_USERNAME: scim \ | ||
DJANGO_SUPERUSER_EMAIL: [email protected] | ||
|
||
EXPOSE 8000 | ||
|
||
WORKDIR /ipa-tuura | ||
|
||
COPY ipa-tuura /ipa-tuura | ||
COPY install/ipa-tuura.service /etc/systemd/system/ipa-tuura.service | ||
COPY install/ipa-tuura.env /etc/sysconfig/ipa-tuura.env | ||
COPY install/requirements.txt /ipa-tuura/requirements.txt | ||
|
||
# Leaving behind workaround for running specific fork/branch: | ||
#RUN dnf -y install git | ||
#RUN git clone https://github.com/f-trivino/ipa-tuura.git -b domains /opt/ipa-tuura | ||
##RUN git clone https://github.com/Tiboris/ipa-tuura.git -b pr_check_workflow /opt/ipa-tuura | ||
#RUN ln -s /opt/ipa-tuura/src/ipa-tuura /ipa-tuura | ||
#RUN cp /opt/ipa-tuura/src/install/requirements.txt /ipa-tuura/requirements.txt | ||
|
||
# Need to install packages before linking service file so that the | ||
# proper filesystem structure is in place for systemd | ||
RUN dnf -y install sssd ipa-client realmd java-11-openjdk-headless \ | ||
openssl maven unzip python3-pip git python3-netifaces \ | ||
python3-devel krb5-devel gcc sssd-dbus wget openldap-clients \ | ||
sssd sssd-ldap oddjob-mkhomedir realmd \ | ||
--nodocs && \ | ||
dnf clean all -y && \ | ||
ln -s /etc/systemd/system/ipa-tuura.service \ | ||
/etc/systemd/system/multi-user.target.wants/ipa-tuura.service && \ | ||
ls -Fal /etc/systemd/system/multi-user.target.wants/* && \ | ||
pip install -r /ipa-tuura/requirements.txt && \ | ||
source /etc/sysconfig/ipa-tuura.env && \ | ||
python3 /ipa-tuura/manage.py makemigrations ipatuura && \ | ||
python3 /ipa-tuura/manage.py migrate && \ | ||
python3 /ipa-tuura/manage.py createsuperuser --scim_username scim --noinput | ||
|
||
CMD ["/usr/sbin/init"] |
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,18 @@ | ||
default: build | ||
|
||
build: | ||
podman build -t ipa-tuura/base . | ||
|
||
run: | ||
podman run --name bridge -d -p 8000:8000 ipa-tuura/base && \ | ||
podman start bridge | ||
|
||
start: | ||
podman start bridge | ||
|
||
exec: | ||
podman exec -it bridge bash | ||
|
||
clean: | ||
podman rm -f bridge && \ | ||
podman image rm ipa-tuura/base |
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,5 @@ | ||
DJANGO_SUPERUSER_USERNAME=scim | ||
DJANGO_SUPERUSER_PASSWORD=Secret123 | ||
DJANGO_SUPERUSER_EMAIL=[email protected] | ||
export DJANGO_SUPERUSER_USERNAME DJANGO_SUPERUSER_PASSWORD DJANGO_SUPERUSER_EMAIL | ||
|
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,17 @@ | ||
[Unit] | ||
Description=SCIMv2 Bridge Server | ||
After=network.target | ||
|
||
[Service] | ||
Type=idle | ||
WorkingDirectory=/ipa-tuura/ | ||
EnvironmentFile=/etc/sysconfig/ipa-tuura.env | ||
# Fix this later | ||
# User=scim | ||
# Group=scim | ||
ExecStart=/usr/bin/python3 /ipa-tuura/manage.py runserver 0.0.0.0:8000 | ||
TimeoutStartSec=600 | ||
TimeoutStopSec=600 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Oops, something went wrong.