Commit Graph

523 Commits

Author SHA1 Message Date
Johannes Zellner
918c2f8587 Move to @cloudron/safetydance 2026-04-01 09:49:34 +02:00
Girish Ramakrishnan
8b138d14bb backup site: remove the local disk provider
we already have ext4, xfs, mountpoint and filesystem to cover all cases

fixes #879
2026-03-30 14:37:48 +02:00
Girish Ramakrishnan
99b234eca8 source install: persist buildConfig so restore, import, clone work correctly 2026-03-27 16:10:43 +01:00
Girish Ramakrishnan
e9d42b9cdd migration: if no autoupdate setting, use defaults 2026-03-18 11:15:24 +05:30
Girish Ramakrishnan
009d0b39f9 rename twoFactor* to totp 2026-03-16 16:38:42 +05:30
Girish Ramakrishnan
f334c696cb update: add policy to update apps separately from platform 2026-03-16 10:19:18 +05:30
Girish Ramakrishnan
d377d1e1cf remove deprecated url 2026-03-10 15:15:17 +05:30
Johannes Zellner
43acecfc6e mailPasswords table should work with oidc clients not apps 2026-02-18 15:17:08 +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
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
Johannes Zellner
5724ca73b4 Add passkey support 2026-02-13 17:18:56 +01:00
Girish Ramakrishnan
88a44ee065 oidc: add alg to the jwks keys 2026-02-12 19:42:00 +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
d6eb6d3e3e community: store versionsUrl in the database 2026-02-05 19:32:29 +01:00
Johannes Zellner
f0fb420a8d Skip checklist db migration script if no owner exists 2026-02-03 18:41:39 +01:00
Johannes Zellner
d04afc26e7 Add db migration to ensure done checklist items have an owner and timestamp 2026-02-01 13:57:55 +01:00
Girish Ramakrishnan
efccf2729b start moving openssl commands into openssl.js 2026-01-17 15:28:44 +01:00
Girish Ramakrishnan
2b362d8eaf users: add note about invitationToken
this is a one time token that is valid until the account is set up.
this is the reason it has no expiry time.
2026-01-17 09:44:43 +01:00
Girish Ramakrishnan
22cb7f7d8f addons is optional 2025-12-18 18:30:30 +01:00
Girish Ramakrishnan
6247cece94 backup site: create info dir of the clone site 2025-11-17 09:08:46 +01:00
Girish Ramakrishnan
417f5c3610 backup site: fix migration with mixed formats 2025-11-16 12:07:44 +01:00
Girish Ramakrishnan
d894de0784 cloudflare: ensure defaultProxyStatus in older configs
in Cloudron 9, we introduced an automated domain credentials check.
when checking with older cloudflare configs, this fails.
2025-11-10 10:18:32 +01:00
Girish Ramakrishnan
2da99673cd do not store "null" as string in database
in other news, JSON.parse('null') returns null.
2025-11-04 09:02:58 +01:00
Girish Ramakrishnan
1b33b2c48c migrate old backup tasks to new type 2025-10-06 14:52:29 +02:00
Girish Ramakrishnan
f44ff12a5f Fix ordering of columns 2025-10-01 12:49:09 +02:00
Girish Ramakrishnan
ab0f8fc081 backupsite: remove bc- prefix from id 2025-10-01 10:27:20 +02:00
Johannes Zellner
3bfa7b1cdd Column is called enableForUpdates 2025-09-23 21:23:33 +02:00
Girish Ramakrishnan
50d37ad752 Fix consistent use of enabledForUpdates -> enableForUpdates 2025-09-23 16:43:17 +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
4686e38a5e schema: add contentsJson to backupSites 2025-09-22 17:05: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
c5b7264f1a rename backupTargets to backupSites 2025-09-12 10:32:37 +02:00
Girish Ramakrishnan
fd2705a49d schema: more missing fields 2025-08-14 20:28:34 +05:30
Girish Ramakrishnan
935c9a50ab schema: add missing fields 2025-08-14 19:58:30 +05:30
Girish Ramakrishnan
f2225ff6b6 fs.rmdirSync { recursive: true } is deprecated 2025-08-14 13:43:41 +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
Girish Ramakrishnan
d3b77c3be1 rsync: delete any existing rsync cache files 2025-08-14 10:40:36 +05:30
Girish Ramakrishnan
2e16dd983f backups: stash the stats to the backups table 2025-08-12 20:21:54 +05:30
Girish Ramakrishnan
47fc9561ab backups (tgz): save integrity information
we generate a signing key pair for each target. Initially, I had this
as global. We needed a route to return the public key and putting it
under backup target seemed natural. Since we delete the backups when
we delete a target, we lose all the signing hashes. So, it's fine to lose
the key pair on target delete.
2025-08-12 19:00:29 +05:30
Girish Ramakrishnan
f8d74bbb6d backuptarget: add default at provisioning time (again)
we clear the db in the tests. the tests run the setup again and again.
so, it's easier to add default values in provision time instead of
migration.
2025-08-06 11:11:11 +02:00
Girish Ramakrishnan
c4ee21bdb0 Revert "provision: add default backup target after setup"
This reverts commit 1a0d1f7d79.

20171205124434-settings-default-backupConfig.js already adds the default
2025-08-05 13:41:26 +02:00
Girish Ramakrishnan
1a0d1f7d79 provision: add default backup target after setup 2025-08-04 14:33:12 +02:00
Girish Ramakrishnan
132132307f backuptarget: rename label to name 2025-08-04 14:28:37 +02:00
Girish Ramakrishnan
5c1147bfa4 backupTargets: id is not used in config 2025-08-04 09:49:06 +02:00
Girish Ramakrishnan
547d8ae113 filesystem: rename backupFolder to backupDir 2025-08-02 10:37:37 +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