passbolt/passbolt_docker

404 on /js/ resources when using APP_BASE (passbolt:latest-ce-non-root on docker-compose)

Closed this issue ยท 6 comments

What you did ๐Ÿ“

  • Fresh setup using docker-compose using passbolt/passbolt:latest-ce-non-root (774175666e29)
  • local /etc/hosts modified to point www.passbolt.local to the docker host
  • docker-compose.yml downloaded (SHA256SUM 3ff1cb219ae028293ba29f808d0ed17695aeb69a3baa9399194c214881f6409e)
  • docker-compose adapted to contain APP_BASE and APP_FULL_BASE_URL:
[...]
    environment:
      APP_BASE: /passbolt
      APP_FULL_BASE_URL: https://www.passbolt.local
      DATASOURCES_DEFAULT_HOST: "db"
[...]
  • ran docker compose up
  • page is not loading due to javascript not being loaded
  • docker compose down
  • comment out APP_BASE
  • docker compose up
  • loading the page (now without /passbolt/) succeeds

What happened ๐Ÿ’ฅ ๐Ÿ“‹

When opening the URL https://www.passbolt.local/passbolt/ I only get white pages, and the docker compose logs are showing those 404 errors:

passbolt-passbolt-1  | 192.168.121.1 - - [27/Jul/2022:06:58:13 +0000] "GET /passbolt/js/app/stylesheet.js?v=3.6.0 HTTP/2.0" 404 1444 "https://www.passbolt.local/passbolt/auth/login?redirect=%2F" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"
passbolt-passbolt-1  | 192.168.121.1 - - [27/Jul/2022:06:58:13 +0000] "GET /passbolt/js/app/api-vendors.js?v=3.6.0 HTTP/2.0" 404 1444 "https://www.passbolt.local/passbolt/auth/login?redirect=%2F" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"
passbolt-passbolt-1  | 192.168.121.1 - - [27/Jul/2022:06:58:13 +0000] "GET /passbolt/js/app/api-triage.js?v=3.6.0 HTTP/2.0" 404 1444 "https://www.passbolt.local/passbolt/auth/login?redirect=%2F" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"

The page itself seems to load, but as all of the javascript is broken, it does not show anything. Here is the output of curl against the page (ignoring the self-signed certificate)

$ curl -sk https://www.passbolt.local/passbolt/auth/login|head -n 15
<!doctype html>
<html class="passbolt no-js version launching no-passboltplugin" lang="en">
<head>
    <meta charset="utf-8"/>
    <title>Passbolt | Open source password manager for teams</title>
    <!--

        ____                  __          ____
       / __ \____  _____ ____/ /_  ____  / / /_
      / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
     / ____/ /_/ (__  )__  ) /_/ / /_/ / / /_
    /_/    \__,_/____/____/_.___/\____/_/\__/

    Open source password manager for teams
    Copyright (c) Passbolt SA (https://www.passbolt.com)

What you expected to happen

The page should load properly.

Just tested again using the rootfull containers (passbolt/passbolt:latest-ce, 7f2c57bf190a) and I see the same behaviour.

@johanneskastl I think the issue is that APP_BASE is for the subdirectory on the server. Try leaving APP_BASE as default and setting APP_FULL_BASE_URL to the full url with path. If you need further assistance and determine this is not a bug, we can help in the forum.

Try leaving APP_BASE as default and setting APP_FULL_BASE_URL to the full url with path.

That does not work either. I still get 404s on the /js/ resources.

I can see that the error messages and the html code now contains links to the URL with the /passbolt URL, i.e. those are built from the APP_FULL_BASE_URL.

It seems that the APP_FULL_BASE_URL is also being used to reference the JS resources, i.e. it contains the /passbolt subdirectory:

<script src="https://passbolt.local/passbolt/js/app/api-vendors.js?v=3.6.0" cache-version="3.6.0"></script><script src="https://passbolt.local/passbolt/js/app/api-triage.js?v=3.6.0" cache-version="3.6.0"></script></body>

@johanneskastl Your original post settings were working as they should although it was not as you expected. Compared to default settings which I'm assuming did not meet what you needed, what are you hoping to do?

Also see here for full settings that can help with less common situations https://github.com/passbolt/passbolt_api/blob/master/config/app.default.php

dlen commented

Thanks a lot for your report!

This should be fixed with the latest release of the debian package passbolt/passbolt_api@e46f868 . Reopen if necessary.