-
Notifications
You must be signed in to change notification settings - Fork 16
DM-11547: dockerize apache https proxy. #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ [email protected]@ | |
[email protected]@ | ||
|
||
[email protected]@ | ||
[email protected]@ | ||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM birgerk/apache-letsencrypt | ||
|
||
RUN apt-get update && \ | ||
apt-get -f --assume-yes install libapache2-mod-auth-openidc && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY ./others/*.conf /etc/apache2/conf-enabled/ | ||
|
||
RUN a2enmod proxy; \ | ||
a2enmod proxy_http; \ | ||
a2enmod proxy_wstunnel; \ | ||
a2enmod auth_openidc | ||
|
||
RUN mkdir /etc/apache2/certs; \ | ||
openssl req \ | ||
-new \ | ||
-newkey rsa:4096 \ | ||
-days 365 \ | ||
-nodes \ | ||
-x509 \ | ||
-subj "/C=US/ST=CA/L=dev/O=dev/CN=localhost" \ | ||
-keyout /etc/apache2/certs/localhost.key \ | ||
-out /etc/apache2/certs/localhost.cert | ||
|
||
|
||
EXPOSE 80 443 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
dockerImage { | ||
|
||
docker_repo = "ipac/proxy-dev" | ||
docker_registry = '' | ||
docker_tag = 'latest' | ||
copy_res = false | ||
|
||
doFirst { | ||
// copy artifacts to staging directory | ||
copy { | ||
from (projectDir) include '**/*' | ||
into "${buildDir}/docker" | ||
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: project.appConfigProps) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
OIDCProviderMetadataURL https://test.cilogon.org/.well-known/openid-configuration | ||
OIDCClientID @oidc_client_id@ | ||
OIDCClientSecret @oidc_client_secret@ | ||
|
||
OIDCRedirectURI @oidc_redirect_uri@ | ||
OIDCCryptoPassphrase pass357code | ||
|
||
OIDCScope "openid profile email org.cilogon.userinfo edu.uiuc.ncsa.myproxy.getcert" | ||
OIDCAuthNHeader X-Forwarded-User | ||
|
||
<Location /suit/> | ||
AuthType openid-connect | ||
Require claim "isMemberOf~.cn=lsst_users|cn=lsst_pdac" | ||
</Location> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Load these modules if not already loaded | ||
<IfModule !proxy_module> | ||
LoadModule proxy_module modules/mod_proxy.so | ||
</IfModule> | ||
<IfModule !proxy_http_module> | ||
LoadModule proxy_http_module modules/mod_proxy_http.so | ||
</IfModule> | ||
<IfModule !proxy_wstunnel_module> | ||
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so | ||
</IfModule> | ||
<IfModule !rewrite_module> | ||
LoadModule rewrite_module modules/mod_rewrite.so | ||
</IfModule> | ||
|
||
|
||
ProxyRequests Off | ||
ProxyPreserveHost On | ||
ProxyStatus On | ||
|
||
|
||
## Hydra app for firefly | ||
ProxyPass /firefly/sticky/firefly/events ws://${docker_host}:8080/firefly/sticky/firefly/events | ||
ProxyPass /firefly http://${docker_host}:8080/firefly | ||
ProxyPassReverse /firefly http://${docker_host}:8080/firefly | ||
|
||
## Hydra app for suit | ||
ProxyPass /suit/sticky/firefly/events ws://${docker_host}:8080/suit/sticky/firefly/events | ||
ProxyPass /suit http://${docker_host}:8080/suit | ||
ProxyPassReverse /suit http://${docker_host}:8080/suit | ||
|
||
|
||
## end proxy config for Hydra support | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<VirtualHost *:80> | ||
ServerName localhost | ||
|
||
</VirtualHost> | ||
|
||
<VirtualHost *:443> | ||
ServerName localhost | ||
|
||
SSLEngine on | ||
|
||
SSLCertificateFile /etc/apache2/certs/localhost.cert | ||
SSLCertificateKeyFile /etc/apache2/certs/localhost.key | ||
|
||
RequestHeader set X-Forwarded-Proto "https" | ||
RequestHeader set X-Forwarded-Port "443" | ||
<FilesMatch "\.(cgi|shtml|phtml|php)$"> | ||
SSLOptions +StdEnvVars | ||
</FilesMatch> | ||
|
||
</VirtualHost> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
case "$1" in | ||
start) | ||
docker start proxy-dev | ||
;; | ||
stop) | ||
docker stop proxy-dev | ||
;; | ||
shell) | ||
docker exec -it proxy-dev /bin/bash | ||
;; | ||
clean) | ||
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | ||
;; | ||
update) | ||
cd /hydra/cm/firefly | ||
gradle proxyDev:dockerImage | ||
docker stop proxy-dev | ||
docker container rm proxy-dev | ||
|
||
docker run -d \ | ||
-p 80:80 \ | ||
-p 443:443 \ | ||
-e "docker_host=`ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' | tail -1`" \ | ||
--name proxy-dev ipac/proxy-dev | ||
|
||
# -e "DOMAINS=`hostname`" \ | ||
# -e "[email protected]" \ | ||
# -e "STAGING=proxy" \ | ||
|
||
;; | ||
*) | ||
echo $"Usage: proxyctl.sh [start|stop|shell|clean|update]" | ||
exit | ||
esac | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM birgerk/apache-letsencrypt | ||
|
||
|
||
#RUN apt-get update && \ | ||
# apt-get -f stretch install libapache2-mod-auth-openidc && \ | ||
# rm -rf /var/lib/apt/lists/* | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should install the tools you need as part of the build. I don't think it will make much difference in the build time or the overall size |
||
#RUN ln -s /usr/lib/apache2/modules/mod_auth_openidc.so modules/mod_auth_openidc.so | ||
COPY ./others/*.conf /etc/apache2/conf-enabled/ | ||
|
||
RUN a2enmod proxy; \ | ||
a2enmod proxy_http; \ | ||
a2enmod proxy_wstunnel | ||
|
||
EXPOSE 80 443 | ||
|
||
ENTRYPOINT ["httpd-foreground"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. proxy should take parameters to to set which the backend it running so that it is not required to be on 8080. They way we can start two proxy instances in front of two firelfy servers. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
dockerImage { | ||
|
||
docker_repo = "ipac/proxy" | ||
docker_registry = '' | ||
docker_tag = 'latest' | ||
copy_res = false | ||
|
||
doFirst { | ||
// copy artifacts to staging directory | ||
copy { | ||
from (projectDir) include '**/*' | ||
into "${buildDir}/docker" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Load these modules if not already loaded | ||
<IfModule !proxy_module> | ||
LoadModule proxy_module modules/mod_proxy.so | ||
</IfModule> | ||
<IfModule !proxy_http_module> | ||
LoadModule proxy_http_module modules/mod_proxy_http.so | ||
</IfModule> | ||
<IfModule !proxy_wstunnel_module> | ||
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so | ||
</IfModule> | ||
<IfModule !rewrite_module> | ||
LoadModule rewrite_module modules/mod_rewrite.so | ||
</IfModule> | ||
|
||
|
||
ProxyRequests Off | ||
ProxyPreserveHost On | ||
ProxyStatus On | ||
|
||
|
||
## Hydra app for firefly | ||
ProxyPass /firefly/sticky/firefly/events ws://firefly:8080/firefly/sticky/firefly/events | ||
ProxyPass /firefly http://firefly:8080/firefly | ||
ProxyPassReverse /firefly http://firefly:8080/firefly | ||
|
||
## Hydra app for suit | ||
ProxyPass /suit/sticky/firefly/events ws://firefly:8080/suit/sticky/firefly/events | ||
ProxyPass /suit http://firefly:8080/suit | ||
ProxyPassReverse /suit http://firefly:8080/suit | ||
|
||
|
||
## end proxy config for Hydra support | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
case "$1" in | ||
start) | ||
docker start proxy | ||
;; | ||
stop) | ||
docker stop proxy | ||
;; | ||
shell) | ||
docker exec -it proxy /bin/bash | ||
;; | ||
update) | ||
docker stop proxy | ||
docker container rm proxy | ||
|
||
docker pull ipac/proxy | ||
docker run -d \ | ||
-p 80:80 \ | ||
-p 443:443 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it you has more parameters to the docker containers the this file will have to deal with them |
||
-e "DOMAINS=`hostname`" \ | ||
-e "[email protected]" \ | ||
--network=local_nw \ | ||
--restart=unless-stopped \ | ||
--name proxy ipac/proxy | ||
|
||
# -e "DOMAINS=`hostname`" \ | ||
# -e "STAGING=proxy" \ | ||
;; | ||
*) | ||
echo $"Usage: proxyctl.sh [start|stop|shell|update]" | ||
exit | ||
esac | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't have /hydra/cm/firefly. I think you should use the following>