kartoza / docker-geoserver

A docker recipe for GeoServer
GNU General Public License v2.0
628 stars 423 forks source link

Getting 404 trying to reach geoserver served under multipart GEOSERVER_CONTEXT_ROOT #562

Closed aceenprsu closed 1 year ago

aceenprsu commented 1 year ago

What is the bug or the crash?

I am getting a 404 trying to use the functionality introduced in https://github.com/kartoza/docker-geoserver/pull/553

Steps to reproduce the issue

Below is a link to my fork where I copied the context test and added a multipart path to it. https://github.com/aceenprsu/docker-geoserver/commit/2a6cc037c7c3475687d1a21333d3862063e60cc6 This is the output I get from trying to run the contexts test:

GEOSERVER_ADMIN_PASSWORD: myawesomegeoserver
GEOSERVER_ADMIN_USER: admin
test_rest_endpoints_accessible (test_login.TestGeoServerREST) ... FAIL

======================================================================
FAIL: test_rest_endpoints_accessible (test_login.TestGeoServerREST)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tests/test_login.py", line 28, in setUp
    self.assertEqual(response.status_code, 200)
AssertionError: 404 != 200

----------------------------------------------------------------------
Ran 1 test in 0.009s

FAILED (failures=1)

Versions

2.23.2

Additional context

No response

NyakudyaA commented 1 year ago

@m4ci3k2 can you please confirm if this is a bug or this logic only works for one folder not nested folders

m4ci3k2 commented 1 year ago

@NyakudyaA @aceenprsu sorry, actually I was wrong as the "problem" that the MR solved does not exist (but the mkdir is harmless of course). To install a tomcat application on a multipart path the WAR/folder has to be named directory#name.war, so for example to have geoserver under path some-path you can set GEOSERVER_CONTEXT_ROOT=some-path#geoserver.

This is a built-in Tomcat function.

Sorry for the confusion.