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

Allow configuration of web root #18

Closed
kungfoolfighting opened this issue Jun 25, 2023 · 10 comments
Closed

Allow configuration of web root #18

kungfoolfighting opened this issue Jun 25, 2023 · 10 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kungfoolfighting
Copy link

Hello,
I would like to be able to reach OSL via something like https://myserver/osl/ rather than having to configure a different hostname for this service or a different port.
I have tried creating clever nginx reverse proxy rules to achieve this by rewriting the contents of all the source files before they are served to the clients. This has been a bunch of work and still doesn't support every necessary function.
It would be great if this could be added as a configuration parameter, where you can configure the webroot yourself. For example to "osl".
I hope this would not be too difficult to do.
Thanks for this great project. We have been using it for the last months and it is exactly what I was looking for: A lightweight app, that we can use to coordinate our in-store shopping and planning.

@nanawel
Copy link
Owner

nanawel commented Jun 25, 2023

Hi, and thanks very much :)

Hopefully that should not be too hard indeed. I'll take a look very soon.

@nanawel nanawel added enhancement New feature or request good first issue Good for newcomers labels Jun 25, 2023
@nanawel nanawel self-assigned this Jun 25, 2023
@nanawel
Copy link
Owner

nanawel commented Jun 27, 2023

@kungfoolfighting The latest release 2.7.0 should now support what you need.

https://github.com/nanawel/our-shopping-list/releases/tag/2.7.0

If you're serving multiple instances on the same host, please read https://github.com/nanawel/our-shopping-list#-notes-when-serving-multiple-instances-on-different-web-roots

@nanawel nanawel closed this as completed Jun 27, 2023
@kungfoolfighting
Copy link
Author

Oh wow, thanks a bunch for the super speedy implementation of this! Greatly appreciated. I will give it a try today.

@kungfoolfighting
Copy link
Author

kungfoolfighting commented Jun 27, 2023

I have tested this now and I can't quite get it to work with a reverse proxy.
When simply connecting to the server via the port and the base url like this:
http://myserver:port/osl/ it works flawlessly.
But when using a reverse proxy (nginx) with the following configuration:

    location /osl/ {
            proxy_set_header Accept-Encoding "";
            proxy_pass http://myserver:port;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_http_version 1.1;
        }

It loads almost everything but doesn't show any boards.
The console shows:
chunk-vendors.59332c6d.js:1 GET http://myserver/boards/00000000-0000-0000-0000-000000000000 404 (Not Found)

So it is not using the base url for that specific request. Other requests do use the base url (for images and scripts etc.).
Any idea if I am doing something wrong, or is there still an issue with the feature?
Sorry for causing more work with this :(

@nanawel
Copy link
Owner

nanawel commented Jun 27, 2023

Hi,
np, there might be some details missing even if I tried to cover all the possible cases.

You did not mention you set the BASE_URL in your container. Did you?
This is mandatory. If you're serving the app on a custom web root, you have to set this variable in your environment section:

services:
  app:
    image: ...
    ...
    environment:
      BASE_URL: '/osl/'

@kungfoolfighting
Copy link
Author

Oh yeah, sorry, I omitted mentioning that, since I thought the non-proxy version would not work at all with that url if I hadn't set the base url.

It looks like this:

    environment:
      # Default values below
      VUE_APP_I18N_LOCALE: en
      VUE_APP_I18N_FALLBACK_LOCALE: en
      VUE_APP_I18N_FORCE_LOCALE: 0
      VUE_APP_SINGLEBOARD_MODE: 1
      VUE_APP_LIST_ALL_BOARDS_ENABLED: 1
      BASE_URL: 'osl/'

@kungfoolfighting
Copy link
Author

Also small correction: since I am in single board mode I should have said "it doesn't list any lists" rather than "it doesn't list any boards".

@nanawel
Copy link
Owner

nanawel commented Jun 27, 2023

Also small correction: since I am in single board mode I should have said "it doesn't list any lists" rather than "it doesn't list any boards".

You're right. There seems to be a bug with singleboard mode. Let me take a look.

@nanawel
Copy link
Owner

nanawel commented Jun 29, 2023

That should be fixed now with 2.7.1. Tell me if it works as expected in your environment.

@kungfoolfighting
Copy link
Author

Works great now, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants