gramps-web icon indicating copy to clipboard operation
gramps-web copied to clipboard

Feature Request: Enable hosting on sub path

Open schinivision opened this issue 1 year ago • 1 comments

It would be great if it could be possible to enable hosting on a subpath e.g. https://www.awesome-project.io/gramps-web

There is the possibility by using some nginx trickery to replace / extend most paths.

sub_filter_last_modified off;
# add base path to all static resources
sub_filter '<base href="/">' '<base href="/gramps-web/">';
sub_filter 'href="/' 'href="';
sub_filter 'src="/' 'src="';
#change path in manifest.js
sub_filter '"start_url": "/"' '"start_url": "/gramps-web/"';
# set types of files to 'sub-filter'
sub_filter_once off;
sub_filter_types text/html application/json text/css text/javascript application/javascript;
```

but as it seems the compiled js with the api calls has no configuration point for such a path.

Also changing the environment variable BASE_URL or GRAMPSWEB_BASE_URL had no effect when using the gramps-web container

Thanks for the great work

schinivision avatar Nov 20 '24 20:11 schinivision

I remember at some point we tried to make this work but it was a huge hassle to maintain and made a lot of things more complicated. If somebody volunteers to implement this without breaking anything I think it would be nice to have, so I'll leave this PR open. In the meantime, I recommend using subdomains (https://gramps-web.awesome-project.io).

DavidMStraub avatar Nov 23 '24 20:11 DavidMStraub

Closing to limit scope.

DavidMStraub avatar Sep 24 '25 08:09 DavidMStraub