Skip to content
@go-fileshare

go-fileshare

go-fileshare

go-fileshare

One disk image, served over SMB, NFS, WebDAV, SFTP and S3 — the same users, the same per-share access, from one configuration file.


What this is

A person wants to share an image. Which protocol carries it is a property of the client at the other end: macOS and Windows reach for SMB, a Linux fleet already has NFS, a browser or a phone has HTTP. Running four servers, each with its own configuration file and its own idea of who "alice" is, is a way to get three of them subtly wrong.

So this is one binary and one file. The images are go-filesystems drivers — FAT32, exFAT, ext4, NTFS, UFS, ISO 9660, SquashFS, HFS+ — opened once and shared by every protocol behind one lock. That is every driver in the organisation of the one shape. APFS, Btrfs, XFS and ZFS open a disk image and must be told which partition — but a partition can be named for any filesystem, because a FAT32 or ext4 image has a partition table in front of it as often as an XFS one does. partition_label or partition_uuid, not an index: an index moves when a disk is repartitioned, and a filesystem is still found at the new one.

The protocols do not agree about who is asking

That is the whole difficulty, and it is a fact about the protocols rather than a limitation here:

proves somebody by
SMB NTLMv2 — the password never crosses the wire
WebDAV HTTP Basic, or a bearer token an identity provider signed
SFTP a public key, or an SSH certificate from an authority you trust — with ssh_domains, only where its EuroHPC domain grant names this host, and only from the addresses it is pinned to
S3 a SigV4 signature — an HMAC computed from the secret, so the directory must HOLD the password rather than merely check it
NFSv3 nothing at all — AUTH_UNIX is a claim the client makes about itself
NFS + Kerberos sec=krb5 — a principal a ticket proves, realm included

So a share that names who may use it is not exported over NFS. Not a warning and not an option: a configuration that says "photos belongs to alice" and a protocol that hands photos to whoever connects cannot both be honoured, and quietly widening access is the worse of the two failures. fileshare check prints the whole matrix — every share against every protocol, and every person against every protocol — before anything is restarted.

A person can exist only at an identity provider. An oidc block makes WebDAV accept a bearer token — verified by go-authn/oidc for signature, issuer, audience and expiry — and the challenge it sends offers Basic and Bearer, so a client picks the one it can answer. Only WebDAV: SMB signs with NTLMv2, SFTP with a key, S3 with SigV4, and none of them has a field a token fits in.

⛔ A token says who the provider thinks somebody is. It does not say this server has a share for them: a valid token for a name no source here knows is refused, because the safe reading of I do not know you is not you are allowed. A site where the provider IS the directory says trust_all = true.

That refusal used to be permanent. A kerberos block gives NFS something to check, and a restricted share is then exported over it like anywhere else:

kerberos {
  realm  = "EXAMPLE.ORG"
  keytab = "/etc/fileshare/krb5.keytab"
}

The realm is compared, not just the name before the @: two realms can each have an alice, and only one of them is yours.

Repos

Repo
fileshare The server: one image, four protocols, one configuration. go install github.com/go-fileshare/fileshare@latest
portal The server behind the UIs: OIDC login, an encrypted session, a token per fileshare server, the admin API and WebDAV passed through, files served inert.
console The admin console: shares, grants, volumes, across every server a portal knows. In a browser, or native.
explorer The file explorer: browse, upload in pieces, download, rename, copy, delete. In a browser behind the portal.

Where the people come from

A user block is the whole directory for a household. A site whose people are already in a database or in LDAP names them where they are, through go-authn/directory — the same users block an authnd uses, so a site describes its directory once.

Links


No cgo. Six architectures under qemu. Verified against clients this project did not write: Samba's smbclient, macOS's Finder and Windows' own redirector, OpenSSH's sftp, and mount_nfs.

Popular repositories Loading

  1. fileshare fileshare Public

    Share a disk image over SMB, NFS, WebDAV and SFTP — one configuration, one binary, pure Go

    Go

  2. brand brand Public

    go-fileshare brand assets — the disk-and-rays mark, its per-repo declension, and every format a page might ask for

  3. .github .github Public

    go-fileshare organisation profile

    JavaScript

  4. go-fileshare.github.io go-fileshare.github.io Public

    The go-fileshare landing page

    HTML

  5. docs docs Public

    The go-fileshare documentation — one disk image over SMB, NFS, WebDAV and SFTP, and what each protocol can promise

    HTML

  6. portal portal Public

    The server behind the go-fileshare UIs: OIDC login, an encrypted session, per-server tokens, and a Connect proxy to many fileshare servers. Pure Go

    Go

Repositories

Showing 8 of 8 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…