bioatlas / ala-docker

Dockerized version of Atlas of Living Australia components
GNU Affero General Public License v3.0
12 stars 12 forks source link

Trouble with CAS locally #35

Closed IuriGarcia closed 5 years ago

IuriGarcia commented 5 years ago

Hello!

I'm trying to add CAS to my cluster and im testing it locally. this is how my docker-compose looks like:

version: '3.7'

services:
  cas:
    image: cas
    ports:
      - 8080:8080
      - 8089:8443
    volumes:
      - ./config/cas.properties:/tmp/cas.properties
    command: /bin/ash -c  "sleep 80 && envsubst < /tmp/cas.properties > /data/cas/config/cas.properties && catalina.sh run"
    links:
      - mysqldbcas
    depends_on:

      - mysqldbcas

  mysqldbcas:
    image: mysql:5.7
    env_file: ./env/envcas.template
    container_name: mysqldbcas
    volumes:
      - ./db:/docker-entrypoint-initdb.d
      - db_data_mysqldbcas:/var/lib/mysql

  userdetails:
    image: userdetails
    container_name: userdetails
    domainname: localhost
    env_file: ./env/.envcas
    volumes:
      - ./config/userdetails-config.properties:/tmp/userdetails-config.properties 
    command: /bin/ash -c "sleep 80 && envsubst < /tmp/userdetails-config.properties > /data/userdetails/config/userdetails-config.properties && catalina.sh run"
    depends_on:

      - mysqldbcas

volumes:
  cas_data:
  mongodb_data:
    driver: local
  db_data_mysqldbcas:

i've created the images with the Dockerfiles. I dont know how to correctly setup the conf files. My CAS container keeps showing that

cas_1 | 2019-04-17 21:53:03,369 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 1 services.> cas_1 | 2019-04-17 21:55:02,991 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Reloading registered services.> cas_1 | 2019-04-17 21:55:02,992 DEBUG [org.jasig.cas.services.DefaultServicesManagerImpl] - <Adding registered service ^(https?|imaps?)://.*> cas_1 | 2019-04-17 21:55:02,992 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 1 services.> cas_1 | 2019-04-17 21:57:02,991 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Reloading registered services.> cas_1 | 2019-04-17 21:57:02,991 DEBUG [org.jasig.cas.services.DefaultServicesManagerImpl] - <Adding registered service ^(https?|imaps?)://.*> cas_1 | 2019-04-17 21:57:02,992 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 1 services.>

And i cant accesse cas throw localhost:8089/cas/login

shahmanash commented 5 years ago

The compose looks fine to me. The issue however looks to be related to <Adding registered service ^(https?|imaps?)://.*>

In the tomcat running the CAS, could you compare the file server.xml with this one https://github.com/bioatlas/ala-docker/blob/develop/cas2/server.xml

In the CAS image we use, we have added the modified server.xml to support SSL, could you check it in your image.

In our image, the tomcat handles SSL also on 8080 , as configured in the server.xml file.

For the routing, have a look at https://github.com/bioatlas/ala-docker/blob/develop/webserver/app.conf#L142-L172

The CAS used in our case is based on CAS2 (older version of CAS)

https://github.com/bioatlas/ala-cas-2.0

Also note that the userdetails compatible with CAS2 is also a bit older

https://github.com/bioatlas/userdetails/tree/bioatlas-ver-1.0

IuriGarcia commented 5 years ago

OK, i've changed my server.xml to be equal to the one used in cas2 in the develop branch. However it started to throw

java.lang.ClassNotFoundException: org.apache.catalina.core.JasperListener

So i did comment the line https://github.com/bioatlas/ala-docker/blob/develop/cas2/server.xml#L30-L31 wich leaded me back to the previous error.

shahmanash commented 5 years ago

Can you post the Dockerfile you are using to create the cas image. Are you using tomcat7 or tomcat8 ?

IuriGarcia commented 5 years ago

OH! tomcat 7!! I just forgot that i was trying to use tomcat 8!! thank you so much! now it is working fine!