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

[Feature] Allow changing the base URL #672

Closed
1 of 2 tasks
Corza opened this issue Feb 21, 2023 · 10 comments
Closed
1 of 2 tasks

[Feature] Allow changing the base URL #672

Corza opened this issue Feb 21, 2023 · 10 comments
Labels
feature This issue is a feature request needs votes Please upvote this feature request if you would like to see it implemented!

Comments

@Corza
Copy link

Corza commented Feb 21, 2023

Verified feature request does not already exist?

  • I have searched and found no existing issue

💻

  • Would you like to implement this feature?

Pitch: what problem are you trying to solve?

I'd like to access my Actual Budget from a subfolder on the domain such as example.com/budget

I am using SWAG reverse proxy.

Currently there is no way to set the base URL and as such, any reverse proxy used in this configuration does not work.

Describe your ideal solution to this problem

No response

Teaching and learning

No response

@Corza Corza added feature This issue is a feature request needs triage labels Feb 21, 2023
@j-f1 j-f1 removed the needs triage label Feb 23, 2023
@j-f1 j-f1 changed the title [Feature] Setting a BaseURL on Docker Image [Feature] Allow changing the base URL Feb 24, 2023
@anthonymesa
Copy link

I am willing to take a stab at a fix for this. I understand that the actual-server container uses the actual-app npm module. Since you would want the server and the client to both be available at domain.com/route, I assume this fix requires modification of both the actual-app and the actual-server?

@j-f1
Copy link
Contributor

j-f1 commented Feb 27, 2023

Sorry for the delay in replying. It would indeed require a modification of both client and server. Off the top of my head, these things would need to change:

  • URLs to the various JS/CSS/image files referenced by the HTML file (currently they all use /-prefixed URLs). This is a bit tricky because you can load up e.g. <actual-server>/accounts/budgeted and you will get back the same HTML file as if you load the home route, so regular relative URLs won’t work. This would probably have to be done on the server.
  • If the external proxy handles stripping off the base URL prefix before forwarding to the Actual server, the server would still be able to serve everything from its root. Otherwise it would have to serve all of its routes with an appropriate prefix.
  • browser-server.*.worker.js loads /kcab/kcab.worker.*.js via importScripts
  • The bootstrapping logic (Allow the server to auto-configure the server URL for the client #649) works by talking to the root of the current origin, and that would need to be set up some other way (or accept that auto-configuration is not possible when using a non-root base URL)
  • The client-side router assumes that it is running at the root, but hopefully react-router has an option to set a base URL. You’d need to audit for usage of the raw window.location API to ensure there aren’t any issues.

There are probably things that I’ve missed, but hopefully the information listed above is enough to get you up and running so you can more thoroughly test things out and find the things I forgot about :)

The existing frontend should work as-is with the API not being hosted at the root (i.e. put http://localhost:5006/foo/bar into the server config text field when first using Actual)

@asfalots
Copy link

asfalots commented Mar 20, 2023

IMHO you should use the proxy_pass option from your reverse proxy to trim the /budget from the call you made to Actual-server.
It does not need any application modification, maybe just an explanation in the documentation.

@j-f1
Copy link
Contributor

j-f1 commented Mar 20, 2023

@asfalots That’s not enough to get things working properly — the things I listed in my comment need to be changed too.

@winklevos
Copy link
Contributor

I agree, this is certainly needed

@rich-howell rich-howell added feature This issue is a feature request and removed feature This issue is a feature request labels May 1, 2023
@github-actions github-actions bot added the needs votes Please upvote this feature request if you would like to see it implemented! label May 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

✨ Thanks for sharing your idea! ✨

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution).

The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=is%3Aissue+label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc

Don’t forget to upvote the top comment with 👍!

@github-actions github-actions bot closed this as completed May 1, 2023
@razorman8669
Copy link

This is still an issue as actual doesn't use relative links, and when running actual behind a reverse proxy via paths (instead of sub domains) it doesn't work.

For my use case, I cannot run it as a subdomain and instead need to change the base URL to a custom path (ie: mydomain.com/actual) so I can run it alongside other services on the same server.

are there any developments to get configurable base URL's in actual?

@kgadberry
Copy link

I'd also like this to be implemented, if there are any developments.

@dojoca
Copy link

dojoca commented Dec 1, 2024

Really wish this was implemented... it's the last thing holding me back from using actualbudget.

@dojoca
Copy link

dojoca commented Dec 2, 2024

Have there been any developments on this? I tried the solution under the linked “don’t clobber” discussion but it didn’t work unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue is a feature request needs votes Please upvote this feature request if you would like to see it implemented!
Projects
None yet
Development

No branches or pull requests

9 participants