[PR #4954] [MERGED] 🐛 Sync server - resolving the user-files and server-files to an absolute dir #5679

Closed
opened 2026-02-28 21:16:37 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4954
Author: @MikesGlitch
Created: 5/6/2025
Status: ✅ Merged
Merged: 5/9/2025
Merged by: @MikesGlitch

Base: master ← Head: fix/sync-server-user-dir-resolve


📝 Commits (3)

  • 1ca1c61 resolving the user-files and server-files to an absolute dir
  • 4b40fee safety
  • 47756a4 release notes

📊 Changes

4 files changed (+13 additions, -7 deletions)

View changed files

📝 packages/sync-server/bin/actual-server.js (+2 -2)
📝 packages/sync-server/src/account-db.js (+2 -2)
📝 packages/sync-server/src/util/paths.js (+3 -3)
➕ upcoming-release-notes/4954.md (+6 -0)

📄 Description

Reported on Discord: https://discord.com/channels/937901803608096828/1369372745036595260

The issue here is that the user files and server files aren't always being resolved to an absolute directory.

This is not just happening on the sync server CLI, but it's also happening when specifying the values for userFiles and serverFiles via config.json.

Example of failing config:

{
  "serverFiles": "./serverFiles",
  "userFiles": "./userFiles",
  "port": 5007
}

To make it fail:

  • setup a server with the config above
  • open the server url & upload a budget
  • expose it with a reverse proxy
  • logon to the proxy & download the budget

Rejection: TypeError: path must be absolute or specify root to res.sendFile

If the user doesn't try to override it it doesn't normally fail because it picks the default project root - that'll be why nobody's caught it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/4954 **Author:** [@MikesGlitch](https://github.com/MikesGlitch) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 5/9/2025 **Merged by:** [@MikesGlitch](https://github.com/MikesGlitch) **Base:** `master` ← **Head:** `fix/sync-server-user-dir-resolve` --- ### 📝 Commits (3) - [`1ca1c61`](https://github.com/actualbudget/actual/commit/1ca1c61480b4885a219d668c94aae514b7d5726d) resolving the user-files and server-files to an absolute dir - [`4b40fee`](https://github.com/actualbudget/actual/commit/4b40fee001a59a475b5bc3f49935202b800178ff) safety - [`47756a4`](https://github.com/actualbudget/actual/commit/47756a45542e41e3a0cfa2f1bbaf0290226d4627) release notes ### 📊 Changes **4 files changed** (+13 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/sync-server/bin/actual-server.js` (+2 -2) 📝 `packages/sync-server/src/account-db.js` (+2 -2) 📝 `packages/sync-server/src/util/paths.js` (+3 -3) ➕ `upcoming-release-notes/4954.md` (+6 -0) </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> Reported on Discord: https://discord.com/channels/937901803608096828/1369372745036595260 The issue here is that the user files and server files aren't always being resolved to an **absolute directory**. This is not just happening on the sync server CLI, but it's also happening when specifying the values for userFiles and serverFiles via config.json. Example of failing config: ``` { "serverFiles": "./serverFiles", "userFiles": "./userFiles", "port": 5007 } ``` To make it fail: - setup a server with the config above - open the server url & upload a budget - expose it with a reverse proxy - logon to the proxy & download the budget `Rejection: TypeError: path must be absolute or specify root to res.sendFile` If the user doesn't try to override it it doesn't normally fail because it picks the default project root - that'll be why nobody's caught it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:16:37 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5679