Skip to content
Snippets Groups Projects
Verified Commit 090713be authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Migrace na louketo-proxy

parent e0ebd23e
No related branches found
No related tags found
No related merge requests found
Pipeline #1240 passed
FROM alpine:3.11 FROM alpine:3.12.0
ENV NAME keycloak-gatekeeper ENV NAME louketo-proxy
ENV KEYCLOAK_VERSION 10.0.1 ENV LOUKETO_PROXY_VERSION 1.0.0
ENV GOOS linux ENV GOOS linux
ENV GOARCH amd64 ENV GOARCH amd64
LABEL Name=keycloak-gatekeeper \ LABEL Name=louketo-proxy \
Release=https://github.com/keycloak/keycloak-gatekeeper \ Release=https://github.com/louketo/louketo-proxy/releases \
Url=https://github.com/keycloak/keycloak-gatekeeper \ Url=https://github.com/louketo/louketo-proxy \
Help=https://issues.jboss.org/projects/KEYCLOAK \ Help=https://github.com/louketo/louketo-proxy/blob/master/docs/user-guide.md
maintainer="andrej.ramaseuski@pirati.cz"
RUN adduser -D -u 1000 gatekeeper && \ RUN adduser -h /opt/louketo -D -u 1000 louketo
mkdir /etc/gatekeeper && \
chown gatekeeper /etc/gatekeeper
RUN apk add --no-cache ca-certificates curl tar openssl RUN apk add --no-cache libc6-compat ca-certificates su-exec openssl curl tar
WORKDIR "/opt" WORKDIR "/opt/louketo"
RUN curl -fssL "https://downloads.jboss.org/keycloak/$KEYCLOAK_VERSION/gatekeeper/$NAME-$GOOS-$GOARCH.tar.gz" | tar -xz && chmod +x /opt/gatekeeper/$NAME RUN curl -fssL "https://github.com/louketo/louketo-proxy/releases/download/$LOUKETO_PROXY_VERSION/${NAME}_${LOUKETO_PROXY_VERSION}_${GOOS}_${GOARCH}.tar.gz" | tar -xz --strip-components=1
COPY entrypoint.sh entrypoint.sh COPY entrypoint.sh /
RUN chown -R louketo:louketo /opt/louketo
RUN mkdir /etc/louketo;chown -R louketo:louketo /etc/louketo
USER 1000 USER 1000
EXPOSE 3000 EXPOSE 3000
ENTRYPOINT [ "/opt/entrypoint.sh" ] ENTRYPOINT ["/entrypoint.sh"]
CMD ["/opt/keycloak-gatekeeper"] CMD ["/opt/louketo/louketo-proxy"]
#!/bin/sh #!/bin/sh
# Entrypoint for Docker Container # Entrypoint for Docker Container
export PROXY_CONFIG_FILE=${CONFIG:-'/etc/gatekeeper/gatekeeper.conf'} export PROXY_CONFIG_FILE=${CONFIG:-'/etc/louketo/louketo.conf'}
CLIENT_ID=${CLIENT_ID} CLIENT_ID=${CLIENT_ID}
CLIENT_SECRET=${CLIENT_SECRET} CLIENT_SECRET=${CLIENT_SECRET}
...@@ -15,12 +15,13 @@ LISTEN=${LISTEN:-':3000'} ...@@ -15,12 +15,13 @@ LISTEN=${LISTEN:-':3000'}
CERTIFICATE_SUBJ=${CERTIFICATE_SUBJ:-'/C=CZ/ST=CZ/L=Praha/O=Pirati/OU=TO/CN=gatekeeper'} CERTIFICATE_SUBJ=${CERTIFICATE_SUBJ:-'/C=CZ/ST=CZ/L=Praha/O=Pirati/OU=TO/CN=gatekeeper'}
if [ -s /etc/gatekeeper/ssl.crt ] || [ -s /etc/gatekeeper/cert.pem ] || [ -s /etc/gatekeeper/key.pem ] || [ -n "${SKIP_SSL_GENERATE}" ]; then
if [ -s /etc/louketo/ssl.crt ] || [ -s /etc/louketo/cert.pem ] || [ -s /etc/louketo/key.pem ] || [ -n "${SKIP_SSL_GENERATE}" ]; then
echo "Skipping SSL certificate generation" echo "Skipping SSL certificate generation"
else else
echo "Generating self-signed certificate" echo "Generating self-signed certificate"
cd /etc/gatekeeper cd /etc/louketo
# Generating signing SSL private key # Generating signing SSL private key
openssl genrsa -des3 -passout pass:xxxx -out key.pem 2048 openssl genrsa -des3 -passout pass:xxxx -out key.pem 2048
...@@ -33,20 +34,20 @@ else ...@@ -33,20 +34,20 @@ else
openssl x509 -req -days 3650 -in cert.csr -signkey key.pem -out cert.pem openssl x509 -req -days 3650 -in cert.csr -signkey key.pem -out cert.pem
fi fi
echo "# GATEKEEPER CONFIG echo "# GATEKEEPER CONFIG
client-id: ${CLIENT_ID} client-id: ${CLIENT_ID}
client-secret: ${CLIENT_SECRET} client-secret: ${CLIENT_SECRET}
discovery-url: ${DISCOVERY_URL} discovery-url: ${DISCOVERY_URL}
redirection-url: ${REDIRECTION_URL} redirection-url: ${REDIRECTION_URL}
encryption-key: ${ENCRYPTION_KEY} encryption-key: ${ENCRYPTION_KEY}
listen: ${LISTEN} listen: ${LISTEN}
upstream-url: ${UPSTREAM_URL} upstream-url: ${UPSTREAM_URL}
tls-cert: /etc/gatekeeper/cert.pem tls-cert: /etc/louketo/cert.pem
tls-private-key: /etc/gatekeeper/key.pem tls-private-key: /etc/louketo/key.pem
${CUSTOM_CONFIG} ${CUSTOM_CONFIG}
resources: resources:
${RESOURCES} ${RESOURCES}
" > /etc/gatekeeper/gatekeeper.conf " > /etc/louketo/louketo.conf
exec "$@" exec "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment