[Tech Debt] Incorrect edge version shown in app #1173

Open
opened 2026-02-28 19:34:46 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @MatissJanis on GitHub (Jun 25, 2024).

We show the active version in the settings page. For demo.actualbudget.org this version number is correct.

For edge: we should show the commit hash there (or other unique identifier).

Screenshot 2024-06-25 at 20 39 39
Originally created by @MatissJanis on GitHub (Jun 25, 2024). We show the active version in the settings page. For `demo.actualbudget.org` this version number is correct. For edge: we should show the commit hash there (or other unique identifier). <img width="1041" alt="Screenshot 2024-06-25 at 20 39 39" src="https://github.com/actualbudget/actual/assets/886567/bcbf37b5-7b1b-4bb2-9f7c-fcadc7b28c04">
GiteaMirror added the user interfacegood first issuetech debthelp wanted labels 2026-02-28 19:34:46 -06:00
Author
Owner

@matt-fidd commented on GitHub (Jun 25, 2024):

I took a stab at this as one of my first potential changes to actual.

I could either do it through express-actuator (already used for /info /health and /metrics) but it required a git.properties file be generated for every commit and I'm not sure how practical that is.

Alternatively I made a /info/git endpoint that did

execSync('git rev-parse HEAD', { cwd: config.projectRoot }).toString().trim();

Are we okay with exec calls?

@matt-fidd commented on GitHub (Jun 25, 2024): I took a stab at this as one of my first potential changes to `actual`. I could either do it through `express-actuator` (already used for `/info` `/health` and `/metrics`) but it required a git.properties file be generated for every commit and I'm not sure how practical that is. Alternatively I made a `/info/git` endpoint that did ```js execSync('git rev-parse HEAD', { cwd: config.projectRoot }).toString().trim(); ``` Are we okay with exec calls?
Author
Owner

@MatissJanis commented on GitHub (Jun 25, 2024):

For actual-server: ideally I wouldn't want to have usage of exec within the codebase. It can potentially lead to arbitrary code execution down the line (all it takes is for a junior to come in and add a variable in the shell command.. and 💣). What if we created a new file when running yarn start that wrote a new file with active commit hash? And then just read from that file to get the hash. Same thing could be applied for yarn build.

For actual: the hash here would be different. No quick ideas how to solve it.

@MatissJanis commented on GitHub (Jun 25, 2024): For `actual-server`: ideally I wouldn't want to have usage of `exec` within the codebase. It can potentially lead to arbitrary code execution down the line (all it takes is for a junior to come in and add a variable in the shell command.. and 💣). What if we created a new file when running `yarn start` that wrote a new file with active commit hash? And then just read from that file to get the hash. Same thing could be applied for `yarn build`. For `actual`: the hash here would be different. No quick ideas how to solve it.
Author
Owner

@matt-fidd commented on GitHub (Jun 25, 2024):

Ah sorry! Slipped my mind that this was in actual not actual-server. Generating the file for the server on start is a great idea and would sort that out though!

actual gets its version information directly from package.json, but generating the same file on start and reading from it should do the trick? I'm going to have to think a bit about how builds work and how it would work bundled into actual-server. Maybe if the file isn't there we know it's been imported not directly started and we can fallback to the version in package.json. It wouldn't work for edge builds of actual packaged into actual-server though.

@matt-fidd commented on GitHub (Jun 25, 2024): Ah sorry! Slipped my mind that this was in `actual` not `actual-server`. Generating the file for the server on start is a great idea and would sort that out though! `actual` gets its version information directly from `package.json`, but generating the same file on start and reading from it should do the trick? I'm going to have to think a bit about how builds work and how it would work bundled into `actual-server`. Maybe if the file isn't there we know it's been imported not directly started and we can fallback to the version in package.json. It wouldn't work for edge builds of actual packaged into `actual-server` though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#1173