From e8faddba9c554316f98a03d40334dfca216cca83 Mon Sep 17 00:00:00 2001 From: "Evgeny @ SimpleX Chat" <259188159+evgeny-simplex@users.noreply.github.com> Date: Mon, 31 Aug 2026 16:35:55 +0000 Subject: [PATCH] fix --- plans/2026-08-22-xftp-file-storage-time.md | 2 +- src/Simplex/FileTransfer/Server/Env.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plans/2026-08-22-xftp-file-storage-time.md b/plans/2026-08-22-xftp-file-storage-time.md index 264c0b273..3265d2be3 100644 --- a/plans/2026-08-22-xftp-file-storage-time.md +++ b/plans/2026-08-22-xftp-file-storage-time.md @@ -125,7 +125,7 @@ Store, in both the SQLite and PostgreSQL agent stores: Upload, in `Simplex.Messaging.Agent.Client` and `Simplex.FileTransfer.Client`: - `getXFTPClient` takes a proof for the session as a parameter, `SessionId -> IO (Maybe EntitlementProof)`, beside the callback it already takes for a closed client. The client config holds no credential and no keys -- `getXFTPServerClient` passes a function that reads the user's credential and generates the proof over the session id from the configured issuer keys. A missing credential or a failure to generate gives `Nothing`, with the failure logged +- `getXFTPServerClient` passes a function that generates the proof over the session id from the configured issuer keys, and only for a server of this user, matched by the key hash that TLS pins, so a file description of the sender cannot direct the entitlement to another server. A server that is not the user's, a missing credential, or a failure to generate gives `Nothing`, with the failure logged - `xftpClientHandshakeV1` calls it with the session id from the connection, and sends the result in the handshake - `agentXFTPNewChunk` reads the storage time from the send record and sends FNEW with it - `createXFTPChunk` returns the granted expiry (epoch seconds); `agentXFTPNewChunk` stores it on `NewSndChunkReplica` diff --git a/src/Simplex/FileTransfer/Server/Env.hs b/src/Simplex/FileTransfer/Server/Env.hs index f11da2cf9..d5bbb1ac3 100644 --- a/src/Simplex/FileTransfer/Server/Env.hs +++ b/src/Simplex/FileTransfer/Server/Env.hs @@ -184,7 +184,7 @@ newXFTPServerEnv config@XFTPServerConfig {serverStoreCfg, fileSizeQuota, fileExp belowDefault = M.filter ((< defaultMax) . storageTime) fileStorageEntitlements unless (M.null belowDefault) $ do forM_ (M.assocs belowDefault) $ \(name, EntitlementConfig {storageTime}) -> - logError $ "STORE: storage time for " <> name <> " is " <> tshow storageTime <> " seconds, below the default file expiration " <> tshow defaultMax <> " seconds" + logError $ "expire_files_hours_for_" <> name <> " is " <> tshow (storageTime `div` 3600) <> " hours, below expire_files_hours " <> tshow (defaultMax `div` 3600) <> " hours, server not started" exitFailure random <- C.newRandom (store, storeLog) <- case serverStoreCfg of