Commit Graph

68 Commits

Author SHA1 Message Date
Girish Ramakrishnan 3d55423deb Fix usage of safe() 2026-03-18 14:26:42 +05:30
Girish Ramakrishnan f12b4faf34 lint 2026-03-12 23:23:23 +05:30
Girish Ramakrishnan ff49759f42 promise-retry: rename api to log 2026-03-12 23:11:16 +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 7c6a783fc8 tasks: fix progress percents
mostly rebalancing the percents
2026-03-04 16:37:34 +05:30
Girish Ramakrishnan 4ed6fbbd74 eslint: add no-shadow 2026-02-18 08:18:37 +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 f421fd771f Prefix domain (un)register calls with the domain which failed
The info would also be in the extra error info, however we catch the
error in apptask and here we don't know if this is a domain error or
something else.
2025-12-09 14:36:38 +01:00
Johannes Zellner 5ba30d0236 add hetznercloud DNS provider 2025-10-20 15:05:19 +02:00
Girish Ramakrishnan 43e426ab9f Revert "Add no-use-before-define linter rule"
This reverts commit fdcc5d68a2.

Unfortunately, this requires us to move exports to the bottom.
This in turn causes circular dep issues and also access of
exports.GLOBAL_VAR in the global context
2025-10-08 21:17:52 +02:00
Girish Ramakrishnan 5dd5a20fc1 code -> sqlCode 2025-09-29 12:18:26 +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 d9c104613c tasks: rework the startTask API
it is now async. change was required to reset the pending flag
2025-06-17 19:32:46 +02:00
Girish Ramakrishnan a7c6e36ec3 replace ipaddr.js 2025-05-06 16:26:35 +02:00
Girish Ramakrishnan c61357ec6d Revert "tld.isValid is deprecated"
This reverts commit daff760280.

deprecated but hasn't seen a release in 7 years
2025-02-05 10:51:05 +01:00
Girish Ramakrishnan daff760280 tld.isValid is deprecated 2025-02-05 10:39:49 +01:00
Girish Ramakrishnan 9ec5fc29aa dns: return same type 2024-12-16 09:55:54 +01:00
Girish Ramakrishnan 1d0f3a08f4 porkbun: it is really slow 2024-12-16 09:46:38 +01:00
Girish Ramakrishnan 26caacc12e Fix debugs 2024-11-30 10:18:48 +01:00
Girish Ramakrishnan 78520e09c3 domains: add inwx provider 2024-11-26 19:13:33 +05:30
Girish Ramakrishnan 61341b8380 boxerror: always pass second error string 2024-10-30 17:32:12 +01:00
Girish Ramakrishnan efa1acddd4 dns: unregister domains if type is disabled 2024-04-27 18:43:31 +02:00
Girish Ramakrishnan 2a6368af60 remove usage of constants.DASHBOARD_SUBDOMAIN 2024-04-27 11:10:24 +02:00
Girish Ramakrishnan f6e4f1aefc network: ipv4 can be disabled 2024-04-25 15:50:42 +02:00
Girish Ramakrishnan cae2bfbdc2 domains: add desec provider 2024-04-24 21:29:42 +02:00
Girish Ramakrishnan b88afbac4e dns: add ovh backend 2023-11-06 15:22:24 +01:00
Girish Ramakrishnan eb1f3d8b55 dns: add dnsimple 2023-10-24 00:26:10 +02:00
Girish Ramakrishnan 68aab74185 Fix progress callback message 2023-08-22 16:28:48 +05:30
Girish Ramakrishnan b895cc6aad capitalize progress 2023-08-21 14:40:57 +05:30
Girish Ramakrishnan 4acbb7136a proper task name for dashboard change 2023-08-14 10:45:12 +05:30
Girish Ramakrishnan abff970169 make use of fqdn function 2023-08-14 09:35:08 +05:30
Girish Ramakrishnan eee49a8291 move dashboard setting into dashboard.js 2023-08-11 21:04:10 +05:30
Girish Ramakrishnan 4cdf37b060 settings: move mailFqdn/Domain into mailServer 2023-08-04 22:02:24 +05:30
Girish Ramakrishnan a49cb0b080 move sync_dns out of cloudron route into domains 2023-08-04 12:55:57 +05:30
Girish Ramakrishnan 47d57a3971 fold sysinfo into network
the backends are network backends
2023-08-03 13:38:42 +05:30
Girish Ramakrishnan ee836e6646 mail: 'my' location is available as mail location
move the reserve domains check to app location validation code
2023-08-01 19:33:59 +05:30
Girish Ramakrishnan a846dc5bf1 add bunny 2023-04-21 12:14:06 +02:00
Girish Ramakrishnan 3616fbb51c dns: add porkbun
domain setup ui
2023-03-16 20:21:39 +01:00
Girish Ramakrishnan 3bdc5731ea syncDns: sync secondary dns records 2023-02-08 23:16:48 +01:00
Girish Ramakrishnan b70572a6e9 dns: fqdn only needs domain string
This is from the caas days, when we had hyphenated subdomains flag
2022-11-28 21:56:25 +01:00
Girish Ramakrishnan 116cde19f9 constants: location -> subdomain 2022-07-14 15:18:17 +05:30
Girish Ramakrishnan 1549f6a4d0 fix various terminology in code
subdomain, domain - strings
location - { subdomain, domain }
bundle - { cert, key }
bundlePath - { certFilePath, keyFilePath }

vhost is really just for virtual hosting
fqdn for others
2022-07-13 10:15:09 +05:30
Girish Ramakrishnan 6371b7c20d dns: add hetzner 2022-05-02 22:33:30 -07:00
Girish Ramakrishnan 05d7a7f496 constness 2022-04-14 17:50:41 -05:00
Girish Ramakrishnan 3f633c9779 dns: check for CNAME record
Check if CNAME record exists and remove it if overwrite is set
2022-03-29 13:53:34 -07:00
Girish Ramakrishnan 62142c42ea Fix crash 2022-02-25 11:03:16 -08:00
Girish Ramakrishnan c6da8c8167 make ipv4 and ipv6 settings separate 2022-02-15 12:36:05 -08:00
Girish Ramakrishnan 964c1a5f5a remove field from errors
we have standardized on indexOf in error.message by now
2022-02-07 13:44:29 -08:00
Girish Ramakrishnan 5c56cdfbc7 Revert "tld.isValid is deprecated"
This reverts commit bd4097098d.

the published library does not have the function :/
2022-02-04 10:49:19 -08:00