Public sharing documents as links

We want to share some of the documents outside, to the general public, so that these documents can be linked on various websites.
The requirements are:

  • the sharing is via a link
  • it is a permanent link, which does not change when we have a new version of the document
  • the link is always to the most recent version of the document (including the linked files)
  • the link needs to be to the file attached to the document (e.g. PDF, jpeg). Links to a given page of a file or any content of the document or metadata are nice to have, but not required.

I thought that the Web Links is the way to implement that, but I now know I was mistaken - web links are the opposite to what I need.

From what I know so far, there is no such functionality in Mayan (which surprised me a lot, frankly speaking).
API seems to be the way to go, but it requires login and in our case the links need to be public. So most likely it would require creating some sort of external proxy that uses API to expose the files/documents to the public.
Am I right? Or perhaps there is another way?

1 Like

There is another possible way to do this, but it is a bit involved.

  1. You could create an Index in Mayan for the documents you want to share.
  2. Then create a Mirror for that Index. That is like creating a Mounted Folder available to your Host Computer.
  3. You would then share that with a NextCloud instance, via an SMB connection or some other file sharing method.
  4. You could then give links to others via NextCloud.

HTH,
Daniel

I’m also astonished that Mayan is missing such a crucial feature!

@dbayer

That is an awful convoluted “solution”. I’m surprised a dev woudl suggest using other programs like NextCloud to fill out the voids in Mayan’s functionality.

Any estimate when this feature will be ready?

I’m evaluating Mayan for our office but without this features I would have to reconsider!

I’m not a Developer, just a user.

There is a built in URL for downloading, but it’s not quite setup the way I think @qnstie is envisioning. I think you could use the REST API to access this feature as well.

I took a screenshot, showing the menu choice for one of the files for a document that allows you to do a Quick Download.

This is even worse. The devs hiding behind users!

Mayan came highly recommended but all I’ve seen discourages me from using it.

It isn’t even supported by the devs!

Mayan might be ready someday for any serious use but as it stands right now is just too experimental and unsafe.

They aren’t hiding. This is a user forum, so I’m doing what users do, helping each other.

Mayan is far from experimental. It’s been around for 10+ years, and is very stable. We are using it to store 80,000+ documents.

Thanks @dbayer for mentioning that. It is very useful hint (I did not know about that menu), but it does not solve my problem at all, because the link requires login credentials to be accessed.
It will not work as a public link open to everyone.

My solution for the problem so far is to write a tiny proxy server (which does exactly what the “quick download” option does, but without requiring any credentials) and use a workflow to populate a “public link” metadata with the link served by that proxy when the document gets created.

It seems the least convoluted way to have my problem solved. Unfortunately it required custom coding and admittedly the “metadata” tab is not the most intuitive place to look for a public link. But I did not invent anything better than that.

The API provides a download URL

You substitute the Document ID and the File ID in the URL and it responds back with a download URL.

You can read about it in the Mayan Tools:API Documentation

Example:

https://mayan.mywebsite.com/api/v4/documents/274/files/290/download/

True, but the link is not a public link - goes via the standard authentication mechanism (as everything that goes to the API). When you launch that link in incognito session you will get a login screen instead.

So sadly, it seems that a self-made proxy, which internalyy has access to the API, but does not require it if accessed from the internet seems still the easiest option.

However I would be super happy, if public sharing got to the future functionality list!

2 Likes

I’m glad you at least found some sort of solution that works for you.

Thanks @roberto.rosario for the answer. While I understand the reasons, I also think that these requirements are not contradictory! For instance the big guys like Google (Drive), Microsoft or Box, who address the same enterprise sector have implemented sharing as links (with or without requirement to log in). I am not sure about the others, but Google Drive Enterprise provides a very nice audit of who shared what to whom and what was actually accessed.
I’m not suggesting that Mayan should copy everything from these systems, but the link sharing is IMO a more and more important feature, not only for us.

I think the optimal solution for that would be to generate an additional table with UUIDs of shared documents/files and if a request comes to an URL containing one of these UUDS, e.g.:
https://mayan.example.com/public/ae880403-1415-46c7-a524-317f2085ca04/latest/file
the system would just serve this file and (optionally) report it in some log.

In this way the user could easily enable and disable sharing, could - optionally - share a version of a document or a file (e.g. https://mayan.example.com/public/ae880403-1415-46c7-a524-317f2085ca04/v3/ and it would be easy to mare a report on who shares what.
And the links (like https://mayan.example.com/public/ae880403-1415-46c7-a524-317f2085ca04/latest/ ) would be permanent, which is very important.

In my case I am thinking about implementing something like this outside of Mayan (if it does not support sharing natively) as a kind of a proxy, which internally uses Mayan API to access the required data, but obviously it has a huge drawback that it cannot be easily integrated with Mayan UI (at least as far as I know - I did not find any documentation about creating Mayan plugins, apart of taking the whole code and changing it).

While I understand the reasons, I also think that these requirements are not contradictory!

They are contradictory and implementing them causes a conflict of purpose.

For instance the big guys like Google (Drive), Microsoft or Box,

Perfect example. These are not document management systems, they are file management with a web GUI, which reinforces the point made in the FAQ.

Can anyone point me to some documentation about Web Links in Mayan? Pretty please! :slight_smile:
Maybe I’m blind, but cannot find anything, not even using Google, and it seems such an important functionality!
Thanks!

Frankly speaking I’m surprised at the attitude of people. Expecting a free product to be perfect, far beyond what paid products from multinational companies with valuations reaching the trillion dollar can put out, preemptively have all the features they might ever need, and then throw a tantrum when it does have everything they want and expect the product and its creators to bend to their wills. Jesus! Talk about the worst blend of ingratitude, entitlement and immediate gratification right from the first post!

If it was a natural feature for Mayan it would be easy to define an implementation. One that does not requires additional software like proxies and break integration with the UI, or break integration with the policies of an organization. If it is hard to audit internal users, it would be even harder or impossible to audit external anonymous users.

Sharing documents with external parties is also a security problem similar to opening up an organization’s network to the outside world. That’s why there is not even a single solution to this problem at the network level: DMZ, reverse tunnel, port forwarding, port knocking, VPN. Or implementations: Wireguard, OpenVPN, Cloudflare, Connect.it, Teleport, DDNS, ad nauseam… With all the security problems each of them carry.

Breaking Mayan’s primary purpose to implement this feature is opening a can of worms that will increase the complexity of the code just for a single feature that with an unknown upside.

Mayan is free open source, now under the GPL-2 license. You are free to implement this, just make sure to obey the license and open up the code.

If you don’t have the technical personnel, you can also sponsor the creating of this feature like we do for the things we need from Mayan.

Attention to @roberto.rosario. Abuse and harassment by @npc-picky

This here. This is why people are put off by Mayan and its white male centered team. Why does @roberto.rosario has to have the final say on what Mayan is or is not? Him and his team act like they know better than everybody else. Perfect example how not to run a community project. No wonder Paperless NGX is kicking Mayan’s butt on all fronts. Keep it up and you’ll find yourselves being the only people using Mayan as your own personal little project whose only purpose is to serve a tool to aid in your little circle jerking session.

1 Like