Commit graph

491 commits

Author SHA1 Message Date
Nicola Murino
cb6609e468
sftpd: disable allocator
Some checks failed
Docker / Build (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-21 07:54:48 +01:00
Nicola Murino
3a47ba3ff9
silence lint warning
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-21 07:45:23 +01:00
Nicola Murino
5212095b89
EventManager: always close the connection filesystem
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Test and deploy (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (push) Waiting to run
closing the user filesystem is not enough here

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-20 21:17:16 +01:00
Nicola Murino
2658d06682
IDC cookie: use a cryptographically secure random string
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-20 18:26:23 +01:00
Nicola Murino
e48b76821f
provider rule events: allows you to filter by user groups
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-15 13:54:08 +01:00
Nicola Murino
a3ed0f2d14
prepare v2.6.3
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Test and deploy (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (push) Waiting to run
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-14 21:05:24 +01:00
Nicola Murino
d7d08c3d2f
oidc/oauth2: use an opaque state
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-11 19:44:39 +01:00
Nicola Murino
f3a58b8ecc
fix new lint warnings
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-10 20:59:30 +01:00
Nicola Murino
f07c9a7e01
EventManager: disable commands by default
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-10 12:09:25 +01:00
Nicola Murino
d0f348a46a
WebAdmin and REST API: remove too granular permissions
Our permissions system for admin users is too granular and some
permissions overlap. For example, you can define an administrator
with the "manage_system" permission and not with the "manage_admins"
or "manage_user" permission, but the "manage_system" permission
allows you to restore a backup and then create users and
administrators. The following permissions will be removed:
"manage_admins", "manage_apikeys", "manage_system", "retention_checks",
"manage_event_rules", "manage_roles", "manage_ip_lists". Now you
need to add the "*" permission to replace the removed granular
permissions because the removed permissions allow actions that
should only be allowed to super administrators.
There is no point in having separate, overlapping permissions.

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-10 10:51:27 +01:00
Nicola Murino
65e8e2c1d4
don't allow admins to change their own permissions
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-09 20:33:03 +01:00
Nicola Murino
5c163ed592
EventManager: allow to define the allowed system commands
Some checks failed
CI / Test and deploy (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-09 19:14:45 +01:00
Nicola Murino
feaf3ac459
WebAdmin: check CSRF header when deleting blocked hosts
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-09 18:50:31 +01:00
Nicola Murino
f363d037a7
remove fallback if rand.Reader fails
Failing to read from rand.Reader essentially can't happen, and if it
does is not possible to fallback securely, so just panic

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-09 18:48:48 +01:00
Nicola Murino
dda89185fb
plugins: fix passing additional environment variables
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-11-05 18:07:24 +01:00
Nicola Murino
b4acae85b8
proxy protocol: improve logging
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-31 14:30:49 +01:00
Nicola Murino
bc317775d2
plugin: remove invalid chars from error message
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-29 18:12:42 +01:00
Nicola Murino
256e3c1e3e
node: use a plain string as key
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Test and deploy (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (push) Waiting to run
Some KMS providers only allow UTF-8 characters

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-28 14:33:38 +01:00
Nicola Murino
9c744da620
DirLister: returns appropriate protocol errors
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-16 19:05:11 +02:00
Nicola Murino
7d24a4852c
WebAdmin SMTP: ensure current config is not nil
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Test and deploy (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (push) Waiting to run
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-15 18:23:28 +02:00
Nicola Murino
87fdc1dec1
Web: add CheckRedirect to pages using baselogin.html
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-12 12:54:32 +02:00
Nicola Murino
cdbb376376
EventManager: add escaped virtual path
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-12 11:28:03 +02:00
Nicola Murino
472bfac5fe
EventManager: add datetime placeholder
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-08 19:15:07 +02:00
Nicola Murino
e1008c30bf
log: fix level for transfer logs
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-03 20:29:28 +02:00
Nicola Murino
8325fbc7dd
kms: add support for Oracle Key Vault
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-03 06:59:54 +02:00
Nicola Murino
c74f391caf
EventManager: filter action execution based on event status
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Test and deploy (1.22, macos-latest, true) (push) Waiting to run
CI / Test and deploy (1.22, ubuntu-latest, true) (push) Waiting to run
CI / Test and deploy (1.22, windows-latest, false) (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (aarch64, ubuntu18.04, go1.22.6, arm64) (push) Waiting to run
CI / Build Linux packages (amd64, ubuntu:18.04, go1.22.6, amd64) (push) Waiting to run
CI / Build Linux packages (armv7, ubuntu18.04, go1.22.6, arm7) (push) Waiting to run
CI / Build Linux packages (ppc64le, ubuntu18.04, go1.22.6, ppc64le) (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (alpine, false, ubuntu-latest) (push) Waiting to run
Docker / Build (alpine, true, ubuntu-latest) (push) Waiting to run
Docker / Build (debian, false, ubuntu-latest) (push) Waiting to run
Docker / Build (debian, true, ubuntu-latest) (push) Waiting to run
Docker / Build (debian-plugins, true, ubuntu-latest) (push) Waiting to run
Docker / Build (distroless, false, ubuntu-latest) (push) Waiting to run
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-09-27 20:49:04 +02:00
Nicola Murino
84f3f877a5
smtp: replace deprecated method
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-08-20 11:28:14 +02:00
Nicola Murino
121d5ae34d
fix new lint warnings
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Build Linux packages (amd64, ubuntu:18.04, latest, amd64) (push) Waiting to run
CI / Build Linux packages (armv7, ubuntu18.04, latest, arm7) (push) Waiting to run
CI / Test and deploy (1.22, macos-latest, true) (push) Waiting to run
CI / Test and deploy (1.22, ubuntu-latest, true) (push) Waiting to run
CI / Test and deploy (1.22, windows-latest, false) (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (aarch64, ubuntu18.04, latest, arm64) (push) Waiting to run
CI / Build Linux packages (ppc64le, ubuntu18.04, latest, ppc64le) (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (alpine, false, ubuntu-latest) (push) Waiting to run
Docker / Build (alpine, true, ubuntu-latest) (push) Waiting to run
Docker / Build (debian, false, ubuntu-latest) (push) Waiting to run
Docker / Build (debian, true, ubuntu-latest) (push) Waiting to run
Docker / Build (debian-plugins, true, ubuntu-latest) (push) Waiting to run
Docker / Build (distroless, false, ubuntu-latest) (push) Waiting to run
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-08-14 08:46:55 +02:00
Nicola Murino
6f8bc59756
httpd: allow to configure cache control header
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (1.22, macos-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, ubuntu-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, windows-latest, false) (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (aarch64, ubuntu18.04, latest, arm64) (push) Has been cancelled
CI / Build Linux packages (amd64, ubuntu:18.04, latest, amd64) (push) Has been cancelled
CI / Build Linux packages (armv7, ubuntu18.04, latest, arm7) (push) Has been cancelled
CI / Build Linux packages (ppc64le, ubuntu18.04, latest, ppc64le) (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (alpine, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (alpine, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian-plugins, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (distroless, false, ubuntu-latest) (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-08-12 21:52:59 +02:00
Nicola Murino
3169197252
backports from main
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-08-12 18:06:08 +02:00
Nicola Murino
ab83babcc6
resetpwd: also disable two-factor authentication
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (1.22, macos-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, ubuntu-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, windows-latest, false) (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (aarch64, ubuntu18.04, latest, arm64) (push) Has been cancelled
CI / Build Linux packages (amd64, ubuntu:18.04, latest, amd64) (push) Has been cancelled
CI / Build Linux packages (armv7, ubuntu18.04, latest, arm7) (push) Has been cancelled
CI / Build Linux packages (ppc64le, ubuntu18.04, latest, ppc64le) (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (alpine, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (alpine, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian-plugins, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (distroless, false, ubuntu-latest) (push) Has been cancelled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-08-04 21:28:41 +02:00
Nicola Murino
4fd92db12a
IDP account check: preserve user profile
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (1.22, macos-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, ubuntu-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, windows-latest, false) (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (aarch64, ubuntu18.04, latest, arm64) (push) Has been cancelled
CI / Build Linux packages (amd64, ubuntu:18.04, latest, amd64) (push) Has been cancelled
CI / Build Linux packages (armv7, ubuntu18.04, latest, arm7) (push) Has been cancelled
CI / Build Linux packages (ppc64le, ubuntu18.04, latest, ppc64le) (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (alpine, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (alpine, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian-plugins, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (distroless, false, ubuntu-latest) (push) Has been cancelled
Fixes #1712

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-08-02 19:25:34 +02:00
Nicola Murino
4660c2e859
replace hand-written slice utilities with methods from slices package
SFTPGo depends on Go 1.22 so we can use slices package

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-07-25 18:39:02 +02:00
Nicola Murino
052ee04baa
lint: fix unused write warnings
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-07-22 19:26:40 +02:00
Nicola Murino
04885f3601
sftpd: remove unused folder prefix from Connection struct
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-07-22 19:22:00 +02:00
Nicola Murino
55169eb2d4
oidc refresh token: validate nonce only if set
As clarified in OpenID core spec errata 2, section 12.2

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-07-01 19:06:44 +02:00
Nicola Murino
636a1c2c38
set version to 2.6.2
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-21 19:06:18 +02:00
Nicola Murino
a09e914635
smtp: hide commit hash in user agent
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-21 18:33:37 +02:00
Nicola Murino
71b974d4f8
fix test case failure on macOS with bolt provider
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-19 10:40:15 +02:00
Nicola Murino
c8e8fd5b25
skipping failing test on macOS for now
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-19 09:09:42 +02:00
Nicola Murino
87aecfc515
set version to 2.6.1
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-18 20:41:39 +02:00
Nicola Murino
063e33ad76
sftp: limit max file list
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-17 19:25:02 +02:00
Nicola Murino
3462bba3f4
backport from main branch
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-15 12:05:28 +02:00
Nicola Murino
7756cf9b1e
reduce share token duration
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-08 13:13:17 +02:00
Nicola Murino
1f8ac8bfe1
REST API: fix token invalidation after password change
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-07 18:21:19 +02:00
Nicola Murino
aceecd9800
Windows: allow to override most of the "serve" flags from env files
The Windows specific code path was missing in 07710ad98

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-05 18:03:39 +02:00
Nicola Murino
952faaf76f
EventManager: add an action to rotate the log file
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-04 19:53:07 +02:00
Nicola Murino
b83aaa863f
make sure to return a fully populated user after plugin auth
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-06-04 19:53:02 +02:00
Nicola Murino
a215fad41a
EventManager: fix adding ObjectDataString for provider events
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-05-31 20:02:29 +02:00
Nicola Murino
3efff2ea8a
allow to override most of the "serve" flags from env files
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-05-31 18:59:48 +02:00