diff --git a/shinyproxy/defaults/main.yml b/shinyproxy/defaults/main.yml index 637b0d5..7fd569e 100644 --- a/shinyproxy/defaults/main.yml +++ b/shinyproxy/defaults/main.yml @@ -7,3 +7,14 @@ shinyproxy_app_name: shinyproxy.jar shinyproxy_user: shinyproxy shinyproxy_install_dir: /opt/shinyproxy shinyproxy_http_port: 8080 + +shinyproxy_app_title: 'Open Analytics Shiny Proxy' +shinyproxy_logo_url: 'http://www.openanalytics.eu/sites/www.openanalytics.eu/themes/oa/logo.png' +shinyproxy_authentication: ldap +shinyproxy_admin_group: '' +shinyproxy_ldap_server: 'ldap://ldap.forumsys.com:389/dc=example,dc=com' +shinyproxy_ldap_admin: cn=read-only-admin,dc=example,dc=com +shinyproxy_ldap_admin_pwd: password +shinyproxy_user_dn_pattern: 'uid={0}' +shinyproxy_group_search_base: '' +shinyproxy_group_search_filter: '(uniqueMember={0})' diff --git a/shinyproxy/handlers/main.yml b/shinyproxy/handlers/main.yml new file mode 100644 index 0000000..5e3b523 --- /dev/null +++ b/shinyproxy/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: Restart shinyproxy + service: name=shinyproxy state=restarted diff --git a/shinyproxy/tasks/main.yml b/shinyproxy/tasks/main.yml index 614f88a..b66a1f1 100644 --- a/shinyproxy/tasks/main.yml +++ b/shinyproxy/tasks/main.yml @@ -17,6 +17,11 @@ template: src=upstart-shinyproxy.conf.j2 dest=/etc/init/shinyproxy.conf owner=root group=root mode=0644 when: is_trusty + - name: Install the shinyproxy configuration file + template: src=shinyproxy-conf.yml.j2 dest={{ shinyproxy_install_dir }}/application.yml owner=root group={{ shinyproxy_user }} mode=0640 + notify: Restart shinyproxy + tags: [ 'shinyproxy', 'shinyproxy_conf' ] + - name: Ensure that the shinyproxy service is enabled and running service: name=shinyproxy state=started enabled=yes diff --git a/shinyproxy/templates/shinyproxy-conf.yml.j2 b/shinyproxy/templates/shinyproxy-conf.yml.j2 new file mode 100644 index 0000000..5bc848c --- /dev/null +++ b/shinyproxy/templates/shinyproxy-conf.yml.j2 @@ -0,0 +1,40 @@ +shiny: + proxy: + title: {{ shinyproxy_app_title }} + logo-url: {{ shinyproxy_logo_url }} + landing-page: / + heartbeat-rate: 10000 + heartbeat-timeout: 60000 + port: 8080 + authentication: {{ shinyproxy_authentication }} + admin-groups: {{ shinyproxy_admin_group }} + # LDAP configuration + ldap: + url: {{ shinyproxy_ldap_server }} + user-dn-pattern: {{ shinyproxy_user_dn_pattern }} + group-search-base: {{ shinyproxy_group_search_base }} + group-search-filter: {{ shinyproxy_group_search_filter }} + manager-dn: {{ shinyproxy_ldap_admin }} + manager-password: {{ shinyproxy_ldap_admin_pwd }} +# Docker configuration + docker: + cert-path: /home/none + url: http://localhost:2375 + host: 127.0.0.1 + port-range-start: 20000 + apps: + - name: 01_hello + display-name: Hello Application + description: Application which demonstrates the basics of a Shiny app + docker-cmd: ["R", "-e shinyproxy::run_01_hello()"] + docker-image: openanalytics/shinyproxy-demo + groups: scientists, mathematicians + - name: 06_tabsets + docker-cmd: ["R", "-e shinyproxy::run_06_tabsets()"] + docker-image: openanalytics/shinyproxy-demo + groups: scientists + +logging: + file: + shinyproxy.log + diff --git a/shinyproxy/templates/upstart-shinyproxy.conf.j2 b/shinyproxy/templates/upstart-shinyproxy.conf.j2 index 1519b12..93c4b4b 100644 --- a/shinyproxy/templates/upstart-shinyproxy.conf.j2 +++ b/shinyproxy/templates/upstart-shinyproxy.conf.j2 @@ -10,4 +10,8 @@ respawn limit 10 5 setuid {{ shinyproxy_user }} setgid {{ shinyproxy_user }} -exec java -jar {{ shinyproxy_install_dir }}/{{ shinyproxy_app_name }} +script + cd {{ shinyproxy_install_dir }} + exec java -jar ./{{ shinyproxy_app_name }} +end script +