autobrr/internal/http
KaiserBh 4432dfb099
feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298)
* refactor: remove baseUrl from api calls and sseBaseUrl

* refactor: set cookie session to '/'.

Since that's where the api endpoint is that way we set it to the root domain, we can't set it to the subfolder since the api is called directly now and not using the baseUrl.

* feat: add the baseUrl route.

When user for example is in `/autobrr` and hit reload it should just return the index.html.

* refactor: now it have to be `/autobrr`

Remove the trailing `/`, now base url is set to /autobrr aligned with other arrs.

* refactor: remove baseUrl stuff.

* refactor: use separate router for the api endpoint and the baseUrl.

I don't think we need separate router, but I didn't test it, so feel free to test it and see if it works without the separate router, the whole point was to make sure that it's not prefixed with baseUrl and I noticed that it was being called in the frontend `APIClients.ts`. So yea just check if it works without it then keep the old one.

Also removed the index since it was zombie code not being used anywhere.

* feat: Dynamic base url.

* fix: auth handler deps

* feat(http): mount web and api on baseurl

* feat(http): web api client routes

* feat(http): baseurl legacy mode

* feat(http): baseurl legacy mode test

* feat(http): add assetBaseUrl

* feat(http): try separate web handlers

* feat(http): improve file serving

* feat(http): ignore .gitkeep

* fix(assets): windows paths

* fix(assets): windows paths trimprefix

* fix(assets): windows paths join

* fix(assets): cleanup

* fix(assets): additional web route check

* feat(http): add comments

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-19 12:56:04 +01:00
..
action.go feat(http): implement missing findByID methods (#1635) 2024-08-29 12:22:03 +02:00
apikey.go feat(http): implement missing findByID methods (#1635) 2024-08-29 12:22:03 +02:00
auth.go fix(http): downgrade canOnboard check to warning log level (#1859) 2024-12-06 13:01:45 +01:00
auth_test.go feat(tests): add Parallelization where possible (#1823) 2024-11-23 15:16:09 +01:00
config.go chore: update license header year (#1332) 2024-01-01 16:21:02 +01:00
download_client.go feat(http): implement missing findByID methods (#1635) 2024-08-29 12:22:03 +02:00
encoder.go fix(http): downgrade canOnboard check to warning log level (#1859) 2024-12-06 13:01:45 +01:00
feed.go feat: add support for proxies to use with IRC and Indexers (#1421) 2024-09-02 11:10:45 +02:00
filter.go feat(filters): sort by created and updated (#1751) 2024-10-04 15:02:27 +02:00
health.go chore: update license header year (#1332) 2024-01-01 16:21:02 +01:00
indexer.go feat(http): implement missing findByID methods (#1635) 2024-08-29 12:22:03 +02:00
irc.go feat: add support for proxies to use with IRC and Indexers (#1421) 2024-09-02 11:10:45 +02:00
logs.go refactor(logs): move sanitize (#1636) 2024-08-29 12:38:49 +02:00
middleware.go fix(auth): cookie expiry and renewal (#1527) 2024-05-08 10:38:02 +02:00
notification.go fix(notifications): disable notification and events have no effect (#1754) 2024-10-06 14:12:01 +02:00
proxy.go feat: add support for proxies to use with IRC and Indexers (#1421) 2024-09-02 11:10:45 +02:00
release.go feat(releases): show indexer name instead of identifier (#1706) 2024-09-03 14:57:48 +02:00
server.go feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298) 2024-12-19 12:56:04 +01:00
update.go chore: update license header year (#1332) 2024-01-01 16:21:02 +01:00
web.go feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298) 2024-12-19 12:56:04 +01:00
web_legacy.go feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298) 2024-12-19 12:56:04 +01:00