Skip to content

Conversation

@Fly7113
Copy link
Contributor

@Fly7113 Fly7113 commented Sep 15, 2025

As a followup from #6782, here are the proposed changes to make AIO interface work relative to the browser location, without assuming the interface resides on the root path of the domain.
The changes can be summarised in:

  • links in Twig templates: all the frontend links have been changed to be relative
  • paths in location headers: (almost) all the location headers now redirect to the same page from where the request originated, which is (almost) always the "/container" page.
  • getting the AIO path to inform Nextcloud of the correct location of the interface: a new frontend script collects and sends the path to the backend via the "start" button.

I tested every basic usage, including unauthenticated situations (which require a particular logic, as seen in the AuthMiddleware.php file) and modifying the settings.

@Fly7113
Copy link
Contributor Author

Fly7113 commented Sep 15, 2025

Hm, I tired to squash the commits but it looks like I did something wrong... I hope this doesn't create confusion.

@szaimen szaimen added 3. to review Waiting for reviews enhancement New feature or request labels Sep 15, 2025
@szaimen szaimen added this to the next milestone Sep 15, 2025
@szaimen
Copy link
Collaborator

szaimen commented Sep 15, 2025

First of all, thanks for creating this PR!

Hm, I tired to squash the commits but it looks like I did something wrong... I hope this doesn't create confusion.

Squashing is not necessarily needed but can you please rebase the branch from main? This would be important. Thanks in advance!

@Fly7113 Fly7113 force-pushed the aio-interface-relative branch 2 times, most recently from ebea0e8 to e4a0e1f Compare September 15, 2025 23:00
@Fly7113
Copy link
Contributor Author

Fly7113 commented Sep 15, 2025

Rebased!
And squashed commits, so that the older and outdated commits (relative to my old work) are not visible. Less confusion!

@Fly7113 Fly7113 force-pushed the aio-interface-relative branch from 5643f2b to 5190855 Compare September 18, 2025 10:41
@Fly7113
Copy link
Contributor Author

Fly7113 commented Sep 18, 2025

Today, with the release of v11.8.0, I had the chance to test also the update process, and everything went smoothly!

@szaimen
Copy link
Collaborator

szaimen commented Sep 19, 2025

Thanks a lot for your effort!

Just to be clear: I try to review it in the coming 1-2 weeks and try to include it for the next major version which is planned to be released in ca 1 month.

Copy link
Collaborator

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I finally had the time to have a look at this and have some comments below.

Have you already tested your changes btw and ensured that a default installation in a root dir still works?

@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Oct 14, 2025
@Fly7113 Fly7113 force-pushed the aio-interface-relative branch from a019fbf to 72942a1 Compare October 14, 2025 11:31
@Fly7113
Copy link
Contributor Author

Fly7113 commented Oct 14, 2025

Hello, thanks for finding the time to check it out.
I tested throughly in my "subfoldered" instance (daily driving it), and I also had the occasion to test it in a fresh environment without a base path.

I understand that the relative "Location" header can be confusing at times, especially since it's kind of a new feature: the HTTP spec has been updated in June 2014 to allow relative URIs in the "Location" header RFC 7231

Let me know what you think about the improved logic in the "Auth" middleware: I made the root scenario the first if case and added comments to explain the logic.

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

Labels

2. developing Work in progress enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants