[PR #4825] [MERGED] 🐛 CLI: Fix ACTUAL_DATA_DIR env variable not respected in some cases #5604

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4825
Author: @MikesGlitch
Created: 4/16/2025
Status: Merged
Merged: 4/18/2025
Merged by: @MikesGlitch

Base: masterHead: fix/cli-data-dir-override


📝 Commits (7)

  • 7410db3 fix issue with default data directory not respecting env variables
  • 79169d5 release notes
  • d103d5a checking for default config
  • 1fb80ea Update actual-server.js
  • 7d7c4c1 lint
  • b5b285f keeping the data dir as per the docs
  • 16aa93f putting it back, docs were wrong

📊 Changes

2 files changed (+45 additions, -10 deletions)

View changed files

📝 packages/sync-server/bin/actual-server.js (+39 -10)
upcoming-release-notes/4825.md (+6 -0)

📄 Description

Two issues fixed - both to do with the data directory:

  1. When ACTAUL_DATA_DIR is set and --config isn't set, the environment variable specified was not being respected.
  2. When no --config is set, look for a default config.json (this is the current server behavior).
    • If it exists and has a dataDir value, use it. Otherwise default it to the directory where the command was run
    • If it doesn't exist, also default the data dir to where the command was run

Defaulting the data directory and config.json in this script ensures that it works the same way as is described here: https://actualbudget.org/docs/config/.

If we don't set them here manually, the server will search for the files in the project root, which is the node_modules folder because this is installed as node module.


🔄 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/4825 **Author:** [@MikesGlitch](https://github.com/MikesGlitch) **Created:** 4/16/2025 **Status:** ✅ Merged **Merged:** 4/18/2025 **Merged by:** [@MikesGlitch](https://github.com/MikesGlitch) **Base:** `master` ← **Head:** `fix/cli-data-dir-override` --- ### 📝 Commits (7) - [`7410db3`](https://github.com/actualbudget/actual/commit/7410db33bfe254a8384665ec2ba72ba7f342212d) fix issue with default data directory not respecting env variables - [`79169d5`](https://github.com/actualbudget/actual/commit/79169d57c9c8fb0daa6ea5ef38ce87276084fef8) release notes - [`d103d5a`](https://github.com/actualbudget/actual/commit/d103d5a3df0d05232cfd1dd8e88fbc8379b6dca4) checking for default config - [`1fb80ea`](https://github.com/actualbudget/actual/commit/1fb80ea7b2274eb946fdc7386407d19ee64e29af) Update actual-server.js - [`7d7c4c1`](https://github.com/actualbudget/actual/commit/7d7c4c12bde03d617cce49ba8463eb41edc906a8) lint - [`b5b285f`](https://github.com/actualbudget/actual/commit/b5b285f986dd1aed2756794fe76ca04543c256ea) keeping the data dir as per the docs - [`16aa93f`](https://github.com/actualbudget/actual/commit/16aa93f6f344150e0e9f1cdea6a44bdebb127446) putting it back, docs were wrong ### 📊 Changes **2 files changed** (+45 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/sync-server/bin/actual-server.js` (+39 -10) ➕ `upcoming-release-notes/4825.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. --> **Two issues fixed - both to do with the data directory:** 1. When ACTAUL_DATA_DIR is set and --config isn't set, the environment variable specified was not being respected. 2. When no --config is set, look for a default config.json (this is the current server behavior). - If it exists and has a dataDir value, use it. Otherwise default it to the directory where the command was run - If it doesn't exist, also default the data dir to where the command was run Defaulting the `data` directory and `config.json` in this script ensures that it works the same way as is described here: https://actualbudget.org/docs/config/. If we don't set them here manually, the server will search for the files in the project root, which is the node_modules folder because this is installed as node module. --- <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:15:14 -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#5604