← ЧПП

ЧПП се напишани на англиски и холандски; се прикажуваат на англиски.

ЧПП

File server

FAQ › EUZOS Server › File server · Nederlands

What is it?

The File server (package id files) gives a company shared folders ("shares") on its EUZOS Server. For now only EUZOS PCs get access: on the PC the shares appear in the Explorer under Company files. The design keeps the storage and permission core separate from the protocol, so that a WebDAV or SMB gateway for Windows and Mac can be added later (docs/PACKAGE-FILESERVER.md, "Later").

  • Who may do what is set per share: read or write for an account, a local group, all members of the organisation (org:members) or its admins (org:admins). Accounts and the organisation come from the profile server; the File server keeps no passwords.
  • Quota per share; a recycle bin per share (30 days).
  • Storage: an encrypted area of its own on partition 2 of the server.
  • Protocol: an own EUZOS protocol over TLS on TCP 8447, authenticated with the PC's device key plus the logged-in account (the same trust model as Server Admin). The port is closed until the package is turned on.

It needs Workplace management set up on the same server (its keys and its sign-in with the profile server).

How do I…?

How do I install it?

Choose File server in the server installer (step Packages), or later: put \EOS\FW\FILES.TXT with the line role=files on the server and reboot. At the first start the server creates FSKEY.TXT (the storage key), the area on partition 2 (half of the free space, or size-gib= from FILES.TXT) and opens TCP 8447 for the LAN.

How do I turn it on or off?

serveradmin <server> package-on files            opens 8447 for the LAN and starts it
serveradmin <server> package-off files confirm   closes 8447; the data stays

How do I make a share and give people access?

serveradmin <server> files share-add Finance 200
serveradmin <server> files group-add finance anna@company.nl
serveradmin <server> files grant Finance group:finance write
serveradmin <server> files grant Finance org:admins read
serveradmin <server> files                       shares, usage, rights, groups

grant <share> <principal> none removes a right. share-quota <name> <GiB> changes the quota; share-remove <name> confirm removes an empty share; trash-empty <share> confirm empties its recycle bin.

How does a user reach the files?

On an EUZOS PC that is registered with the profile server (pckey create, then pc-register by the admin) and logged in with an account of the organisation: open Files, then Company files in the sidebar. It lists the shares the account may see; inside a share everything works as in My files (open, save, new folder, rename, delete, copy and move, also to and from a stick or OneDrive).

Why does the PC show "No company files for this account"?

The account is not a member of the PC's organisation (admin, linked Microsoft account or an e-mail domain of it), no share grants it anything, or no File server of the organisation is reachable (package off, port closed, server down).

Where do deleted files go?

To the share's recycle bin (trash/<share> in the area), with who deleted it and when. Entries older than 30 days are removed for good.

Details

  • The access proof comes from the profile server (POST /api/workplace/v1/files-proof?token=<pc-token>, body pc-key=<hex>): account, organisation, role (member/admin), PC key, 10 minutes, signed with the profile server's key. With it the PC also gets the File servers of the organisation (id, name, LAN address, TLS pin).
  • The PC connects to <LAN address>:8447 with TLS 1.3 and the pinned key of the workplace server, says hello (gets a one-time challenge) and login (the proof plus a login signed with the device key, bound to that server and challenge). Then many requests over the same connection.
  • Frames: 4-byte length + header lines, 4-byte length + data (≤ 8 KiB header, ≤ 1 MiB data). Reads go in ranges of up to 1 MiB; writes go in chunks and the file appears only at the end (atomic).
  • Path safety: every name is checked (no .., ., /, \, NUL or control characters, at most 255 bytes, at most 30 deep) before it reaches the storage.
  • Limits of the MVP: files up to 64 MiB, 4096 names per folder, 64 shares, 64 groups of 512 members.

Reference

Admin action files (Server Admin)

Sub-commandWhat it does
(none) or usagestate, area, shares with usage, quota and rights, groups, traffic
share-add <name> [<GiB>]new share (default 10 GiB)
share-quota <name> <GiB>change the quota
share-remove <name> confirmremove an empty share
grant <share> <principal> read|write|noneset or remove a right
group-add <group> <e-mail>, group-remove <group> <e-mail>local groups
trash-empty <share> confirmempty the recycle bin of a share

Principals: account:<e-mail> (or just the address), group:<name>, org:members, org:admins. Share and group names: 1-40 of A-Z a-z 0-9 . _ -, not starting with ..

Protocol operations (TCP 8447)

hello, login, shares, list, info, read, write-begin, write-data, write-end, write-abort, mkdir, rename, delete, trash, restore, bye. Reason codes: invalid, not_logged_in, expired, proof_signature, pc_signature, wrong_environment, other_organization, other_server, wrong_pc, challenge, no_access, read_only, not_found, exists, not_empty, quota_full, too_large, busy, package_off, storage, not_ready.

Files

FileWhat
\EOS\FW\FILES.TXTrole=files, optional size-gib=<n> (first start only), package=off
\EOS\FW\FSKEY.TXT64 hex: the key of the encrypted area (secret; made at the first start)
partition 2, area EUZOS-FILES-AREA (kind 3)config/SHARES.TXT, shares/<share>/…, trash/<share>/…

Console

files shows the state (view only, also on a production server).

Code

ItemRole
libs/fileserver (euzos_fileserver)the core: store (every operation with rights, quota, recycle bin), path, config, trash, role, auth, wire (tested)
kernel/src/server/files.rsthe server side (role, area, listener, operations, admin)
kernel/src/company_files.rs, kernel/src/explorer/source.rsthe client and the Explorer source on the PC
server/profile/src/files_proof.rsthe access proof on the profile server

See also