Commit Graph

1295 Commits

Author SHA1 Message Date
Girish Ramakrishnan 2c12bee79b syncer: fix bug with a file and dir having same prefix
if we had say "app/" and "application.json", the syncer logic
was skipping over application.json because it starts with "app".
This would lead to application.json not getting deleted in the snapshot
and result in superfluous files.
2026-03-04 13:59:35 +05:30
Girish Ramakrishnan ea5953a397 Fix test 2026-02-21 20:27:55 +01:00
Girish Ramakrishnan eb5f8fcfa1 community: better resolution of url 2026-02-21 11:17:47 +01:00
Girish Ramakrishnan 461a5a780d community: resolve user provided url 2026-02-19 22:25:43 +01:00
Girish Ramakrishnan f62629b513 mailpassword: fix test, remove unused function 2026-02-19 14:22:36 +01:00
Girish Ramakrishnan f04087815c Fix failing test 2026-02-19 13:48:48 +01:00
Girish Ramakrishnan d0a66f1701 Back to mocha!
sorry i ever left you dear mocha

node:test has two major issues:
* --bail does not work and requires strange modules and incantations.
I was able to work around this with a custom module.

* the test reporter reports _after_ the suite is run. this makes debugging
really hard. the debugs that we print all happen before the test suite summary.
poor design overall.
2026-02-19 13:24:14 +01:00
Girish Ramakrishnan c176ac600b migrate tests to node:test 2026-02-19 10:13:22 +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 319360f8d0 lint 2026-02-17 19:51:09 +01:00
Girish Ramakrishnan 3ef990b0bf Fix typo 2026-02-17 18:48:07 +01:00
Girish Ramakrishnan b8ae46b6df add passkey tests 2026-02-17 18:05:14 +01:00
Girish Ramakrishnan 113aba0897 remove the cors test 2026-02-17 17:15:30 +01:00
Girish Ramakrishnan 81659d4bf2 eventlog: add params for from and to date 2026-02-16 20:52:02 +01:00
Girish Ramakrishnan b5a1554631 Fix various linter errors 2026-02-15 19:37:30 +01:00
Girish Ramakrishnan c7b321315c integrity: add stats 2026-02-15 14:41:10 +01:00
Girish Ramakrishnan 9f2eefcbb3 embed integrity check task in backup API responses
The UI is polling for the taskId, might as well attach it
2026-02-15 14:11:56 +01:00
Girish Ramakrishnan fc2e39f41b Rename getByIdentifierAndStatePaged to listByIdentifierAndStatePaged 2026-02-15 12:22:43 +01:00
Girish Ramakrishnan 361d80da17 make tests work again 2026-02-14 19:45:10 +01:00
Girish Ramakrishnan b71e503a01 more ESM cleanups 2026-02-14 16:52:16 +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 e9c3e42aa6 appPassword: add expiry 2026-02-12 16:23:31 +01:00
Girish Ramakrishnan 5276321ade integrity: add integrity check fields and initial UI 2026-02-08 23:26:57 +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 dfe2d27709 comment out some logs 2026-01-31 12:09:55 +01:00
Girish Ramakrishnan 72c494e9dc backuptask: fix usage of upload API 2026-01-21 09:48:21 +01:00
Girish Ramakrishnan efccf2729b start moving openssl commands into openssl.js 2026-01-17 15:28:44 +01:00
Girish Ramakrishnan 73e929f0cf test: Happy new year! 2026-01-01 10:10:39 +01:00
Girish Ramakrishnan f714cd66f7 rework mail domain stats
We can now show list count, alias count as well in the mail domains UI
2025-12-05 13:32:07 +01:00
Girish Ramakrishnan c162fd178b Fix tests 2025-11-28 17:40:13 +01:00
Girish Ramakrishnan 2a3110cd3d network: detect default ipv6 interface when no ipv4 interface 2025-11-28 10:02:36 +01:00
Girish Ramakrishnan fb04f78112 backupcleaner: fix listing of backups by site 2025-10-21 13:56:08 +02:00
Girish Ramakrishnan e349193745 Fix tests 2025-10-13 13:14:50 +02:00
Girish Ramakrishnan 68dd1fbedb rename function to listByTypePaged 2025-10-07 12:07:46 +02:00
Girish Ramakrishnan 6869380500 Fix tests 2025-10-07 10:01:35 +02:00
Girish Ramakrishnan b21d29098b tasks: refactor listByTypePaged into list with options
this way we can list by prefix (coming commit)
2025-10-06 19:28:51 +02:00
Johannes Zellner 38267a26c1 Send some metrics 2025-09-29 16:16:22 +02:00
Girish Ramakrishnan f8e5a65f95 Fix test 2025-09-24 14:09:06 +02:00
Girish Ramakrishnan 50d37ad752 Fix consistent use of enabledForUpdates -> enableForUpdates 2025-09-23 16:43:17 +02:00
Girish Ramakrishnan cc939de641 Fixup tests 2025-09-22 20:17:34 +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 305441ea28 backups: remove noop backend
the noop backend is migrated into 0 sites config.

when the updater code sees that there is no site to backup, it will
just fail. user has to manually update with skipBackup flag.
2025-09-22 16:44:12 +02:00
Girish Ramakrishnan 4c3a8e1fd7 backup site: add contents
it is a json that can be one of the three:

* null - include everything
* include - only include these ids
* exclude - everything except these ids
2025-09-22 13:28:16 +02:00
Girish Ramakrishnan 43cc91aca2 fix tests 2025-09-13 15:22:01 +02:00
Girish Ramakrishnan c5b7264f1a rename backupTargets to backupSites 2025-09-12 10:32:37 +02:00
Girish Ramakrishnan 832a25601d storage: make listDir return paths relative to the root
this seems more natural to work with
2025-08-16 18:13:02 +05:30
Girish Ramakrishnan 08c2e989fa syncer: fix test 2025-08-14 16:16:58 +05:30
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