2522 Commits
Author SHA1 Message Date
Nicola Murino 305ebb875c fix Windows build
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-10-03 16:22:11 +02:00
Nicola Murino 36a48a4a19 update deps
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-10-03 15:26:29 +02:00
Nicola Murino 8450c023ac httpd: apply pending auth requirements to API key routes
The admin API key routes now require any pending password change or
two-factor enrollment to be completed first, like the other admin routes.

Reported-by: Yves Soete, Blacksight LLC <yves.soete@blacksight.io>

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-10-03 12:59:28 +02:00
Nicola Murino bca13cd448 vfs: skip listed names that address no entry
Listings leave out the entries naming the listed directory or its
parent, and the names holding a backslash, which no request can
address

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-28 20:11:13 +02:00
Nicola Murino ba53d28fe6 Revert "remove AWS Marketplace specific code"
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-27 19:44:36 +02:00
Nicola Murino 1cc81798ba update gopsutil to v4
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-27 09:19:14 +02:00
Nicola Murino 8cc691cb83 post-login hook: serialize a copy of the user
Fixes #2298

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-24 15:15:43 +02:00
Nicola Murino 87fb508c97 update js and css deps
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-19 10:00:07 +02:00
Nicola Murino 9b05e4227b update choco package
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-19 09:41:36 +02:00
Nicola Murino fc15873eab update deps
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-18 14:50:07 +02:00
Nicola Murino 2894f69027 smtp: fix reading oauth2 settings from env
update access token and refresh token using the same mutex

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-18 14:45:14 +02:00
Nicola Murino 4731de9508 pkgs: restore the cap_net_bind_service file capability
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-14 10:31:24 +02:00
Nicola Murino 55e443d29e drop the dead nolint directives
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-09 12:37:54 +02:00
Nicola Murino be8a4f3618 pkgs: restore the env.d ownership fixup in the rpm postinstall
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-08 10:27:28 +02:00
Nicola Murino 7e1e268862 transferchecks: fix flaky tests
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-07 21:18:37 +02:00
Nicola Murino 309d2365e8 switch to Go 1.27
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-07 19:49:32 +02:00
Nicola Murino 17a855f8e6 update deps
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-07 19:43:44 +02:00
Nicola Murino edaac2996c packaging: harden data directory permissions on install
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-07 19:38:52 +02:00
Nicola Murino f9857a181c dataprovider: refuse self-service writes made from a stale snapshot
A user or admin changing its own password, profile or two-factor
settings wrote the whole account back and could overwrite a concurrent
administrator change. Self-service updates are now conditional on the
stored updated_at matching the value read, and every update stores a
strictly increasing updated_at.

Thanks to Thomas Toth for the report.

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-07 08:47:18 +02:00
Nicola Murino 80383acf38 dataprovider: refuse the login if a group setting uses %role% without a role
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-06 17:30:33 +02:00
Nicola Murino aadffac363 httpd: check the login conditions on every request
HTTP builds a connection per request, so checkHTTPClientUser is where a
request is authorized, the way the credential check is for SFTP and FTP:
it evaluates the login conditions of the account together with the
denied protocols, the login method and the source address.

An account that is disabled, that reaches its expiration date or that
falls outside its access time restrictions is refused on the next
request. The check is redundant on the paths that already run it before
the call, and costs nothing: the account is in memory.

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-06 17:23:37 +02:00
Nicola Murino 10743720f7 httpd: check the account state when a public share is served
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-06 17:11:13 +02:00
Nicola Murino 45dc32ca8a oidc: add require_verified_email setting
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-09-06 17:05:53 +02:00
Nicola Murino c737df6cd4 update deps
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-31 21:17:39 +02:00
Nicola Murino a420a5e095 httpd: improvements to the static files handling
The wrapper also always closes the files it opens

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-31 21:15:05 +02:00
Nicola Murino 89bd30c308 dumpdata: return an error if there are too many ip list entries
before we silently skipped the entries

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-30 07:47:10 +02:00
Nicola Murino 55d523fb4f fix test case with memory provider
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-27 16:40:38 +02:00
Nicola Murino ffeec76674 webdav: return the correct ETag after upload, or no ETag if unavailable
Fixes #2282

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-27 15:27:27 +02:00
Nicola Murino 2fdfb94f55 reject a different username from the pre-login hook and auth plugins
Answering with another account has never been a supported configuration for
these two integrations. Mapping several login names onto a single account is a
feature of the external authentication hook

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-27 11:06:49 +02:00
Nicola Murino 51104ed02f vfs: count what a failed recursive rename already moved
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-27 08:03:54 +02:00
Nicola Murino 48ccf188a0 say what a tolerated failure costs instead of calling it best effort
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-27 07:50:33 +02:00
Nicola Murino b5a2c1dd4f vfs: report the close error when copying a file across roots
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-27 07:42:51 +02:00
Nicola Murino 407a390b61 test: wait for the connections to drain before removing the home dirs
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-26 23:36:25 +02:00
Nicola Murino 447c6bfefd normalize permission keys and file pattern paths like every other virtual path
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-26 23:30:40 +02:00
Nicola Murino 27d8298384 rename: check the entries of a renamed directory, or refuse the rename
A directory rename authorized the whole tree from a walk performed before the
move, so the file_patterns filters and the per-directory rename permissions
decided on the tree as the walk had read it rather than on the one the move
carried.

The walk no longer authorizes the move. A gate decides from the configuration
alone whether anything can tell the entries of the tree apart: a move that
changes which file_patterns filters govern the contents, or a per-directory
permission that restricts renaming defined at or below either tree. When
something can, the object stores check every entry at the moment they move it,
since they rename a directory by recursing into it, and the filesystems that
rename it in a single operation refuse it, because nothing enumerates what that
operation carries. The type of the source is read again immediately before the
move.

Granting rename_files and rename_dirs separately keeps the pre-move walk.

So renaming a folder into or out of a path where a different file_patterns
filter applies is now refused on the local filesystem, SFTP and HTTP, and
checked entry by entry on the object stores; the same holds for a per-directory
permission that restricts renaming inside either tree. Renames the walk used to
refuse fail with the same error as before. IsRenameAtomic is derived from the
same capability instead of matching the filesystem name.

Reported-by: Wade Sparks (@wsparks-vc)

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-26 23:21:19 +02:00
Nicola Murino df46d092bd test: wait for connections to close before removing the home dirs
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-26 15:41:20 +02:00
Nicola Murino a2ffc5e7da rename: remove SetPathPermissions
useless on rename, permissions are preserved

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-26 14:40:36 +02:00
Nicola Murino bbb00e3f92 sftpd: bound the SCP protocol record length
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-26 11:53:51 +02:00
Nicola Murino d2fc01a640 check transfers: use compare and swap
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-25 10:02:09 +02:00
Nicola Murino bde9ffde10 transferschecker: wait for async transfer registration in tests
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-25 09:52:48 +02:00
Nicola Murino dc06275e09 shares: fix a directory share widened to the whole user filesystem
Downloading a public share limited to a single directory as a zip archive
rewrote share.Paths[0] to "/" so the entry names came out relative to that
directory. The value it overwrote is the policy every later public request is
authorized against: the browsable listing resolves the requested path under
Paths[0] and the upload handler derives its destination prefix from it.

The rewrite stays confined to the copy the handler holds only if the data
provider returns a share that owns its paths. The memory provider did not:
getACopy assigned the Paths slice by header, so the copy kept pointing at the
array stored in the provider map and the rewrite reached the stored share.
From that moment the link served the whole filesystem of the share owner. Any
recipient, with no account and nothing beyond the share URL, could list and
download every file the owner can reach, and a read-write share also accepted
uploads at the owner's root. The archive returned to the recipient who
triggered the change was still limited to the shared directory, so the
response revealed nothing. The SQL and bolt providers rebuild the slice while
decoding the stored row and were not affected.

The list of files to archive is now local to the handler, so the share is no
longer written to, and getACopy clones the paths, so a copy never shares state
with the provider.

The regression test downloads a share limited to one directory twice and
checks the archive, the stored paths, the browsable listing and a file outside
the share in between, with whichever data provider the test suite runs with.

Thanks to Yutaka Sasaki (@SAYUTIM) for the report.

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-25 09:32:54 +02:00
Nicola Murino 230ecb5e2b common: add V1AcceptIPv4InTCP6
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 22:13:33 +02:00
Nicola Murino 459cb2ba8f fix a race in test cases
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 21:42:24 +02:00
Nicola Murino fb4558540d guard the state the servers publish while they initialize
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 21:31:36 +02:00
Nicola Murino b4698f1f4d dataprovider: refuse to delete referenced folders, roles and groups
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 18:27:56 +02:00
Nicola Murino d54965865e replace golangci-lint with staticcheck, errcheck and unparam
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 15:07:16 +02:00
Nicola Murino c7f96eb74e dataprovider: schema version 36
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 12:24:27 +02:00
Nicola Murino d0b755d1d1 dataprovider: refresh the cached admin state on shared databases
An instance that starts with an empty admins table caches that state until
restart, so it keeps serving the setup page after another instance completes
the initial configuration. Instances backed by a shared SQL provider now
re-check the database, rate limited to one query per second and only until
the first admin is found

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 11:23:54 +02:00
Nicola Murino b6bd624364 oidc: clarify the claims merge comments
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 11:20:34 +02:00
Nicola Murino 2a791cdaa6 WebClient: build the multi-download form via the DOM
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2026-08-24 11:20:29 +02:00