top | item 45693443

(no title)

edweis | 4 months ago

Do you really need a database for this? On a unix system, you should be able to: CRUD users, CRUD files and directories, grant permissions to files or directories

Is there a decade-old software that provides a UI or an API wrapper around these features for a "Google Drive" alternative? Maybe over the SAMBA protocol?

discuss

order

MontyCarloHall|4 months ago

How would you implement things like version history or shareable URLs to files without a database?

Another issue would be permissions: if I wanted to restrict access to a file to a subset of users, I’d have to make a group for that subset. Linux supports a maximum of 65536 groups, which could quickly be exhausted for a nontrivial number of users.

Wicher|4 months ago

As for the permissions, using ACLs would work better here. Then you don't need a separate group for every grouping.

skydhash|4 months ago

Backup files the way Emacs, Vim,... do it: Consistent scheme for naming the copies. As for sharable URLs, they could be links.

The file system is already a database.

edweis|4 months ago

Ok this product will be for project with less than 65k users.

For naming, just name the directory the same way on your file system.

Shareable urls can be a hash of the path with some kind of hmac to prevent scraping.

Yes if you move a file, you can create a symlink to preserve it.

conception|4 months ago

Encode paths by algorithm/encryption?

ajross|4 months ago

> How would you implement things like version history

Filesystem or LVM snapshots immediately come to mind

> or shareable URLs to files without a database?

Uh... is the path to the file not already an URL? URLs are literally an abstraction of a filesystem hierarchy already.

ramses0|4 months ago

Take a look at "cockpit", because if there were, that's where it "should" be.

https://cockpit-project.org/applications

--

    With no command line use needed, you can:

    Navigate the entire filesystem,
    Create, delete, and rename files,
    Edit file contents,
    Edit file ownership and permissions,
    Create symbolic links to files and directories,
    Reorganize files through cut, copy, and paste,
    Upload files by dragging and dropping,
    Download files and directories.

motorest|4 months ago

> Do you really need a database for this?

I have no idea how this project was designed, but a) it's expectable that disk operations can and should be cached, b) syncing file shares across multiple nodes can easily involve storing metadata.

For either case, once you realize you need to persist data then you'd be hard pressed to justify not using a database.

benrutter|4 months ago

I don't know of one- have thought this before but with python and fsspec. Having a google drive style interface that can run on local files, or any filesystem of your choice (ssh, s3 etc) would be really great.

XorNot|4 months ago

I'm unironically convinced that a basic Samba share with Active Directory ACLs is actually probably the best possible storage system...but the UI for managing permissions sucks, and most people don't have enough access to set it up the way they want.

Like broadly, for all configuration Hashicorp Vault makes you do, you can achieve a much more useful set of permissions with a Samba fileshare and ACLs (certainly it makes it easy to grant targeted access to specific resources - and with IIS and Kerberos you even have an HTTP API).

nodesocket|4 months ago

Perhaps they are using MongoDB GridFS instead of storing files on disk.

WesolyKubeczek|4 months ago

I need to remind that the time when a service's tenant — be it a file, email, whatever else — automatically meant there was an OS user account for that user, has also been decades ago.

GiorgioG|4 months ago

You expose SAMBA shares outside your home network?

edweis|4 months ago

I do, password-protected of course. It is the only "native" way I found to get server files access to my iPhone without downloading a third party app (via Files).

pas|4 months ago

... well, it makes sense to be able to do a "join" with the `users` and `documents` collections, use the full expressive range of an aggregation pipeline (and it's easy to add additional indices to MongoDB collections, and have transactions, and even add replication - not easy with a generic filesystem)

put all kinds of versioned metadata on docs without coming up with strange encodings, and even though POSIX (and NodeJS) offers a lot of FS related features it probably makes sense to keep things reeeeally simple

and it's easy to hack on this even on Windows

jedimastert|4 months ago

An SCP or FTP client maybe?

edweis|4 months ago

Definity. Though SAMBA supports authentication natively. With SCP and sFTP you'll need another admin server to create users.

dangus|4 months ago

Can you name a single Google Drive clone that doesn’t use a database?

Would love to see your source code for your take on this product.

thekid314|4 months ago

The Synology Drive version mirrors the filesystem, though I’m sure it has a database for sharing metadata. Is that what they mean?