Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug report) "Add to homescreen" on Android sets wrong url if Trilium is run in sub-directory via reverse proxy #4702

Open
nimonimonimo opened this issue Mar 17, 2024 · 3 comments

Comments

@nimonimonimo
Copy link

Trilium Version

0.62.4

What operating system are you using?

Other (specify below)

What is your setup?

Local + server sync

Operating System Version

FreeBSD 13.2

Description

Hi,

Thanks for an amazing app.

I have been using Trilium for several months now and likes it very much. I run it on my FreeBSD server behind a reverse proxy via nginx. I run it in a sub-directory similar to the example in the documentation:

location /trilium/ {
    proxy_pass http://127.0.0.1:8080/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
} 

I have no problem connecting to it -- either from client on linux or mac os laptop -- as well as via webbrowser on any platform.

My only problem is that when I from my Android phone wants to add it as a shortcut via the browser menu: "Add to homescreen" it will be added with url consisting of only the domain name without the sub-directory. I believe this is because the generated "manifest.webmanifest"-file which looks like this:

{
  "name": "Trilium Notes",
  "short_name": "Trilium",
  "description": "Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases.",
  "theme_color": "#333333",
  "background_color": "#1F1F1F",
  "display": "standalone",
  "scope": "/",
  "start_url": "/",
  "icons": [
    {
      "src": "/assets/vX/images/app-icons/ios/apple-touch-icon.png",
      "sizes": "180x180",
      "type": "image/png"
    },
    {
      "src": "/assets/vX/images/app-icons/png/512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]

I suspect that "scope" or "start_url" should include "/trilium".

Would it be possible to add support for this?

Thanks in advance!

Error logs

No response

@Nriver
Copy link
Contributor

Nriver commented Mar 17, 2024

Samsung browser works fine. This should be an issue with your browser app.

@nimonimonimo
Copy link
Author

This is with the Chrome browser. Tried on two different Android phones.

@Nriver are you also running it in a sub-directory? Could you paste the manifest.webmanifest-file?

@Nriver
Copy link
Contributor

Nriver commented Mar 21, 2024

I believe I've identified the issue. It seems to be related to the Android launcher. Currently, I'm using a third-party launcher called "Nova Launcher," and the shortcuts function smoothly with both the Samsung browser and Chrome browser. However, when I switch back to the default launcher on my phone, the shortcuts behave as you described.

So, you might want to change your launcher app now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants