├── .gitignore
├── LICENSE
├── README.md
├── api-exercise.R
├── australia-elex-2016
├── Notebook.Rmd
└── australia-elex-2016.Rproj
├── docker
├── README.md
├── demo-mariadb
│ ├── Dockerfile
│ └── files
│ │ └── init.sql
├── docker-compose.yaml
├── generate-certs.sh
├── openldap-password.env
├── rr-example
│ └── Dockerfile
├── rstudio-compose.yaml
├── rstudio-lubridate
│ └── Dockerfile
├── shiny-apache-shib-sp
│ ├── Dockerfile
│ └── files
│ │ ├── attribute-map.xml
│ │ ├── proxy.conf
│ │ ├── saml-metadata.xml
│ │ ├── shib.conf
│ │ ├── shibboleth2.xml
│ │ ├── sp-cert.pem
│ │ └── sp-key.pem
├── shiny-idp
│ ├── Dockerfile
│ └── files
│ │ ├── access-control.xml
│ │ ├── attribute-filter.xml
│ │ ├── attribute-resolver.xml
│ │ ├── idp-signing-cert.pem
│ │ ├── idp-signing-key.pem
│ │ ├── idp.properties
│ │ ├── ldap.properties
│ │ ├── login.vm
│ │ ├── metadata-providers.xml
│ │ ├── relying-party.xml
│ │ └── saml-metadata.xml
├── shiny-openldap
│ ├── Dockerfile
│ └── files
│ │ ├── 0110_ous.ldif
│ │ └── 9001_testusers.ldif
├── shiny-tomcat8-proxied
│ ├── Dockerfile
│ └── files
│ │ ├── catalina.properties
│ │ ├── catalina.sh
│ │ └── server.xml
├── shiny
│ ├── Dockerfile
│ └── files
│ │ ├── db-access-secure
│ │ └── app.R
│ │ ├── db-access
│ │ └── app.R
│ │ ├── header-whitelist.js
│ │ ├── hostinfo
│ │ └── app.R
│ │ ├── saml
│ │ └── app.R
│ │ └── shiny-server.conf
└── tidyverse-mariadb
│ └── Dockerfile
└── shiny-app
└── shiny
├── db-access-secure
└── app.R
├── db-access
└── app.R
├── example-assertion.xml
├── hostinfo
└── app.R
├── saml
└── app.R
└── shiny.Rproj
/.gitignore:
--------------------------------------------------------------------------------
1 | .Rproj.user
2 | .Rhistory
3 | .RData
4 | .Ruserdata
5 | *.nb.html
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ### Shiny Docker Demo
2 |
3 | This repository contains a demonstration of how to host a [Shiny](https://shiny.rstudio.com/) app in [Docker](https://www.docker.com/).
4 |
5 | The `docker` directory contains Dockerfiles and contexts for a set of images necessary for the demonstration. There are also
6 | compose files for a couple of demonstration scenarios.
7 |
8 | The `shiny-app` directory contains an RStudio project and several Shiny apps to demonstrate various features.
9 |
10 | The `australia-elex-2016` directory contains an RStudio project that performs some basic analysis on data from the 2016 Federal election in Australia. It serves
11 | as a demo of using Docker to support [reproducible research](http://ropensci.github.io/reproducibility-guide/sections/introduction/).
12 |
13 | The original setting for this demonstration was a tutorial at the [useR! 2018 Conference](https://user2018.r-project.org/). I will continue
14 | evolving the demonstration as new Docker features become available, and based on feedback/PRs from tutorial attendees and others.
15 |
--------------------------------------------------------------------------------
/api-exercise.R:
--------------------------------------------------------------------------------
1 | # docker run -it --rm --mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" -e COLUMNS=250 rocker/tidyverse:3.5.0 R
2 |
3 | options(width=Sys.getenv('COLUMNS'))
4 |
5 | library(jsonlite)
6 | library(httr)
7 | library(tidyverse)
8 |
9 | GET('http://localhost/images/json', config(unix_socket_path='/var/run/docker.sock')) %>%
10 | .$content %>%
11 | rawToChar() %>%
12 | fromJSON() %>%
13 | select(-Labels) %>%
14 | as_tibble() %>%
15 | unnest(RepoTags) %>%
16 | filter(grepl(x=RepoTags, pattern='shiny'))
17 |
--------------------------------------------------------------------------------
/australia-elex-2016/Notebook.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Analysis of Australia's 2016 Federal Election"
3 | output: html_notebook
4 | ---
5 |
6 | ```{r, echo=FALSE}
7 | suppressMessages(library(tidyverse, quietly=TRUE))
8 | suppressMessages(suppressWarnings(library(rgeos, quietly = TRUE)))
9 | suppressMessages(suppressWarnings(library(rgdal, quietly = TRUE)))
10 | library(broom)
11 | library(ggthemes)
12 | suppressMessages(suppressWarnings(library(scales)))
13 | ```
14 |
15 | This notebook presents a very basic analysis of results from the Australian Federal election in 2016 for the House of Representatives. The intent here is to provide an example of using Docker to support reproducible research rather than a comprehensive analysis of the election.
16 |
17 | Data sources included:
18 |
19 | * Vote tallies from the [Australian Electoral Commission (AEC)](https://results.aec.gov.au/20499/Website/HouseDownloadsMenu-20499-Csv.htm)
20 | * Census estimates by Commonwealth Electoral District from the [Australian Bureau of Statistics](http://www.abs.gov.au/websitedbs/censushome.nsf/home/tablebuilder)
21 | * Electoral district shapefile from the AEC at https://www.aec.gov.au/Electorates/gis/gis_datadownload.htm
22 |
23 | R was used to transform the data from these sources into a [data.world dataset](https://data.world/scottcame/australian-federal-election-2016). The R source code for the transformation is [here](https://github.com/scottcame/elections-data/blob/master/australia-elections/AustraliaElection.R).
24 |
25 | ```{r, echo=FALSE, message=FALSE}
26 |
27 | ElectionResults2016 <- suppressMessages(read_csv('https://query.data.world/s/rdtdjo6gianfc64voj3pbnfpdueadv')) %>%
28 | inner_join(suppressMessages(read_csv('https://query.data.world/s/odgvs4f5uy66gg5hrovs6jct5mdx26')), by='CED') %>%
29 | mutate(LiberalCoalitionVotes=LP+LNP+NP, LiberalCoalitionPct=LiberalCoalitionVotes/Turnout) %>%
30 | mutate(UnemploymentRate=(LabourForceStatus_Unemployed_looking_for_FT+LabourForceStatus_Unemployed_looking_for_PT) /
31 | (LabourForceStatus_Unemployed_looking_for_FT+LabourForceStatus_Unemployed_looking_for_PT+
32 | LabourForceStatus_Employed_worked_FT+LabourForceStatus_Employed_worked_PT+LabourForceStatus_Employed_away_from_work))
33 |
34 | #ElectionResults2016Flat <- ElectionResults2016 %>% select(-Enrolment, -Turnout, -WinningParty) %>% gather('Party', 'Votes', -CED, -DivisionID, -State)
35 | Parties2016 <- suppressMessages(read_csv('https://query.data.world/s/u52ol56qmsvldxxkmrtzrno345pc4m'))
36 |
37 | nationalShp <- tempfile()
38 | download.file('https://www.aec.gov.au/Electorates/gis/files/national-midmif-09052016.zip', nationalShp, quiet=TRUE)
39 | nationalShpDir <- tempdir()
40 | unzip(nationalShp, exdir = nationalShpDir)
41 | nationalShp <- readOGR(file.path(nationalShpDir, 'COM_ELB.TAB'), layer="COM_ELB", stringsAsFactors = FALSE, verbose=FALSE)
42 |
43 | nationalShpData <- nationalShp@data
44 | nationalShpData$id <- rownames(nationalShpData)
45 |
46 | nationalShpData <- nationalShpData %>%
47 | mutate(Elect_div=case_when(
48 | Elect_div=='Mcpherson' ~ 'McPherson',
49 | Elect_div=='Mcmillan' ~ 'McMillan',
50 | TRUE ~ Elect_div
51 | ))
52 |
53 | nationalShp <- nationalShp %>% SpatialPolygonsDataFrame(nationalShpData) %>%
54 | gSimplify(.01)
55 |
56 | results <- ElectionResults2016 %>% select(CED, LiberalCoalitionPct) %>% inner_join(nationalShpData, by=c('CED'='Elect_div'))
57 |
58 | nationalSPDF <- suppressMessages(tidy(nationalShp)) %>%
59 | left_join(results, by='id')
60 |
61 | ```
62 |
63 | #### National Results Map
64 |
65 | The following shows the percentage of votes in each electoral district won by the Liberal / National Liberal Party of Queensland / Nationals coalition that formed the government following the election:
66 |
67 | ```{r, echo=FALSE, fig.width=6}
68 | nationalSPDF %>% ggplot(aes(x=long, y=lat, group=group, fill=LiberalCoalitionPct)) +
69 | geom_polygon() +
70 | scale_fill_continuous(label=percent) +
71 | coord_map() + theme_map() + labs(title='Liberal Coalition Vote Share', subtitle='By Electoral District, 2016 Federal Election for House of Representatives',
72 | fill='Liberal Coalition Vote Share')
73 | ```
74 |
75 | #### Unemployment Rate and Liberal Coalition Vote Share
76 |
77 | One might hypothesize that voters in electoral districts with higher unemployment might be disinclined to support the incumbent Liberal coalition parties. This scatterplot, using 2016 Census results, lends some support to this hypothesis by showing that as unemployment rate increases in an electoral district, support for the Liberals declines:
78 |
79 | ```{r, echo=FALSE, fig.width=6}
80 | ggplot(ElectionResults2016, aes(x=UnemploymentRate, y=LiberalCoalitionPct)) + geom_point() + geom_smooth(method='lm') +
81 | scale_y_continuous(labels=percent) + scale_x_continuous(labels=percent) +
82 | labs(title='Correlation of Unemployment Rate and Liberal Coalition Vote Share', subtitle='By Electoral District, 2016 Federal Election for Australia House of Representatives',
83 | x='Unemployment Rate (2016 Census)', y='Liberal Coalition Vote Share')
84 | ```
85 |
--------------------------------------------------------------------------------
/australia-elex-2016/australia-elex-2016.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: Default
4 | SaveWorkspace: Default
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 2
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
--------------------------------------------------------------------------------
/docker/README.md:
--------------------------------------------------------------------------------
1 | ### Docker Images
2 |
3 | This directory contains the Dockerfiles and associated contexts for building images that are part of the demonstration. The images are:
4 |
5 | * *demo-mariadb:* A small [MariaDB](https://mariadb.org/) database pre-loaded with some simple demo data used in Shiny apps
6 | * *shiny-apache-shib-sp:* An [Apache web/proxy server](https://httpd.apache.org/) configured with the [Shibboleth Service Provider](https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPGettingStarted) to gate access to services and proxy http traffic
7 | * *shiny-idp:* A [Shibboleth Identity Provider](https://wiki.shibboleth.net/confluence/display/IDP30/Home) to respond to SAML authentication requests and form/share assertions with the Service Provider (and, indirectly, with backend apps)
8 | * *shiny-openldap:* An [Open LDAP server](https://www.openldap.org/) to store and manage user authentication credentials and user attributes, which form the basis of assertions made by the Identity Provider and relied upon (and trusted) by the Service Provider and backend apps
9 | * *shiny-tomcat8-proxied:* A [Tomcat J2EE Servlet Container](http://tomcat.apache.org/) used to host the Identity Provider (and is available for easily hosting any other Java Web Application)
10 | * *shiny:* A [Shiny Server](https://shiny.rstudio.com/) instance, tweaked to pass through http headers added by Shibboleth, that will host Shiny apps for the demonstration
11 | * *tidyverse-mariadb:* A derived image from the [Rocker project's](https://github.com/rocker-org/rocker) [tidyverse](https://hub.docker.com/r/rocker/tidyverse/) image, extended to include the [RMariaDB package](https://cran.r-project.org/web/packages/RMariaDB/index.html) and system libraries on which the package depends
12 |
13 | Note that all of these images are maintained in Docker Hub on my [site](https://hub.docker.com/u/scottcame/).
14 |
15 | This directory also contains two [Docker Compose](https://docs.docker.com/compose/) files: one that orchestrates the Shiny demo, and the other that runs an instance of RStudio Server in a container along with the demo MariaDB.
16 |
--------------------------------------------------------------------------------
/docker/demo-mariadb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mariadb
2 |
3 | LABEL maintainer="Scott Came (scottcame10@gmail.com)" \
4 | org.label-schema.description="Image with MariaDB instance containing demo data for Shiny demo" \
5 | org.label-schema.vcs-url="https://github.com/scottcame/shiny-microservice-demo/docker/demo-mariadb"
6 |
7 | ENV MYSQL_ALLOW_EMPTY_PASSWORD=yes
8 |
9 | COPY files/* /docker-entrypoint-initdb.d/
10 |
--------------------------------------------------------------------------------
/docker/demo-mariadb/files/init.sql:
--------------------------------------------------------------------------------
1 | GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
2 |
3 | create database demo1;
4 |
5 | use demo1;
6 |
7 | create table t1A (pk int primary key, v varchar(20));
8 | insert into t1A values(1, 'Table A Row One');
9 | insert into t1A values(2, 'Table A Row Two');
10 | insert into t1A values(3, 'Table A Row Three');
11 | insert into t1A values(4, 'Table A Row Four');
12 |
13 | create table t1B (pk int primary key, v varchar(20));
14 | insert into t1B values(1, 'Table B Row One');
15 | insert into t1B values(2, 'Table B Row Two');
16 | insert into t1B values(3, 'Table B Row Three');
17 | insert into t1B values(4, 'Table B Row Four');
18 |
--------------------------------------------------------------------------------
/docker/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | # compose file that defines services established as docker daemon startup containers
2 | # run with: docker-compose up -d
3 |
4 | version: "3"
5 |
6 | networks:
7 | shiny-demo:
8 | driver: bridge
9 | ipam:
10 | driver: default
11 | config:
12 | - subnet: 172.22.0.0/16
13 |
14 | services:
15 | shiny-openldap:
16 | image: scottcame/shiny-openldap
17 | container_name: shiny-openldap
18 | networks:
19 | - "shiny-demo"
20 | # remove ports directive in production, to avoid exposure of the ldap directory to the outside
21 | ports:
22 | - "1389:389"
23 | env_file:
24 | - ./openldap-password.env
25 | environment:
26 | - SLAPD_DOMAIN=ldap.localhost.localdomain
27 | shiny-idp:
28 | image: scottcame/shiny-idp
29 | container_name: shiny-idp
30 | networks:
31 | - "shiny-demo"
32 | depends_on:
33 | - shiny-openldap
34 | shiny-apache-shib-sp:
35 | image: scottcame/shiny-apache-shib-sp
36 | container_name: shiny-apache-shib-sp
37 | networks:
38 | - "shiny-demo"
39 | ports:
40 | - "80:80"
41 | - "443:443"
42 | shiny:
43 | image: scottcame/shiny
44 | container_name: shiny
45 | networks:
46 | - "shiny-demo"
47 | ports:
48 | - "3838:3838"
49 | demo-mariadb:
50 | image: scottcame/demo-mariadb
51 | container_name: demo-mariadb
52 | networks:
53 | - "shiny-demo"
54 | ports:
55 | - "13306:3306"
56 |
--------------------------------------------------------------------------------
/docker/generate-certs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # typically you'll only need to do this if you want to refresh the certs...not needed after initial generation, even for subsequent builds
4 | # including this script mostly to document how we generated the certs in the first place
5 |
6 | # borrowed liberally from https://wiki.shibboleth.net/confluence/display/CONCEPT/SAMLKeysAndCertificates#SAMLKeysAndCertificates-CreatingaSAMLKeyandCertificate
7 |
8 | # Service Provider cert/key
9 | openssl req -new -x509 -nodes -newkey rsa:2048 -keyout shiny-apache-shib-sp/files/sp-key.pem -days 7300 -out shiny-apache-shib-sp/files/sp-cert.pem -subj "/C=US/ST=WA/L=Olympia/O=Cascadia Analytics/CN=localhost.localdomain/emailAddress=docker@localhost"
10 |
11 | # Identity Provider cert/key
12 | openssl req -new -x509 -nodes -newkey rsa:2048 -keyout shiny-idp/files/idp-signing-key.pem -days 7300 -out shiny-idp/files/idp-signing-cert.pem -subj "/C=US/ST=WA/L=Olympia/O=Cascadia Analytics/CN=localhost.localdomain/emailAddress=docker@localhost"
13 |
--------------------------------------------------------------------------------
/docker/openldap-password.env:
--------------------------------------------------------------------------------
1 | SLAPD_PASSWORD=password
2 |
--------------------------------------------------------------------------------
/docker/rr-example/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rocker/geospatial:3.5.0
2 |
3 | VOLUME /output
4 |
5 | RUN apt-get update && apt-get install -y curl
6 | RUN R -e 'install.packages(c("ggthemes"))'
7 | RUN cd /tmp && curl -O https://raw.githubusercontent.com/scottcame/shiny-docker-demo/master/australia-elex-2016/Notebook.Rmd
8 |
9 | CMD ["R", "-e", "rmarkdown::render('/tmp/Notebook.Rmd', output_file='/output/Notebook.html')"]
10 |
--------------------------------------------------------------------------------
/docker/rstudio-compose.yaml:
--------------------------------------------------------------------------------
1 | # A Minimal Docker Compose Example
2 |
3 | version: "3.5"
4 |
5 | networks:
6 | nw-useR:
7 | name: nw-useR
8 |
9 | services:
10 | rstudio:
11 | image: scottcame/tidyverse-mariadb
12 | container_name: rstudio
13 | networks:
14 | - nw-useR
15 | ports:
16 | - 8787:8787
17 | mariadb:
18 | image: scottcame/demo-mariadb
19 | container_name: demo-mariadb
20 | networks:
21 | - nw-useR
22 |
--------------------------------------------------------------------------------
/docker/rstudio-lubridate/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rocker/rstudio
2 |
3 | RUN R -e 'install.packages("lubridate")'
4 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM frolvlad/alpine-glibc:alpine-3.7
2 |
3 | LABEL maintainer="Scott Came (scottcame10@gmail.com)" \
4 | org.label-schema.description="Image containing Apache with mod proxy and mod shib to support shiny demo" \
5 | org.label-schema.vcs-url="https://github.com/scottcame/shiny-microservice-demo/docker/shiny-apache-shib-sp"
6 |
7 | RUN apk add --update bash apache2 apache2-ssl apache2-proxy apache2-dev apache2-ctl alpine-sdk openssl libressl-dev boost-dev curl-dev bzip2-dev zlib-dev
8 |
9 | # This loosely follows the steps documented at https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPLinuxSourceBuild
10 |
11 | WORKDIR /tmp
12 |
13 | # Install log4shib
14 |
15 | RUN wget http://shibboleth.net/downloads/log4shib/latest/log4shib-1.0.9.tar.gz && \
16 | tar -xvf log4shib-1.0.9.tar.gz && \
17 | cd log4shib-1.0.9 && \
18 | ./configure --disable-static --disable-doxygen --prefix=/opt/shibboleth-sp CXXFLAGS="-std=c++11" && \
19 | make && \
20 | make install && \
21 | cd .. && rm -rf log4shib*
22 |
23 | # Install XercesC
24 |
25 | RUN wget http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.2.tar.gz && \
26 | tar -xvf xerces-c-3.1.2.tar.gz && \
27 | cd xerces-c-3.1.2 && \
28 | ./configure --prefix=/opt/shibboleth-sp --disable-netaccessor-libcurl && \
29 | make && \
30 | make install && \
31 | cd .. && rm -rf xerces-c*
32 |
33 | # Install XML Security
34 | # Note we have to apply a "patch" to get this to compile with GCC v6+
35 | # See https://issues.apache.org/jira/browse/SANTUARIO-437
36 |
37 | RUN wget http://www.apache.org/dist/santuario/c-library/xml-security-c-1.7.3.tar.gz && \
38 | tar -xvf xml-security-c-1.7.3.tar.gz && \
39 | cd xml-security-c-1.7.3 && \
40 | sed -i -e "648s/false/NULL/" xsec/tools/checksig/InteropResolver.cpp && \
41 | ./configure --without-xalan --disable-static --prefix=/opt/shibboleth-sp --with-xerces=/opt/shibboleth-sp CXXFLAGS="-w" && \
42 | make && \
43 | make install && \
44 | cd .. && rm -rf xml-sec*
45 |
46 | # Install OpenSAML XML Tooling
47 |
48 | RUN wget http://shibboleth.net/downloads/c++-opensaml/latest/xmltooling-1.6.4.tar.gz && \
49 | tar -xvf xmltooling-1.6.4.tar.gz && \
50 | cd xmltooling-1.6.4 && \
51 | ./configure --with-log4shib=/opt/shibboleth-sp --prefix=/opt/shibboleth-sp -C CXXFLAGS="-w" && \
52 | make && \
53 | make install && \
54 | cd .. && rm -rf xmltooling*
55 |
56 | # Install OpenSAML
57 |
58 | RUN wget http://shibboleth.net/downloads/c++-opensaml/latest/opensaml-2.6.1.tar.gz && \
59 | tar -xvf opensaml-2.6.1.tar.gz && \
60 | cd opensaml-2.6.1 && \
61 | ./configure --with-log4shib=/opt/shibboleth-sp --prefix=/opt/shibboleth-sp -C CXXFLAGS="-w" && \
62 | make && \
63 | make install && \
64 | cd .. && rm -rf opensaml*
65 |
66 | # Install Shib daemon
67 |
68 | RUN wget http://shibboleth.net/downloads/service-provider/2.6.1/shibboleth-sp-2.6.1.tar.gz && \
69 | tar -xvf shibboleth-sp-2.6.1.tar.gz && \
70 | cd shibboleth-sp-2.6.1 && \
71 | ./configure --with-log4shib=/opt/shibboleth-sp --prefix=/opt/shibboleth-sp --enable-apache-24 --with-apxs24=/usr/bin/apxs CXXFLAGS="-w" && \
72 | make && \
73 | make install && \
74 | cd .. && rm -rf shibboleth* && \
75 | apk del apache2-dev
76 |
77 | # Copy config files over and do some editing
78 |
79 | # Make startup script
80 |
81 | RUN echo '#!/bin/bash' > /opt/shibboleth-sp/sbin/start-shib-and-apache && \
82 | echo "/opt/shibboleth-sp/sbin/shibd -f" >> /opt/shibboleth-sp/sbin/start-shib-and-apache && \
83 | echo "mkdir -p /run/apache2" >> /opt/shibboleth-sp/sbin/start-shib-and-apache && \
84 | echo "apachectl start -DFOREGROUND" >> /opt/shibboleth-sp/sbin/start-shib-and-apache && \
85 | chmod u+x /opt/shibboleth-sp/sbin/start-shib-and-apache
86 |
87 | WORKDIR /opt/shibboleth-sp
88 |
89 | COPY files/proxy.conf /etc/apache2/conf.d/
90 | COPY files/shib.conf /etc/apache2/conf.d/
91 | COPY files/*.xml /opt/shibboleth-sp/etc/shibboleth/
92 | COPY files/*.pem /opt/shibboleth-sp/etc/shibboleth/
93 |
94 | RUN sed -i s/SSLMutex/#SSLMutex/g /etc/apache2/conf.d/ssl.conf && \
95 | sed -i "s/#ServerName.*/ServerName localhost:80/g" /etc/apache2/httpd.conf && \
96 | sed -i "s/UseCanonicalName Off/UseCanonicalName On/g" /etc/apache2/httpd.conf
97 |
98 | CMD ["/opt/shibboleth-sp/sbin/start-shib-and-apache"]
99 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/files/attribute-map.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/files/proxy.conf:
--------------------------------------------------------------------------------
1 | LoadModule proxy_module modules/mod_proxy.so
2 | LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
3 | LoadModule proxy_http_module modules/mod_proxy_http.so
4 | LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
5 |
6 | ProxyPass /idp ajp://shiny-idp:8009/idp
7 | ProxyPassReverse /idp ajp://shiny-idp:8009/idp
8 |
9 | ProxyPassMatch /shiny/(.+)/websocket/ ws://shiny:3838/$1/websocket
10 | ProxyPassMatch /shiny/(.+) http://shiny:3838/$1
11 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/files/saml-metadata.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | localdomain
26 |
27 |
28 |
29 |
30 |
31 | MIIDkjCCAnoCCQCYAsXeiFCDcDANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMC
32 | VVMxCzAJBgNVBAgMAldBMRAwDgYDVQQHDAdPbHltcGlhMRswGQYDVQQKDBJDYXNj
33 | YWRpYSBBbmFseXRpY3MxHjAcBgNVBAMMFWxvY2FsaG9zdC5sb2NhbGRvbWFpbjEf
34 | MB0GCSqGSIb3DQEJARYQZG9ja2VyQGxvY2FsaG9zdDAeFw0xODA1MTgxNzA4Mjda
35 | Fw0zODA1MTMxNzA4MjdaMIGKMQswCQYDVQQGEwJVUzELMAkGA1UECAwCV0ExEDAO
36 | BgNVBAcMB09seW1waWExGzAZBgNVBAoMEkNhc2NhZGlhIEFuYWx5dGljczEeMBwG
37 | A1UEAwwVbG9jYWxob3N0LmxvY2FsZG9tYWluMR8wHQYJKoZIhvcNAQkBFhBkb2Nr
38 | ZXJAbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoiIh
39 | ucGDxgBPI7bjn9ze/jh0eT8An4BmHObw/xjq5REcx0/hq8A9oDmUQacsjP0+KWAC
40 | rxc9JHdcL+TgZJGcrhkUdAhGkeEvgywP+UJh/BTAfBMMvHkWGxM0cZjpjfdzxEbn
41 | v/qanw8KKjlaOo7rf3ia8nUDfKgYGx+PlPylUvlvI1C0hkHbmlaxsdvCLIRQRYhZ
42 | cWyRb2b9+UXJ2zuGZJUXXjvbXGZ8Loftlzjv64WiM5RPytzL1pVoc0OWpWvt1hLI
43 | 5VeG7GiPYhjf1kVxFSjv0S1w6lldBAkCoPQcSTrfHnVO3MvN0MdR69UWfgHmq1A7
44 | 5ovxIQaGd3p5jBtXNwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBZgIlOr/utsLJ0
45 | WT6uVBTXyWlUYi3yhKkLk7B0QRuVycYG5KNYs9hiVkFDpCkiOeR7hhgUIZVSe8VN
46 | HF9l3zJdLQ0gXAe6fgkNhxdo9fB9/jYo5gu6H+p6b0T/9OrrrUKEHvBhYR7inus7
47 | /eLN3s9aWhzp8uAaBZ0UVCat944inzWMnT1nQhw3LVwfizJGcTKAdB8T50OKQhvo
48 | Y/Xtc7RBa8bSu/q9nZ2xvdDgvJsssaqkeaRDgo7tpgs71DU4LyS1ph9O+lhsAgt8
49 | KwTji7X9VFAIUuWbuQfJl2ZQ6uyW6pOcTquPiAR7OX2Fc+ZrfAYDdDiCwpf80Inp
50 | OfwsJYfW
51 |
52 |
53 |
54 |
55 |
56 | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
57 | urn:oasis:names:tc:SAML:2.0:nameid-format:transient
58 |
59 |
61 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | MIIDkjCCAnoCCQDYf7lTcIsNOjANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMC
90 | VVMxCzAJBgNVBAgMAldBMRAwDgYDVQQHDAdPbHltcGlhMRswGQYDVQQKDBJDYXNj
91 | YWRpYSBBbmFseXRpY3MxHjAcBgNVBAMMFWxvY2FsaG9zdC5sb2NhbGRvbWFpbjEf
92 | MB0GCSqGSIb3DQEJARYQZG9ja2VyQGxvY2FsaG9zdDAeFw0xODA1MTgxNzA4MjZa
93 | Fw0zODA1MTMxNzA4MjZaMIGKMQswCQYDVQQGEwJVUzELMAkGA1UECAwCV0ExEDAO
94 | BgNVBAcMB09seW1waWExGzAZBgNVBAoMEkNhc2NhZGlhIEFuYWx5dGljczEeMBwG
95 | A1UEAwwVbG9jYWxob3N0LmxvY2FsZG9tYWluMR8wHQYJKoZIhvcNAQkBFhBkb2Nr
96 | ZXJAbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArtRF
97 | xJlPBEkhHl0DK0wutb4/5mixaL0bcydYwvvJxYdzpBcpJusJTpUg+ljQbwAT9Ln3
98 | Usg3fipsskkVQRoPPihbmgszRpi5qO4BoQhB1zoLshsT3hiuZGSeiVhUTOPtiMI3
99 | flOcicsSXKlXzdnILYGiFa26UltSef/KIF/5yHCVPCLgKDwmXmXx1ps990o/3qqC
100 | 17MCC+VxmMBuiyn+G22DFD5lHFxnppoc+EiWx53JdcvQwF2gfClGFEQjDEYuIRgr
101 | iwaWpHqIm7iGcyk6YZdRHR6AXSewOeTcZjPjVtpY0F6uHiGUXT7+Nj05QZG4f+7F
102 | zXcybcgmj/qg4ZsXZQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAdYMVfT6V9etxD
103 | ogZ1oUmUat/3HeN14LWPllRVc50CJ88gX4beiTkoiy+1t+3wRL0kb+w0NScGHiDt
104 | jqPJ+7WtlsBdEBgVsd1SrmUr7yG8iAYctbYnXZbrj5YPEx18ikfKy84chXxbotpn
105 | cqhx15PehLgfnktYRmsQnBXkvM8ziCnhjmbITdqVrarbYOqH0wKfj0YIehg1vum3
106 | xtryZVQ7cT28hFR9iraTTDnHqqTCFsQJhzomoVjLXyXY1q9EiGj5CWz+WzOKZxPg
107 | dj6O1AwhTPXcmPHYGO96SZpZaQaUWJwkp2L5qGYk3kaelHQJfsqQ8u/N31OtcUXs
108 | 2LqrhpOb
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
119 | urn:oasis:names:tc:SAML:2.0:nameid-format:transient
120 |
121 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/files/shib.conf:
--------------------------------------------------------------------------------
1 | LoadModule mod_shib /opt/shibboleth-sp/lib/shibboleth/mod_shib_24.so
2 | ShibCompatValidUser Off
3 |
4 |
5 | AuthType None
6 | Require all granted
7 |
8 |
9 |
10 |
11 | AuthType None
12 | Require all granted
13 |
14 | Alias /shibboleth-sp/main.css /opt/shibboleth-sp/share/shibboleth/main.css
15 |
16 |
17 | # Add a section below for any url path that should be gated by shib
18 |
19 |
20 | AuthType shibboleth
21 | ShibRequestSetting requireSession 1
22 | ShibUseHeaders On
23 | require shib-session
24 |
25 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/files/shibboleth2.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 | SAML2 SAML1
23 |
24 |
25 | SAML2 Local
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/files/sp-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDkjCCAnoCCQDYf7lTcIsNOjANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMC
3 | VVMxCzAJBgNVBAgMAldBMRAwDgYDVQQHDAdPbHltcGlhMRswGQYDVQQKDBJDYXNj
4 | YWRpYSBBbmFseXRpY3MxHjAcBgNVBAMMFWxvY2FsaG9zdC5sb2NhbGRvbWFpbjEf
5 | MB0GCSqGSIb3DQEJARYQZG9ja2VyQGxvY2FsaG9zdDAeFw0xODA1MTgxNzA4MjZa
6 | Fw0zODA1MTMxNzA4MjZaMIGKMQswCQYDVQQGEwJVUzELMAkGA1UECAwCV0ExEDAO
7 | BgNVBAcMB09seW1waWExGzAZBgNVBAoMEkNhc2NhZGlhIEFuYWx5dGljczEeMBwG
8 | A1UEAwwVbG9jYWxob3N0LmxvY2FsZG9tYWluMR8wHQYJKoZIhvcNAQkBFhBkb2Nr
9 | ZXJAbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArtRF
10 | xJlPBEkhHl0DK0wutb4/5mixaL0bcydYwvvJxYdzpBcpJusJTpUg+ljQbwAT9Ln3
11 | Usg3fipsskkVQRoPPihbmgszRpi5qO4BoQhB1zoLshsT3hiuZGSeiVhUTOPtiMI3
12 | flOcicsSXKlXzdnILYGiFa26UltSef/KIF/5yHCVPCLgKDwmXmXx1ps990o/3qqC
13 | 17MCC+VxmMBuiyn+G22DFD5lHFxnppoc+EiWx53JdcvQwF2gfClGFEQjDEYuIRgr
14 | iwaWpHqIm7iGcyk6YZdRHR6AXSewOeTcZjPjVtpY0F6uHiGUXT7+Nj05QZG4f+7F
15 | zXcybcgmj/qg4ZsXZQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAdYMVfT6V9etxD
16 | ogZ1oUmUat/3HeN14LWPllRVc50CJ88gX4beiTkoiy+1t+3wRL0kb+w0NScGHiDt
17 | jqPJ+7WtlsBdEBgVsd1SrmUr7yG8iAYctbYnXZbrj5YPEx18ikfKy84chXxbotpn
18 | cqhx15PehLgfnktYRmsQnBXkvM8ziCnhjmbITdqVrarbYOqH0wKfj0YIehg1vum3
19 | xtryZVQ7cT28hFR9iraTTDnHqqTCFsQJhzomoVjLXyXY1q9EiGj5CWz+WzOKZxPg
20 | dj6O1AwhTPXcmPHYGO96SZpZaQaUWJwkp2L5qGYk3kaelHQJfsqQ8u/N31OtcUXs
21 | 2LqrhpOb
22 | -----END CERTIFICATE-----
23 |
--------------------------------------------------------------------------------
/docker/shiny-apache-shib-sp/files/sp-key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCu1EXEmU8ESSEe
3 | XQMrTC61vj/maLFovRtzJ1jC+8nFh3OkFykm6wlOlSD6WNBvABP0ufdSyDd+Kmyy
4 | SRVBGg8+KFuaCzNGmLmo7gGhCEHXOguyGxPeGK5kZJ6JWFRM4+2Iwjd+U5yJyxJc
5 | qVfN2cgtgaIVrbpSW1J5/8ogX/nIcJU8IuAoPCZeZfHWmz33Sj/eqoLXswIL5XGY
6 | wG6LKf4bbYMUPmUcXGemmhz4SJbHncl1y9DAXaB8KUYURCMMRi4hGCuLBpakeoib
7 | uIZzKTphl1EdHoBdJ7A55NxmM+NW2ljQXq4eIZRdPv42PTlBkbh/7sXNdzJtyCaP
8 | +qDhmxdlAgMBAAECggEBAKzDAzalsNmxUlLo4wrUO4xJNmf/qOCxjwCaLzJvEhJq
9 | KbJLWNUmiYnoADCjt0UZNJ8vbeGWDJBWaBc99QziLZHk27A7xS3MGht/Joj02etP
10 | ZuNXsqhUh3CZpbhfWt6olcAA/EmPYi8gR0Ld7PB0d0XQxlTZ2jcsGzKHvDuF3BVe
11 | 2Nrw285WkGW7PWvIiU4ncWsqpKSOiqryuSQqiLVHsinm4vO2/7v8HYmTcczcwMvw
12 | G8Hp8qAUrwQcS2/qcGEIvBYmR1I6h2c25vn4go3nkRxb1qqkYyKrIS4xZfY/g0aF
13 | Pg7V34nrdhIPZKFKDCuehT4FGGsU9cJ5DxQqgJ7rz7kCgYEA3jceMObXWzTE5ma5
14 | 493IWNL/zDTXN4SF7tvjjaSgku9vJq5JgiWPO/4PyK89P1Rx/FTTpoSwZZ6ZRj5H
15 | BbX8pquC08fIf8Mr9c4G0vAFdyo/y5He+C6XCK+HF0GGYoSuETSWDSnSYWLqW2fp
16 | OOZhYYKV7N0eRNkjBfoQVl4TS0sCgYEAyWjUv5OKy1HO4uI/LK18j1HSw+vTN2D8
17 | DfLefORaaZuq81vGJjUfv87E7hW9rPkNrl3wzW8TUnAJi8bhj7yyClJadkT4dr1j
18 | rGg7c3cVMCK6PwGAAVXPCk+rurFvmiSzRzBwJQ3pm9XW18nVvSZT02sCEBz8g1P2
19 | v9Aao+hiSg8CgYEAsindAfZDGnRPni8kwYazOExMHS0MlQ2i2KTiaFFjEQv5wTih
20 | 5UA5/C6x9wRRhfItxdM5MtxWFdO4LnKGPRTxcaw3o5cdsRoJp/W80OjyaN2t8oiN
21 | Dc1E+QjKtiGqHlkkutS/reQnMj+9iPXiLuW/lA/AJv4OY8L4arVY3fZlX8sCgYAt
22 | v3gDg9nU0OIzOryqw0U1sJo1Ek3JmGfoKzBKIfw/XLJ50HCzoQFzKd4lTh7lOTTY
23 | VFIr93zmDri8XRJC+dNe8NHHZ2cgYWhQcuR+F6BibKDtSsPuibUbXHlfUIpO8uMd
24 | 2my+nehgEzRXk2rPKfOEZBv12P+qPNohO32xmUkqFQKBgEbcGluYY/roZmj/UsEL
25 | oOjtg2yltYJQF00NgX/RmiSOJKpdjNTyRxDpP0h1G4W0SbeLjYfUZN/d3xfhvjx0
26 | wtonLoil16C60pFCqL7Lhiv68NpAoUocd+wsAqffzMFw9hR/Xys+c5yrz/KqlEFP
27 | 0td9ewGKqfSuiU5rhPK2Ip3e
28 | -----END PRIVATE KEY-----
29 |
--------------------------------------------------------------------------------
/docker/shiny-idp/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM scottcame/shiny-tomcat8-proxied
2 |
3 | LABEL maintainer="Scott Came (scottcame10@gmail.com)" \
4 | org.label-schema.description="Image with Shibboleth Identity Provider to support shiny demo" \
5 | org.label-schema.vcs-url="https://github.com/scottcame/shiny-microservice-demo/docker/shiny-idp"
6 |
7 | WORKDIR /tmp
8 |
9 | # note that images (or other resources) used by the Velocity templates in the webapp have to be installed in the war file, though
10 | # the .vm resources themselves can be copied into /opt/shibboleth-idp/views/
11 | # COPY files/*.png /tmp/
12 |
13 | RUN curl -SsO http://shibboleth.net/downloads/identity-provider/3.3.2/shibboleth-identity-provider-3.3.2.zip && \
14 | unzip shibboleth-identity-provider-3.3.2.zip && cd shibboleth-identity-provider-3.3.2 && \
15 | echo "idp.entityID=https://idp.localhost.localdomain/idp/shibboleth" > props && \
16 | bin/install.sh -Didp.target.dir=/opt/shibboleth-idp -Didp.host.name=localhost -Didp.sealer.password=password \
17 | -Didp.keystore.password=password -Didp.src.dir=/tmp/shibboleth-identity-provider-3.3.2 -Didp.scope=localdomain \
18 | -Didp.noprompt=true -Didp.merge.properties=props && \
19 | cd /opt/shibboleth-idp/war && mkdir tmp && \
20 | mv idp.war tmp/ && cd tmp && \
21 | unzip idp.war && \
22 | curl -SsO https://repo1.maven.org/maven2/jstl/jstl/1.2/jstl-1.2.jar && \
23 | mv jstl-1.2.jar WEB-INF/lib && \
24 | # mv /tmp/*.png images/ && \
25 | cd .. && jar -cvfM idp.war -C tmp/ . && \
26 | rm -rf tmp && rm -rf /tmp/*
27 |
28 | RUN cp -r /opt/shibboleth-idp/conf /tmp/
29 |
30 | COPY files/saml-metadata.xml /opt/shibboleth-idp/metadata/saml-metadata.xml
31 | COPY files/access-control.xml /opt/shibboleth-idp/conf/access-control.xml
32 | COPY files/attribute-filter.xml /opt/shibboleth-idp/conf/attribute-filter.xml
33 | COPY files/attribute-resolver.xml /opt/shibboleth-idp/conf/attribute-resolver.xml
34 | COPY files/relying-party.xml /opt/shibboleth-idp/conf/relying-party.xml
35 | COPY files/metadata-providers.xml /opt/shibboleth-idp/conf/metadata-providers.xml
36 | COPY files/ldap.properties /opt/shibboleth-idp/conf/ldap.properties
37 | COPY files/idp.properties /opt/shibboleth-idp/conf/idp.properties
38 | COPY files/idp-signing-*.pem /opt/shibboleth-idp/credentials/
39 | COPY files/login.vm /opt/shibboleth-idp/views/
40 |
41 | RUN mkdir -p /opt/tomcat/conf/Catalina/localhost
42 | RUN echo '' > /opt/tomcat/conf/Catalina/localhost/idp.xml
43 |
44 | WORKDIR /opt/shibboleth-idp
45 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/access-control.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/attribute-filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/attribute-resolver.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
54 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/idp-signing-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDkjCCAnoCCQCYAsXeiFCDcDANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMC
3 | VVMxCzAJBgNVBAgMAldBMRAwDgYDVQQHDAdPbHltcGlhMRswGQYDVQQKDBJDYXNj
4 | YWRpYSBBbmFseXRpY3MxHjAcBgNVBAMMFWxvY2FsaG9zdC5sb2NhbGRvbWFpbjEf
5 | MB0GCSqGSIb3DQEJARYQZG9ja2VyQGxvY2FsaG9zdDAeFw0xODA1MTgxNzA4Mjda
6 | Fw0zODA1MTMxNzA4MjdaMIGKMQswCQYDVQQGEwJVUzELMAkGA1UECAwCV0ExEDAO
7 | BgNVBAcMB09seW1waWExGzAZBgNVBAoMEkNhc2NhZGlhIEFuYWx5dGljczEeMBwG
8 | A1UEAwwVbG9jYWxob3N0LmxvY2FsZG9tYWluMR8wHQYJKoZIhvcNAQkBFhBkb2Nr
9 | ZXJAbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoiIh
10 | ucGDxgBPI7bjn9ze/jh0eT8An4BmHObw/xjq5REcx0/hq8A9oDmUQacsjP0+KWAC
11 | rxc9JHdcL+TgZJGcrhkUdAhGkeEvgywP+UJh/BTAfBMMvHkWGxM0cZjpjfdzxEbn
12 | v/qanw8KKjlaOo7rf3ia8nUDfKgYGx+PlPylUvlvI1C0hkHbmlaxsdvCLIRQRYhZ
13 | cWyRb2b9+UXJ2zuGZJUXXjvbXGZ8Loftlzjv64WiM5RPytzL1pVoc0OWpWvt1hLI
14 | 5VeG7GiPYhjf1kVxFSjv0S1w6lldBAkCoPQcSTrfHnVO3MvN0MdR69UWfgHmq1A7
15 | 5ovxIQaGd3p5jBtXNwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBZgIlOr/utsLJ0
16 | WT6uVBTXyWlUYi3yhKkLk7B0QRuVycYG5KNYs9hiVkFDpCkiOeR7hhgUIZVSe8VN
17 | HF9l3zJdLQ0gXAe6fgkNhxdo9fB9/jYo5gu6H+p6b0T/9OrrrUKEHvBhYR7inus7
18 | /eLN3s9aWhzp8uAaBZ0UVCat944inzWMnT1nQhw3LVwfizJGcTKAdB8T50OKQhvo
19 | Y/Xtc7RBa8bSu/q9nZ2xvdDgvJsssaqkeaRDgo7tpgs71DU4LyS1ph9O+lhsAgt8
20 | KwTji7X9VFAIUuWbuQfJl2ZQ6uyW6pOcTquPiAR7OX2Fc+ZrfAYDdDiCwpf80Inp
21 | OfwsJYfW
22 | -----END CERTIFICATE-----
23 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/idp-signing-key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCiIiG5wYPGAE8j
3 | tuOf3N7+OHR5PwCfgGYc5vD/GOrlERzHT+GrwD2gOZRBpyyM/T4pYAKvFz0kd1wv
4 | 5OBkkZyuGRR0CEaR4S+DLA/5QmH8FMB8Ewy8eRYbEzRxmOmN93PERue/+pqfDwoq
5 | OVo6jut/eJrydQN8qBgbH4+U/KVS+W8jULSGQduaVrGx28IshFBFiFlxbJFvZv35
6 | RcnbO4ZklRdeO9tcZnwuh+2XOO/rhaIzlE/K3MvWlWhzQ5ala+3WEsjlV4bsaI9i
7 | GN/WRXEVKO/RLXDqWV0ECQKg9BxJOt8edU7cy83Qx1Hr1RZ+AearUDvmi/EhBoZ3
8 | enmMG1c3AgMBAAECggEAU+fOBE+9Xi6yxgzT59tqG64juMt+Cw1ryvFJLvs6NKmS
9 | dyND6ppmShECRKe7SouUK91gBjTEk6ahsreD2QfySbb4+sN9oekjqYKYEarlAovK
10 | wWsqYC9Z3VEnBtLXq3ywEJeRP6z1b/Nck1Vy+HMWNLW5mlgsIcrsDr1alQPamwFg
11 | JZOUKcVSPzamjgll5kc+4CltZY26yyjToJnYlNny51iGB1tKl+4y7wBR8t1yfGWE
12 | StDl2Zx4Xj0z5fnGq7udLbFVL9JNkvkQOg5IZ8gwQNhHtjy9DmYInClt+YpyHIZC
13 | PQpEa1JF5rZnpgd9CQ5KIR5qdB/+BkpxRtc9wNYXgQKBgQDSQpPSzMSyyTSQHNJy
14 | v0TQUfMfsfiK66hNwTDvuU/CrpWDo4TPz4BAUw0mQgLy94wwXxM/Rvf1tpsDa4fh
15 | P/Ft5Cyg0CDMgVcY/0Td4zG/LJ9mnaHclVO8YamuCFzJrluIeQjahtHBYP3eZRWt
16 | nvR4cvPuSSBCXpM2DAacBrd0ZwKBgQDFZ135cgr45dajIcNDxmWncon7eA4fv6Yu
17 | cSnykV8hgimf3hch3kqpannGbui3SR3SM4KZawc1387H6n6YOCSJHQ4URJ6UNyXZ
18 | Jsl7bXEMkV5EKbL8UhmnBLkqmz6uTnu2ofKeI94U0pqTOZU1PQvGsBlPUROBTZKg
19 | cx4VrZPEsQKBgCVlQfVUBgfmUTrwZV2TNyH18U/Jz3KlxyFNIu7//neZpW3sP0rW
20 | lPDb1JLhWrTr4jsYLcwrSx6gg6FwFpKxVLc+xdE0MyEsP9lqTU1JgyeFQDR4BLm+
21 | tU3j8NHLGvWj1RPIsxJquBO0tHJBeEGQ69ogV9Ihn2MufvA141cMusQxAoGBAJ9B
22 | bUc5AjEa+7ZQHsAm5wvYFAmUKZDjhKYjFbxkG2NlJz+aZP8l3wYeqG+2Onjju/NB
23 | KzOqbP7BuIkAXXFgmdkkX59qXKUmeJpf+FxjRrjk7i//lC6L7bYY0WnWJRNqrdQB
24 | g0KhnSEfZyUvZ3iz7zQ0Dbc3qYy/kHNxa+wBRR2BAoGBAIAA5GkmBqIN4BK8BUd1
25 | HWbRw8UJw7pEolfwlx1U0RAztJ8I2CC0lchAPk3X92FeDldFu6JgfWPEmetQPKbr
26 | o2vEvFtc7IVDEBMF/PPKPQYswRVMVYoQCMXHyRkQ3qcZpcZFOo2vKxPrL8n/9uZ6
27 | eMFodVOOi0+DyP6zbkp5izs/
28 | -----END PRIVATE KEY-----
29 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/idp.properties:
--------------------------------------------------------------------------------
1 | # Load any additional property resources from a comma-delimited list
2 | idp.additionalProperties= /conf/ldap.properties, /conf/saml-nameid.properties, /conf/services.properties
3 |
4 | # Set the entityID of the IdP
5 | idp.entityID= https://idp.localhost.localdomain/idp/shibboleth
6 |
7 | # Set the scope used in the attribute resolver for scoped attributes
8 | idp.scope= localdomain
9 |
10 | # General cookie properties (maxAge only applies to persistent cookies)
11 | #idp.cookie.secure = false
12 | #idp.cookie.httpOnly = true
13 | #idp.cookie.domain =
14 | #idp.cookie.path =
15 | #idp.cookie.maxAge = 31536000
16 |
17 | # Set the location of user-supplied web flow definitions
18 | #idp.webflows = %{idp.home}/flows
19 |
20 | # Set the location of Velocity view templates
21 | #idp.views = %{idp.home}/views
22 |
23 | # Settings for internal AES encryption key
24 | #idp.sealer.storeType = JCEKS
25 | #idp.sealer.updateInterval = PT15M
26 | #idp.sealer.aliasBase = secret
27 | idp.sealer.storeResource= %{idp.home}/credentials/sealer.jks
28 | idp.sealer.versionResource= %{idp.home}/credentials/sealer.kver
29 | idp.sealer.storePassword= password
30 | idp.sealer.keyPassword= password
31 |
32 | # Settings for public/private signing and encryption key(s)
33 | # During decryption key rollover, point the ".2" properties at a second
34 | # keypair, uncomment in credentials.xml, then publish it in your metadata.
35 | idp.signing.key= %{idp.home}/credentials/idp-signing-key.pem
36 | idp.signing.cert= %{idp.home}/credentials/idp-signing-cert.pem
37 | idp.encryption.key= %{idp.home}/credentials/idp-encryption.key
38 | idp.encryption.cert= %{idp.home}/credentials/idp-encryption.crt
39 | #idp.encryption.key.2 = %{idp.home}/credentials/idp-encryption-old.key
40 | #idp.encryption.cert.2 = %{idp.home}/credentials/idp-encryption-old.crt
41 |
42 | # Sets the bean ID to use as a default security configuration set
43 | #idp.security.config = shibboleth.DefaultSecurityConfiguration
44 |
45 | # To default to SHA-1, set to shibboleth.SigningConfiguration.SHA1
46 | #idp.signing.config = shibboleth.SigningConfiguration.SHA256
47 |
48 | # Configures trust evaluation of keys used by services at runtime
49 | # Defaults to supporting both explicit key and PKIX using SAML metadata.
50 | #idp.trust.signatures = shibboleth.ChainingSignatureTrustEngine
51 | # To pick only one set to one of:
52 | # shibboleth.ExplicitKeySignatureTrustEngine, shibboleth.PKIXSignatureTrustEngine
53 | #idp.trust.certificates = shibboleth.ChainingX509TrustEngine
54 | # To pick only one set to one of:
55 | # shibboleth.ExplicitKeyX509TrustEngine, shibboleth.PKIXX509TrustEngine
56 |
57 | # If true, encryption will happen whenever a key to use can be located, but
58 | # failure to encrypt won't result in request failure.
59 | #idp.encryption.optional = false
60 |
61 | # Configuration of client- and server-side storage plugins
62 | #idp.storage.cleanupInterval = PT10M
63 | #idp.storage.htmlLocalStorage = false
64 |
65 | # Set to true to expose more detailed errors in responses to SPs
66 | #idp.errors.detailed = false
67 | # Set to false to skip signing of SAML response messages that signal errors
68 | #idp.errors.signed = true
69 | # Name of bean containing a list of Java exception classes to ignore
70 | #idp.errors.excludedExceptions = ExceptionClassListBean
71 | # Name of bean containing a property set mapping exception names to views
72 | #idp.errors.exceptionMappings = ExceptionToViewPropertyBean
73 | # Set if a different default view name for events and exceptions is needed
74 | #idp.errors.defaultView = error
75 |
76 | # Set to false to disable the IdP session layer
77 | #idp.session.enabled = true
78 |
79 | # Set to "shibboleth.StorageService" for server-side storage of user sessions
80 | #idp.session.StorageService = shibboleth.ClientSessionStorageService
81 |
82 | # Size of session IDs
83 | #idp.session.idSize = 32
84 | # Bind sessions to IP addresses
85 | #idp.session.consistentAddress = true
86 | # Inactivity timeout
87 | #idp.session.timeout = PT60M
88 | # Extra time to store sessions for logout
89 | #idp.session.slop = PT0S
90 | # Tolerate storage-related errors
91 | #idp.session.maskStorageFailure = false
92 | # Track information about SPs logged into
93 | #idp.session.trackSPSessions = false
94 | # Support lookup by SP for SAML logout
95 | #idp.session.secondaryServiceIndex = false
96 | # Length of time to track SP sessions
97 | #idp.session.defaultSPlifetime = PT2H
98 |
99 | # Regular expression matching login flows to enable, e.g. IPAddress|Password
100 | idp.authn.flows= Password
101 |
102 | # Regular expression of forced "initial" methods when no session exists,
103 | # usually in conjunction with the idp.authn.resolveAttribute property below.
104 | #idp.authn.flows.initial = Password
105 |
106 | # Set to an attribute ID to resolve prior to selecting authentication flows;
107 | # its values are used to filter the flows to allow.
108 | #idp.authn.resolveAttribute = eduPersonAssurance
109 |
110 | # Default lifetime and timeout of various authentication methods
111 | #idp.authn.defaultLifetime = PT60M
112 | #idp.authn.defaultTimeout = PT30M
113 |
114 | # Whether to prioritize "active" results when an SP requests more than
115 | # one possible matching login method (V2 behavior was to favor them)
116 | #idp.authn.favorSSO = true
117 |
118 | # Whether to fail requests when a user identity after authentication
119 | # doesn't match the identity in a pre-existing session.
120 | #idp.authn.identitySwitchIsError = false
121 |
122 | # Set to "shibboleth.StorageService" or custom bean for alternate storage of consent
123 | #idp.consent.StorageService = shibboleth.ClientPersistentStorageService
124 |
125 | # Set to "shibboleth.consent.AttributeConsentStorageKey" to use an attribute
126 | # to key user consent storage records (and set the attribute name)
127 | #idp.consent.userStorageKey = shibboleth.consent.PrincipalConsentStorageKey
128 | #idp.consent.userStorageKeyAttribute = uid
129 |
130 | # Flags controlling how built-in attribute consent feature operates
131 | #idp.consent.allowDoNotRemember = true
132 | #idp.consent.allowGlobal = true
133 | #idp.consent.allowPerAttribute = false
134 |
135 | # Whether attribute values and terms of use text are compared
136 | #idp.consent.compareValues = false
137 | # Maximum number of consent records for space-limited storage (e.g. cookies)
138 | #idp.consent.maxStoredRecords = 10
139 | # Maximum number of consent records for larger/server-side storage (0 = no limit)
140 | #idp.consent.expandedMaxStoredRecords = 0
141 |
142 | # Time in milliseconds to expire consent storage records.
143 | #idp.consent.storageRecordLifetime = P1Y
144 |
145 | # Whether to lookup metadata, etc. for every SP involved in a logout
146 | # for use by user interface logic; adds overhead so off by default.
147 | #idp.logout.elaboration = false
148 |
149 | # Whether to require logout requests be signed/authenticated.
150 | #idp.logout.authenticated = true
151 |
152 | # Message freshness and replay cache tuning
153 | #idp.policy.messageLifetime = PT3M
154 | #idp.policy.clockSkew = PT3M
155 |
156 | # Set to custom bean for alternate storage of replay cache
157 | #idp.replayCache.StorageService = shibboleth.StorageService
158 |
159 | # Toggles whether to allow outbound messages via SAML artifact
160 | #idp.artifact.enabled = true
161 | # Suppresses typical signing/encryption when artifact binding used
162 | #idp.artifact.secureChannel = true
163 | # May differ to direct SAML 2 artifact lookups to specific server nodes
164 | #idp.artifact.endpointIndex = 2
165 | # Set to custom bean for alternate storage of artifact map state
166 | #idp.artifact.StorageService = shibboleth.StorageService
167 |
168 | # Name of access control policy for various admin flows
169 | idp.status.accessPolicy= AccessByIPAddress
170 | idp.resolvertest.accessPolicy= AccessByIPAddress
171 | idp.reload.accessPolicy= AccessByIPAddress
172 |
173 | # Comma-delimited languages to use if not match can be found with the
174 | # browser-supported languages, defaults to an empty list.
175 | idp.ui.fallbackLanguages= en,fr,de
176 |
177 | # Storage service used by CAS protocol
178 | # Defaults to shibboleth.StorageService (in-memory)
179 | # MUST be server-side storage (e.g. in-memory, memcached, database)
180 | # NOTE that idp.session.StorageService requires server-side storage
181 | # when CAS protocol is enabled
182 | #idp.cas.StorageService=shibboleth.StorageService
183 |
184 | # CAS service registry implementation class
185 | #idp.cas.serviceRegistryClass=net.shibboleth.idp.cas.service.PatternServiceRegistry
186 |
187 | # Profile flows in which the ProfileRequestContext should be exposed
188 | # in servlet request under the key "opensamlProfileRequestContext"
189 | #idp.profile.exposeProfileRequestContextInServletRequest = SAML2/POST/SSO,SAML2/Redirect/SSO
190 |
191 | # F-TICKS auditing - set salt to include hashed username
192 | #idp.fticks.federation=MyFederation
193 | #idp.fticks.algorithm=SHA-256
194 | #idp.fticks.salt=somethingsecret
195 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/ldap.properties:
--------------------------------------------------------------------------------
1 | # LDAP authentication configuration, see authn/ldap-authn-config.xml
2 | # Note, this doesn't apply to the use of JAAS
3 |
4 | ## Authenticator strategy, either anonSearchAuthenticator, bindSearchAuthenticator, directAuthenticator, adAuthenticator
5 | #idp.authn.LDAP.authenticator = anonSearchAuthenticator
6 |
7 | ## Connection properties ##
8 | idp.authn.LDAP.ldapURL = ldap://shiny-openldap:389
9 | idp.authn.LDAP.useStartTLS = false
10 | #idp.authn.LDAP.useSSL = false
11 | #idp.authn.LDAP.connectTimeout = 3000
12 |
13 | ## SSL configuration, either jvmTrust, certificateTrust, or keyStoreTrust
14 | #idp.authn.LDAP.sslConfig = certificateTrust
15 | ## If using certificateTrust above, set to the trusted certificate's path
16 | #idp.authn.LDAP.trustCertificates = %{idp.home}/credentials/ldap-server.crt
17 | ## If using keyStoreTrust above, set to the truststore path
18 | #idp.authn.LDAP.trustStore = %{idp.home}/credentials/ldap-server.truststore
19 |
20 | ## Return attributes during authentication
21 | ## NOTE: there is a separate property used for attribute resolution
22 | idp.authn.LDAP.returnAttributes = passwordExpirationTime,loginGraceRemaining
23 |
24 | ## DN resolution properties ##
25 |
26 | # Search DN resolution, used by anonSearchAuthenticator, bindSearchAuthenticator
27 | # for AD: CN=Users,DC=example,DC=org
28 | idp.authn.LDAP.baseDN = ou=users,dc=ldap,dc=localhost,dc=localdomain
29 | #idp.authn.LDAP.subtreeSearch = false
30 | idp.authn.LDAP.userFilter = (uid={user})
31 | # bind search configuration
32 | # for AD: idp.authn.LDAP.bindDN=adminuser@domain.com
33 | idp.authn.LDAP.bindDN = ou=ldapadmin,ou=admins,dc=ldap,dc=localhost,dc=localdomain
34 | idp.authn.LDAP.bindDNCredential = password
35 |
36 | # Format DN resolution, used by directAuthenticator, adAuthenticator
37 | # for AD use idp.authn.LDAP.dnFormat=%s@domain.com
38 | idp.authn.LDAP.dnFormat = uid=%s,ou=users,dc=ldap,dc=localhost,dc=localdomain
39 |
40 | # LDAP attribute configuration, see attribute-resolver.xml
41 | # Note, this likely won't apply to the use of legacy V2 resolver configurations
42 | idp.attribute.resolver.LDAP.ldapURL = %{idp.authn.LDAP.ldapURL}
43 | idp.attribute.resolver.LDAP.baseDN = %{idp.authn.LDAP.baseDN:undefined}
44 | idp.attribute.resolver.LDAP.bindDN = %{idp.authn.LDAP.bindDN:undefined}
45 | idp.attribute.resolver.LDAP.bindDNCredential = %{idp.authn.LDAP.bindDNCredential:undefined}
46 | idp.attribute.resolver.LDAP.useStartTLS = %{idp.authn.LDAP.useStartTLS:true}
47 | idp.attribute.resolver.LDAP.trustCertificates = %{idp.authn.LDAP.trustCertificates:undefined}
48 | idp.attribute.resolver.LDAP.searchFilter = (uid=$resolutionContext.principal)
49 | idp.attribute.resolver.LDAP.returnAttributes = uid,sn,givenName,o,mail
50 |
51 | # LDAP pool configuration, used for both authn and DN resolution
52 | #idp.pool.LDAP.minSize = 3
53 | #idp.pool.LDAP.maxSize = 10
54 | #idp.pool.LDAP.validateOnCheckout = false
55 | #idp.pool.LDAP.validatePeriodically = true
56 | #idp.pool.LDAP.validatePeriod = 300
57 | #idp.pool.LDAP.prunePeriod = 300
58 | #idp.pool.LDAP.idleTime = 600
59 | #idp.pool.LDAP.blockWaitTime = 3000
60 | #idp.pool.LDAP.failFastInitialize = false
61 |
--------------------------------------------------------------------------------
/docker/shiny-idp/files/login.vm:
--------------------------------------------------------------------------------
1 |
2 | #if ($authenticationErrorContext && $authenticationErrorContext.getClassifiedErrors().size() > 0 && $authenticationErrorContext.getClassifiedErrors().iterator().next() != "ReselectFlow")
3 | ## This handles errors that are classified by the message maps in the authentication config.
4 | #set ($eventId = $authenticationErrorContext.getClassifiedErrors().iterator().next())
5 | #set ($eventKey = $springMacroRequestContext.getMessage("$eventId", "login"))
6 | #set ($message = $springMacroRequestContext.getMessage("${eventKey}.message", "Login Failure: $eventId"))
7 | #elseif ($authenticationErrorContext && $authenticationErrorContext.getExceptions().size() > 0)
8 | ## This handles login exceptions that are left unclassified.
9 | #set ($loginException = $authenticationErrorContext.getExceptions().get(0))
10 | #if ($loginException.getMessage())
11 | #set ($message = "Login Failure: $loginException.getMessage()")
12 | #else
13 | #set ($message = $loginException.toString())
14 | #end
15 | #end
16 |
17 |
18 |
19 |
20 |