Commit Graph

220 Commits

Author SHA1 Message Date
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
3120a2c43f appstore: more state information 2026-02-21 12:05:56 +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
5ca2078461 add iconUrl to manifest 2026-02-06 18:04:47 +01:00
Girish Ramakrishnan
6533ba4581 appstore: include provider as part of state 2026-01-29 11:46:57 +01:00
Johannes Zellner
e12f5e41ff Better error for invalid update versions 2026-01-06 15:54:55 +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
Johannes Zellner
a261d8b754 Do not allow unlinking from cloudron.io account in demo mode 2025-10-31 08:47:05 +01:00
Girish Ramakrishnan
5b43de944d activation: update features after registering cloudron 2025-10-02 11:18:42 +02:00
Johannes Zellner
f69bdd1ac4 This aint the real superagent 2025-10-01 17:16:21 +02:00
Johannes Zellner
01f10baa18 subscription POST api is /subscription3 2025-10-01 16:46:30 +02:00
Johannes Zellner
23178b24c6 Send cloudron state along with fetching subscription state 2025-10-01 16:44:53 +02:00
Johannes Zellner
295aafddf0 Use appUpdates feature flag 2025-10-01 14:35:14 +02:00
Johannes Zellner
38267a26c1 Send some metrics 2025-09-29 16:16:22 +02:00
Girish Ramakrishnan
8a20c1812f Fix cloudron appstore link 2025-09-24 22:11:43 +02:00
Girish Ramakrishnan
98d4d99c1b appstore: add unlink account route 2025-09-24 21:49:24 +02:00
Girish Ramakrishnan
5723717576 appstore: add note on token check 2025-09-24 20:56:54 +02:00
Girish Ramakrishnan
43cc91aca2 fix tests 2025-09-13 15:22:01 +02:00
Girish Ramakrishnan
82c8fa2640 Revert "Add generic 412 http response handler to ask for dashboard refresh"
This reverts commit 11a6cf8236.

It's unclear in what situations a 412 handler that refreshes the dashboard will help.

We use BoxError.INVALID_CREDENTIALS to be 412.

* Used as internal error code for failed password, app password and totp check
* When password is wrong in external ldap syncing
* appstore token is invalid

In all cases, a dashboard refresh will do nothing afaict. For good measure, I have
converted appstore token case into LICENSE_ERROR which is a 402.
2025-09-11 12:42:12 +02:00
Johannes Zellner
d6d70163d5 Do not reregister during activation if already registerd by setupToken 2025-08-20 17:50:43 +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
Johannes Zellner
4fa65099f9 Add multipleBackupTargets and encryptedBackups to features 2025-08-05 12:03:32 +02:00
Girish Ramakrishnan
e7799fef1c appstore: fail properly for non-200 when downloading icon 2025-07-21 12:11:26 +02:00
Johannes Zellner
ce63dbde1b Check current subscription status once a day 2025-07-16 22:11:11 +02:00
Girish Ramakrishnan
313256adff use @cloudron/manifest-format 2025-07-10 11:17:04 +02:00
Girish Ramakrishnan
6ac0cd421a use the @cloudron/superagent module 2025-07-10 10:56:05 +02:00
Girish Ramakrishnan
19c9d7d59d updateInfo: move updateInfo into apps table
this has many advantages:
* easy to deliver the updateInfo via the apps object
* after updating, the task can clear it
* when apps are deleted, the info is automatically gone

otherwise, it's a mess of deps between apps/updater/apptask/rest routes

box update info is still in a file
2025-06-26 15:47:15 +02:00
Girish Ramakrishnan
e0af49f638 appstore: automatic is not stableOnly 2025-06-25 18:17:29 +02:00
Girish Ramakrishnan
ef9a17a28a appstore: make the features file readable 2025-06-13 10:50:04 +02:00
Johannes Zellner
23f7c1522e Always start with default features 2025-06-10 11:08:17 +02:00
Johannes Zellner
a556237963 Ensure we start with a default features set if features file cannot be loaded/parsed 2025-06-10 09:34:15 +02:00
Girish Ramakrishnan
0f3eb42332 test: fix provision test 2025-06-06 15:48:21 +02:00
Girish Ramakrishnan
1b6e283ac1 appstore: better error message 2025-06-06 13:45:23 +02:00
Girish Ramakrishnan
7b9504c5b4 test: add provision test 2025-06-06 13:39:30 +02:00
Girish Ramakrishnan
c49050ea69 appstore: removed old route and rename to reset_cloudron_id 2025-06-06 13:39:30 +02:00
Girish Ramakrishnan
73bd3e513c appstore: fix response fields from register_cloudron3 2025-06-06 10:19:37 +02:00
Girish Ramakrishnan
2c2a24c31b support: remove createTicket
there is no form to create tickets anymore since a while
2025-06-06 09:51:07 +02:00
Girish Ramakrishnan
28a1c254d9 activation: move registration into provision model code 2025-06-06 09:31:31 +02:00
Johannes Zellner
16c8721d6c Show subscription badge where required and disable UI elements accordingly 2025-05-13 18:11:10 +02:00
Johannes Zellner
b8dcfcf900 Remove app purchase/unpurchase 2025-05-13 11:46:13 +02:00
Johannes Zellner
faf6ea83fa Add provisional cloudron flow 2025-05-13 11:38:54 +02:00
Girish Ramakrishnan
ea4c140ad0 appstore: lazy load the feature cache
the tests work more reliably with this
2025-05-09 09:50:01 +02:00
Johannes Zellner
a67b4a5059 Add branding hooks for plan usage 2025-05-07 21:33:33 +02:00
Johannes Zellner
d831624d43 Do not crash if the cached feature file cannot be loaded 2025-05-07 16:22:17 +02:00
Johannes Zellner
186a336232 null in features means 'unlimited' 2025-05-07 15:37:31 +02:00
Johannes Zellner
974fd19b40 Ensure we always have a features object expected by that version 2025-05-07 15:03:26 +02:00
Johannes Zellner
21d7dd873e Adjust feature set 2025-05-06 18:49:56 +02:00
Girish Ramakrishnan
8e58349bfa replace with custom superagent based on fetch API 2025-02-15 15:14:09 +01:00