Commit Graph

906 Commits

Author SHA1 Message Date
Girish Ramakrishnan
b40a10da7b restore: prune portBindings whose tcpPorts/udpPorts no longer exist
fixes #871
2026-03-27 18:47:52 +01:00
Girish Ramakrishnan
25f5b33d17 Remove unused secondaryDomains in update and restore code paths
fixes #814
2026-03-27 17:46:28 +01:00
Girish Ramakrishnan
99b234eca8 source install: persist buildConfig so restore, import, clone work correctly 2026-03-27 16:10:43 +01:00
Girish Ramakrishnan
4859059eba source install: support dockerfileName and build options 2026-03-21 17:29:47 +01:00
Girish Ramakrishnan
8f1f3645b2 app update: if backup fails, provide a notification
fixes #851
2026-03-15 14:48:07 +05:30
Girish Ramakrishnan
f12b4faf34 lint 2026-03-12 23:23:23 +05:30
Girish Ramakrishnan
01d0c738bc replace debug() with our custom logger
mostly we want trace() and log(). trace() can be enabled whenever
we want by flipping a flag and restarting box
2026-03-12 23:08:35 +05:30
Girish Ramakrishnan
4bc0f44789 services: lazy start services / on demand services
services are now stopped when no app is using them.

on start up, services are always created and run. they are later
stopped when unused. it's this way to facilitate the upgrade code
path. the database meta files have to be upgraded even if no app is using them.
the other hook to stop unused services is at the end of an app task.

maybe mail container is a candidate for the future where all sending is no-op.
But give this is rare, it's not implemented.
2026-03-08 18:35:50 +05:30
Girish Ramakrishnan
61d4a795ae apps: enable storage view in all error states 2026-02-28 02:20:25 +01:00
Girish Ramakrishnan
4be31b0dad update: if no backup site, show error message 2026-02-24 05:55:56 +01:00
Girish Ramakrishnan
4ad9ccabe0 apps: refactor the updateInfo properties 2026-02-21 20:01:05 +01:00
Girish Ramakrishnan
202f2c6cb0 updater: keep updateInfo response same as in the app object 2026-02-21 16:43:03 +01:00
Girish Ramakrishnan
7ba3a59dea eventlog: add flag for source builds 2026-02-21 11:48:39 +01:00
Girish Ramakrishnan
cf0ab16533 fix test 2026-02-18 20:20:26 +01:00
Johannes Zellner
0a924b2c29 Cleanup mailPasswords when oidc client is removed not only when an app is uninstalled 2026-02-18 17:15:06 +01:00
Johannes Zellner
9bac099339 Add mailPassword table
This table stores email credentials for users using apps which use the
email addon
2026-02-18 10:12:34 +01:00
Girish Ramakrishnan
4ed6fbbd74 eslint: add no-shadow 2026-02-18 08:18:37 +01:00
Girish Ramakrishnan
81659d4bf2 eventlog: add params for from and to date 2026-02-16 20:52:02 +01:00
Girish Ramakrishnan
fc2e39f41b Rename getByIdentifierAndStatePaged to listByIdentifierAndStatePaged 2026-02-15 12:22:43 +01:00
Girish Ramakrishnan
2597402496 make build work across server restart
tmp files disappear on server restart
2026-02-14 19:37:14 +01:00
Girish Ramakrishnan
e9f96593c3 reorder functions for no-use-before-define 2026-02-14 16:34:34 +01:00
Girish Ramakrishnan
36aa641cb9 migrate to "export default"
also, set no-use-before-define in linter
2026-02-14 15:43:24 +01:00
Girish Ramakrishnan
96dc79cfe6 Migrate codebase from CommonJS to ES Modules
- Convert all require()/module.exports to import/export across 260+ files
- Add "type": "module" to package.json to enable ESM by default
- Add migrations/package.json with "type": "commonjs" to keep db-migrate compatible
- Convert eslint.config.js to ESM with sourceType: "module"
- Replace __dirname/__filename with import.meta.dirname/import.meta.filename
- Replace require.main === module with process.argv[1] === import.meta.filename
- Remove 'use strict' directives (implicit in ESM)
- Convert dynamic require() in switch statements to static import lookup maps
  (dns.js, domains.js, backupformats.js, backupsites.js, network.js)
- Extract self-referencing exports.CONSTANT patterns into standalone const
  declarations (apps.js, services.js, locks.js, users.js, mail.js, etc.)
- Lazify SERVICES object in services.js to avoid circular dependency TDZ issues
- Add clearMailQueue() to mailer.js for ESM-safe queue clearing in tests
- Add _setMockApp() to ldapserver.js for ESM-safe test mocking
- Add _setMockResolve() wrapper to dig.js for ESM-safe DNS mocking in tests
- Convert backupupload.js to use dynamic imports so --check exits before
  loading the module graph (which requires BOX_ENV)
- Update check-install to use ESM import for infra_version.js
- Convert scripts/ (hotfix, release, remote_hotfix.js, find-unused-translations)
- All 1315 tests passing

Migration stats (AI-assisted using Cursor with Claude):
- Wall clock time: ~3-4 hours
- Assistant completions: ~80-100
- Estimated token usage: ~1-2M tokens

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 15:11:45 +01:00
Girish Ramakrishnan
ae09c19b69 filemanager: open terminal in cwd 2026-02-12 20:30:57 +01:00
Girish Ramakrishnan
c3d3c3a6e9 app: if repo changes, do not autoupdate 2026-02-09 15:51:47 +01:00
Girish Ramakrishnan
a9ae34b149 community: download iconUrl
also rename existing db field appStoreIcon to packageIcon
2026-02-06 19:13:55 +01:00
Girish Ramakrishnan
aa362477e8 community: validate the url in the dialog 2026-02-05 22:40:37 +01:00
Girish Ramakrishnan
d6eb6d3e3e community: store versionsUrl in the database 2026-02-05 19:32:29 +01:00
Johannes Zellner
a7929e142f Build local image for updates in apptask 2026-01-27 22:01:18 +01:00
Johannes Zellner
fd0d65b8ce Keep the app source archive with the app instance data dir 2026-01-27 22:01:18 +01:00
Girish Ramakrishnan
a1b4fdf624 csp: allow multiple lines and add presets 2026-01-13 17:39:00 +01:00
Girish Ramakrishnan
c448322367 backups: fix download 2025-12-06 11:19:05 +01:00
Girish Ramakrishnan
620974217a restore: teardown pseudo backup site 2025-12-05 16:12:59 +01:00
Girish Ramakrishnan
cc8db71ecf apps: typo caused invalid backupId 2025-11-26 14:39:16 +01:00
Girish Ramakrishnan
bbdfbe1ab7 restore: when restoring apps, use the latest backup id
this ignores the user provided site information. the site contents may or may
not contain this app.
2025-11-25 18:12:54 +01:00
Johannes Zellner
610651066a Fix tgz app backup download
Fixes #868
2025-11-05 18:14:48 +01:00
Girish Ramakrishnan
5bd6001f95 boxerror: details is not a subobject 2025-10-17 20:42:19 +02:00
Girish Ramakrishnan
54cd9c7afa Use JSON query to remove the app id from site
the original regexp does not work for leading comma like [ "box", "appid" ]
2025-09-30 19:43:08 +02:00
Girish Ramakrishnan
edcffd3417 Remove app from backup sites when uninstalled 2025-09-30 18:22:22 +02:00
Girish Ramakrishnan
5dd5a20fc1 code -> sqlCode 2025-09-29 12:18:26 +02:00
Girish Ramakrishnan
19df2e0baa ER_DUP_ENTRY is passed as code and not in message 2025-09-24 10:50:25 +02:00
Girish Ramakrishnan
5157789774 backups: add per site enabledForUpdates flag
previously, we had a singleton 'main' flag to indicate a site can
be used for updates. with this new approach, we can get rid of the
'primary' concept. each site can be used for updates or not.
2025-09-22 18:03:01 +02:00
Girish Ramakrishnan
c5b7264f1a rename backupTargets to backupSites 2025-09-12 10:32:37 +02:00
Johannes Zellner
12e4441227 BoxError always needs a second argument 2025-08-21 11:20:18 +02:00
Johannes Zellner
5f9789f99f Enforce app count limit during installation 2025-08-20 20:03:09 +02:00
Girish Ramakrishnan
12e073e8cf use node: prefix for requires
mostly because code is being autogenerated by all the AI stuff using
this prefix. it's also used in the stack trace.
2025-08-14 12:55:35 +05:30
Girish Ramakrishnan
1d1197e18a restore: use PENDING_RESTORE instead of PENDING_IMPORT 2025-08-05 12:46:50 +02:00
Girish Ramakrishnan
36ab052dda restore: import with the latest backup on cloudron restore
in previous versions, the single backup target was replaced during
restore. we cannot do this anymore with multiple backup targets.

during cloudron restore, a pseudo target is created and all the apps
are restored using this backup target.
2025-08-04 23:24:06 +02:00
Girish Ramakrishnan
ead6d9c7d3 Fix app import 2025-08-02 20:42:12 +02:00
Girish Ramakrishnan
c935744f4c backups: root ~~canal~~ path surgery
remove rootPath and getBackupFilePath from the backup target and
make this backend specific.
2025-08-02 10:15:34 +02:00