Skip to content

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

Merged
merged 2 commits into from
Sep 11, 2017
Merged

Conversation

loitly
Copy link
Contributor

@loitly loitly commented Sep 6, 2017

  • use letsencrypt for public site, and self-signed for development
  • add support for authentication via mod_auth_openidc
  • expand build script to exposes configurable global variables to javascript

self-signed https proxy locally.
cd ./firefly; docker/proxy-dev/proxyctl.sh update
this will create and run the apache proxy in docker. access it on port 80 or 443. i.e. http://localhost/

javascript global variables
to make any configuration property a javascript global variable, append '__$' to it. i.e. __$help.base.url

- use letsencrypt for public site, and self-signed for development
- add support for authentication via mod_auth_openidc
- expand build script to exposes configurable global variables to javascript
Copy link
Contributor

@tgoldina tgoldina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the failure to start up apache with the default (empty) value of oidc_redirect_uri property, the proxy container works as described with self-signed certificate.

Error on apache2ctl start: configuration value '@oidc_redirect_uri@' could not be parsed as a URL (no scheme set) The workaround is to set a dummy but valid URL as a value of this property in ~/.gradle/build.config Thank you to Loi for walking me through the debugging process.

I guess that getting the valid certificate with letsencrypt will be tested on lsst-dev.

@robyww
Copy link
Contributor

robyww commented Sep 7, 2017

Loi and I discussed better ways to do global inserted variables. It would work by building a global objects that includes such things as MODULE_NAME, SCRIPT_NAME, help.base.url and build one object and insert only that as global with webpack. We think this would work. I created a separate ticket DM-11856.

Copy link
Contributor

@robyww robyww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't make it work. Maybe my environment is just different enough to be causing problems. Beside the comments below I would also like to start apache on another port such a 81 instead of 80 and 543 instead of 443.

#RUN apt-get update && \
# apt-get -f stretch install libapache2-mod-auth-openidc && \
# rm -rf /var/lib/apt/lists/*

Copy link
Contributor

Choose a reason for hiding this comment

The 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


EXPOSE 80 443

ENTRYPOINT ["httpd-foreground"]
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

docker pull ipac/proxy
docker run -d \
-p 80:80 \
-p 443:443 \
Copy link
Contributor

Choose a reason for hiding this comment

The 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

;;
update)
cd /hydra/cm/firefly
gradle proxyDev:dockerImage
Copy link
Contributor

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>

DIR=$(dirname "${0}")
cd $DIR/../../../firefly

- update proxyctl script to take additional parameters
- added wget and telnet into image for debugging use
- fixed properties without defualts which prevented apache from starting up
- fixed static link to cm/firefly path
@loitly
Copy link
Contributor Author

loitly commented Sep 8, 2017

I've just pushed a commit that address all of the issues identified in your review. Please take a quick look and see if it addresses your concerns.
You should be able to start one up out-of-the-box even if you do not have missing properties identified by tatiana.
Thanks.

./docker/proxy-dev/proxyctl.sh

Usage: proxyctl.sh [start|stop|shell|clean|update]
  optional parameters for update only:
    -http|--http_port <number>
    -https|--https_port <number>
    -host|--docker_host <x.x.x.x>  : ip address of the host running firefly
    -firefly|--firefly_port <number>

@loitly loitly merged commit d14402a into dev Sep 11, 2017
@robyww robyww deleted the DM-11547_dockerize_proxy branch September 25, 2017 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants