Alternative address for links that access shared resources

Some time ago, a feature was first proposed in discussion, but despite the strong reasons for its appeal, all opened issues and discussions, related to the feature, apparently have been closed eventually, without any resolution for implementing the requested feature. See below for references.

When a resource is shared publicly, for direct access through a web address, Nextcloud generates an address from the concatenation of the canonical site address, a fixed path internal to the application (usually simply /s), and a further opaque identifier unique to the shared resource.

Practically, the resulting link is much more weighty and cumbersome than frequently desired. Whereas web sites often are accessed through redirection from shorter addresses, shared links are provided to the user, to be copied in their entirety.

The proposed feature would allow for the configuration of an alternative address prefix, generally involving a separate domain with an abbreviated name, to be used for generation of links that access shared resources.

The site administrator would be responsible for configuring the virtual domains or reverse proxies that allow the application to be accessed through the alternative address, and for designating within the application, Nextcloud, the particular address as special for access to shared resources.

Based on the assumption that the application is accessible through the configured alternative address, shared links would be displayed by the application as generated from the alternative address as prefix, with appended the opaque identifier unique to the shared resource. The fixed internal path would be omitted in the case that an alternative address is configured for such use.

Thus, with such a feature, instead of a shared link being presented as, for example, https://www.myawesomecompany.com/s/EdjzXT7z6TDPtiw, it could be rather https://awe.io/EdjzXT7z6TDPtiw.

(As an aside, the unique identifier, apparently generated as a sequence of fourteen mixed-case alphanumeric characters, is much longer than practically necessary. Consider the advantages of an even shorter address, such as https://awe.io/EdjzXT7.)


Maybe you can use a reverse proxy for rewrite url.

The essence of the proposed feature is that an application instance would recognize different base addresses for regular application access versus generated links to publicly shared resources.

Presently, such links share the same base address as the addresses for regular access.

Yes, the address is only concealed.

Using such a feature would require appropriate overall site administration, but the desired behavior also requires implementation within the application.

An alternative address for links accessing shared resources is a backup or secondary URL. It ensures users can still reach the resource if the primary link fails or is unavailable. This improves reliability and user experience.

The proposed feature would demand that the application distinguish between the preferred base address for regular application access, versus, for access to shared resources, a further optional base address.

Please review the references to earlier discussions.

The proposed feature, as well as the surrounding discussion, are serious and robust.

In the unlikely event that the DNS goes down for a particular domain or what? It doesn’t help for anything else, because if the server or some of the relevant services like web server, database etc. go down both domains / URLs won’t work.

And how would that improve the user experience if people had to deal with multiple domain names and links? Quite the opposite would probably the case in most cases.

What is the use case for this? Marketing? Security by obscurity to hide the “real” domain name?

For the former there are URL shortener services, there are also some that you can host yourself. Or maybe someone can develop an app for this to automate it somehow and integrate it into Nextcloud.

Ah, and now your’re using this thread to advertise dubious apps? :wink:

Again, I don’t know your use cases. But maybe Nextcloud is just not the right product for those usecases!?

Nextcloud is not a CMS or hosting platform, or a storage backend for file sharing services or content for websites or other web services. It is also not a CDN or URL shortener or UTM bulider for tracking links etc etc…

Nextcloud is a file sync, groupware and productivity suite that aims to be a replacement for M365 or Google Workspace. And developing and maintaining all these features already takes up more than enough resources.

So I don’t see why the Nextcloud developers should be wasting time developing features that their direct competitors don’t have either, and for which there are already more than enough services and products out there that are likely better suited.

If you absolutely want to have this in Nextcloud, why not develop an app for it, and if you can’t do it yourself, hire someone that can do it?

@brainchild @maliksaab1122

I see it similarly to @bb77.

The benefit is small and it is strange that very large Nextcloud providers with millions of users, such as MagentaCLOUD oder Shadow Drive, do not need this functions. This applies to two names or the concealment or shortening of addresses. To shorten addresses, you can connect two names to one Nextcloud. To shorten urls i use a private php-url-shortener with php redirect. If you are interested I can post my 16 line programme for redirects.

Nextcloud is also a web application made from HTML, CSS and JavaScript. Ok the server side PHP is not seen from the user. If you think you want to hide something, perhaps you shouldn’t rely on free software or web solutions. Just write something in C++ and compile it. Then you might be able to hide the content better.

1 Like

Yes, and then they also want shorter links, which would make it less secure again. And other users with similar requests in other threads even want the real filename in the links, which can be a privacy issue.

So I ask myself, why do people want this? Nobody types URLs by hand anywhere. People click on them, or they scan a QR code, or they copy and paste them. The only use case I can think of where URLs might need to be shortened is for QR codes that are meant for print media, especially classic newspaper media where you can’t print in high resolution. Other than that, I can’t see any, so I can only assume it would be purely for aesthetic reasons. :wink:

Well. In my case, I use shortened urls very intensively. And with my software, it doesn’t matter whether it’s a Nextcloud share or simply a bookmark that I can’t or don’t want to remember. Sometimes I don’t care whether the links are really secure. And yes maybe my script, my file and the links are a security problem.

Here a full example of my php redirect with two links. You need file.txt, .htaccess and index.php in the same folder e.g. l. Maybe someone needs this script.

file.txt

https://help.nextcloud.com;forum
https://mycloud.server.tld./s/abcdefghijklmno;secretshare

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_URI}      !index.php [NC]
RewriteRule ^(.*)$ index.php?p=$1 [NC,L,QSA]

index.php

<?php
$output = "https://www.google.de";

if (isset($_GET['p'])) {
    $input = trim($_GET['p']);
    $filename = 'file.txt';
    if (file_exists($filename)) {
        $lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
        foreach ($lines as $line) {
            list($name, $link) = explode(";", $line);
            if ($input === trim($name)) {
                $output = trim($link);
                break;
            }
        }
    }
}
header("Location: " . $output, true, 301);
exit();
?>

Call:

https://myserver.server.tld/l/forum
https://myserver.server.tld/l/secretshare

Note:
https://www.google.de is used if there is no entry in file.txt.

1 Like

I guess there are usecases then :slight_smile:

And maybe my post came across a little less friendly than it was intended, but I don’t think you actually need that, or even multiple domain names, to simply share a document with someone, which is what Nextcloud is mainly made for :wink:

By the way, for people who are not so CLI-savvy and don’t want to fiddle around with scripts, there are also self-hosted GUI tools for this… GitHub - awesome-selfhosted/awesome-selfhosted: A list of Free Software network services and web applications which can be hosted on your own servers

It would seem to comport with your broader perspective that the theming features have been wasteful of efforts in development, because of their departure from a restricted mission of file sharing and groupware.

Even support for multiple trusted domains might seem as a mindless frivolity.

The objection, centered on an assumption about extremely limited scope, seems not particularly germane.

Well. I mean, almost anything is possible, right? But someone has to do the development work and then maintain the code. Most of this could probably be done through apps, but again, someone would have to do the work.

At the end of the day resources are not infinite, and every company has to prioritise how it uses its resources, even much larger companies than Nextcloud. And even with products from Google or Microsoft, many of the features for more specific use cases are often implemented through additional software and/or extensions/plug-ins developed by third parties.

One main difference, of course, is that these extensions and add-on products that interact with Google/Microsoft products, just like the main products themselves, are mostly commercial and closed-source solutions, often cloud-based SaaS solutions, whereas Nextcloud is open source, self-hostable and completely free to use, even for commercial purposes, without paying a dime to the company that provides most of the paid developers working on it :wink: