-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] hosting the sync-server with the desktop app (POC) #3631
base: master
Are you sure you want to change the base?
[WIP] hosting the sync-server with the desktop app (POC) #3631
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
This seems very cool! |
@@ -37,6 +37,7 @@ fi | |||
yarn workspace loot-core build:node | |||
|
|||
yarn workspace @actual-app/web build --mode=desktop | |||
yarn workspace @actual-app/crdt build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crdt is a dependency of actual-server. Build it before packaging the sync-server
} | ||
|
||
if (Array.isArray(accountId) != Array.isArray(startDate)) { | ||
console.log(accountId, startDate); |
Check failure
Code scanning / CodeQL
Use of externally-controlled format string High
user-provided value
); | ||
} | ||
if (Array.isArray(accountId) && accountId.length !== startDate.length) { | ||
console.log(accountId, startDate); |
Check failure
Code scanning / CodeQL
Use of externally-controlled format string High
user-provided value
} | ||
|
||
try { | ||
await fs.writeFile(getPathForUserFile(fileId), req.body); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
} | ||
|
||
res.setHeader('Content-Disposition', `attachment;filename=${fileId}`); | ||
res.sendFile(getPathForUserFile(fileId)); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
// Source: https://expressjs.com/en/guide/error-handling.html | ||
return next(err); | ||
} | ||
console.log(`Error on endpoint ${req.url}`, err.message, err.stack); |
Check failure
Code scanning / CodeQL
Use of externally-controlled format string High
user-provided value
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
…lectron/server-hosting
The goal
Free server hosting via the desktop app. We'd run the sync server inside of the desktop app, expose it to the internet via ngrok (or similar) and provide a QR code/url for the user to connect their phone to the server.
We could provide an option to start actual-server when the computer starts up. If we did this the server would be alive whenever the computer is on. If the user downloads the pwa to their phone they could budget even when the server is offline - it would sync when the computer is turned back on.
Todos:
In a follow up feature:
Known issues
Next: Figure out the best way to bring actual-server into the actual repo
Expose the running server to the internet
Manged to get it working with ngrok. Ngrok's big and they give you a free domain. It works a treat. I haven't tested it in anger, I'm sure it will disconnect me after an hour or so so we may need to add logic to reconnect.
Thoughts on bundling the actual-server code
Old thoughts:
Server sync notes