datajoint / datajoint-labbook

DataJoint LabBook is a graphical user interface built using React to facilitate working with DataJoint computational pipelines.
https://datajoint.com/docs/core/datajoint-labbook
MIT License
11 stars 14 forks source link

'/login' endpoint 404 #160

Open ixcat opened 2 years ago

ixcat commented 2 years ago

Running labbook for internal user demo project (k8s/ingress-nginx) and MAP (traefik in docker mode) yields a 404 for the '/login' route which is returned after logout; routes appear correct w/r/t 'reference' docker-compose-deploy.yaml; was not able to regression test with this configuration due to certificate issue. Can adjust routes on deployments, but would be good to confirm this is expected and/or ensure proper functionality in 'reference' configuration

can provide runtime configuration / live URL's out of band for review (project related / should be private)

tag @kabilar to keep in the loop w/r/t user demo project

guzman-raphael commented 2 years ago

@ixcat Thanks for the report. For the k8s/ingress-nginx one, appears as if the rewrites on the frontend routes are not working properly. We likely need to include the rewrite logic there as well in the config.

See pharus vs labbook.

ixcat commented 2 years ago

thanks @guzman-raphael -

applied with:

$ git diff labbook/ingress.yaml 
diff --git a/k8s/ev-env/labbook/labbook/ingress.yaml b/k8s/ev-env/labbook/labbook/ingress.yaml
index 37df599..09f9f6f 100644
--- a/k8s/ev-env/labbook/labbook/ingress.yaml
+++ b/k8s/ev-env/labbook/labbook/ingress.yaml
@@ -4,7 +4,7 @@ kind: Ingress
 metadata:
   name: labbook-ui
   annotations:
-    nginx.ingress.kubernetes.io/rewrite-target: /
+    nginx.ingress.kubernetes.io/rewrite-target: /$1
     nginx.ingress.kubernetes.io/ssl-redirect: "true"
     # cert-manager.io/cluster-issuer: letsencrypt-staging
     cert-manager.io/cluster-issuer: letsencrypt-prod
@@ -13,7 +13,7 @@ spec:
   - host: ev3b-labbook.datajoint.io
     http:
       paths:
-      - path: /
+      - path: /(.*)
         backend:
           serviceName: labbook-ui
           servicePort: http

to same effect

i'm fairly certain i encountered this on the local setup in the past but http container cert is out of date so don't have a way to easily check.

can we confirm local is OK 1st?

guzman-raphael commented 2 years ago

@ixcat I see. Let me check what deploy manifests I may have and verify the issue/solution. There might be 'layered' nginx's here and I may be getting confused on the context.

ixcat commented 2 years ago

update: was running on base nginx image - adjusting base nginx default.conf as proposed elsewhere resolves the error:

sed -e 's|location /|location ~ /(.*)|g' \
    -e 's|index  index.html index.htm;|index  index.html index.htm;\n\ttry_files $uri /index.html;|g' \
    /etc/nginx/conf.d/default.conf > /etc/nginx/conf.d/default.conf.tmp-$$ \
    && mv /etc/nginx/conf.d/default.conf.tmp-$$ /etc/nginx/conf.d/default.conf