Commit Graph

165 Commits

Author SHA1 Message Date
Girish Ramakrishnan
3ef990b0bf Fix typo 2026-02-17 18:48:07 +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
f8a44014f7 installer: check for process instead of locks 2026-02-06 12:02:46 +01:00
Girish Ramakrishnan
89b6513217 installer: need at least ubuntu 22 2026-01-30 09:55:53 +01:00
Girish Ramakrishnan
16a8caa8db installer: better log messages 2026-01-30 09:54:33 +01:00
Girish Ramakrishnan
4b36de5200 Update docker to 29.1.5 2026-01-23 10:02:57 +01:00
Girish Ramakrishnan
88d37e99aa docker: compare debian package version instead of docker version
this way after an ubuntu upgrade, we update it with the correct
docker package on the next cloudron upgrade
2026-01-23 09:30:44 +01:00
Girish Ramakrishnan
057fd18139 Update nodejs to 24.13.0 2026-01-23 09:04:57 +01:00
Girish Ramakrishnan
b2c434a1fd installer: make docker pull timeout if pull hangs 2026-01-13 10:37:14 +01:00
Girish Ramakrishnan
73ed60059f Update node to 22.20.0 2025-10-02 08:31:19 +02:00
Girish Ramakrishnan
c69bc77a7a cloudron-support: fix docker version script 2025-09-11 09:18:01 +02:00
Girish Ramakrishnan
1720feeeee add note on docker version 2025-08-26 10:26:03 +02:00
Johannes Zellner
cb3dffc7fc Use docker 28.1.1 since that is the highest on ubuntu 20 focal 2025-06-30 22:30:54 +02:00
Girish Ramakrishnan
27c4069187 Update node to 22.7.0 2025-06-25 11:17:57 +02:00
Girish Ramakrishnan
4b2c0b0771 Update docker to 28.3.0 2025-06-25 11:16:42 +02:00
Girish Ramakrishnan
1ba9513a4e installer: directly stop box code
the idea (previously) was that the box code knew how to stop itself.
this is why stop.sh of the _old_ code was invoked. we can just inline
the code needed to stop the old version into installer.sh itself.
2025-06-15 17:40:45 +02:00
Girish Ramakrishnan
1095e47e6f installer: better variable name 2025-06-15 17:38:39 +02:00
Girish Ramakrishnan
085ed59334 installer: remove old untagging logic 2025-02-28 23:30:02 +01:00
Girish Ramakrishnan
46620e2da5 update the PSL on box code update
I tried replacing the module but it's complicated since there is a
lot of rules - https://github.com/publicsuffix/list/wiki/Format#format
2025-02-10 17:42:56 +01:00
Girish Ramakrishnan
42f493b2c3 docker: update to 27.5.1 2025-02-05 14:48:13 +01:00
Girish Ramakrishnan
5a766c583c node: update to 22.13.1 2025-02-05 14:48:13 +01:00
Girish Ramakrishnan
bd107e849b infra: no more images.base 2024-12-14 20:18:07 +01:00
Girish Ramakrishnan
5ae29eabaa docker: try ipv4 and then ipv6 explicitly
To get the ratelimits:
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest

docker appears to have some simple approach to track ipv6 limits.
2024-12-14 17:05:13 +01:00
Girish Ramakrishnan
d9e4aeb518 docker: replace pull with tag to not hit rate limits 2024-12-14 16:16:33 +01:00
Girish Ramakrishnan
878caff378 improve the comment 2024-12-14 14:01:38 +01:00
Girish Ramakrishnan
948efbaa76 docker: upgrade docker to 27.3.1 2024-11-23 20:31:44 +05:30
Girish Ramakrishnan
0f3ab11532 Update node to 20.18.0
We need https://nodejs.org/dist/latest-v20.x/docs/api/cli.html#--network-family-autoselection-attempt-timeout

The happy eyeballs implementation in node is buggy - https://github.com/nodejs/node/issues/54359
2024-10-28 09:55:54 +01:00
Girish Ramakrishnan
6681f2e5c8 netcup: dns fixes 2024-05-04 18:37:40 +02:00
Girish Ramakrishnan
67c1b2cb71 installer: remove custom nginx upgrade logic 2024-04-29 14:23:19 +02:00
Girish Ramakrishnan
6c0e84a31d installer: remove verbose extract 2024-04-29 14:14:36 +02:00
Girish Ramakrishnan
caedf6a8e7 remove resolvconf and enable systemd-resolved 2024-04-29 13:19:52 +02:00
Girish Ramakrishnan
8df97de8c6 Ubuntu 24.04
* update docker to 26.0.1
* cloudron-syslog needs to have correct perms for fifo socket
2024-04-29 11:07:10 +02:00
Girish Ramakrishnan
cd5cae33ce dns: switch over to systemd for the host
this changes unbound to listen to 127.0.0.150 (150 is roman CL)

we cannot only bind on docker bridge because unbound is relied
upon for the initial domain setup. docker itself is only initialized
when the platform initializes
2024-04-29 11:06:03 +02:00
Girish Ramakrishnan
a756fa9e9b remove dead code 2024-04-28 10:52:30 +02:00
Girish Ramakrishnan
eeae8c92d0 nodejs: update to 20.12.2 2024-04-19 17:40:42 +02:00
Girish Ramakrishnan
c6db1c70c0 docker: fix image prune
it seems docker images --digests cloudron/sftp --format "{{.ID}} {{.Repository}}:{{.Tag}}@{{.Digest}}
broke at some point
2023-08-08 21:21:00 +05:30
Girish Ramakrishnan
78877f3731 Show upgrade fail message that ubuntu 18.04 is now required 2023-07-09 12:53:59 +05:30
Girish Ramakrishnan
39d45b71d7 installer: remove user creation, already in init-ubuntu script 2023-05-15 21:10:29 +02:00
Girish Ramakrishnan
c55152c0e1 node: update to 18.16.0 2023-05-11 08:32:31 +02:00
Girish Ramakrishnan
e83bb0c639 docker: update to 23.0.6 2023-05-11 08:32:31 +02:00
Girish Ramakrishnan
5274e1c454 docker: registry finally has ipv6 support
https://github.com/docker/roadmap/issues/89
2023-05-10 10:14:25 +02:00
Johannes Zellner
f4e4bb97b1 Give setup more time to fail on docker ipv4 vs ipv6 detection 2023-04-24 15:31:05 +02:00
Girish Ramakrishnan
4c475818bc syslog: restructure code 2023-04-14 20:06:28 +02:00
Girish Ramakrishnan
489b598cd6 curl|pipe makes retrying pointless
save to a temporary file so that curl retry logic can work
2023-03-16 12:04:17 +01:00
Girish Ramakrishnan
7be0739141 registry log message 2022-12-23 17:19:52 +01:00
Girish Ramakrishnan
ce00165e41 Update containterd
this possible fixes stuck containers - https://github.com/containerd/containerd/issues/6772
2022-11-24 14:49:12 +01:00
Girish Ramakrishnan
1d56bcb2e0 Update node to 16.18.1 2022-11-22 19:29:54 +01:00
Girish Ramakrishnan
c639559a6d Update docker 20.10.21
many users reporting hangs in docker, maybe this solves it
2022-11-21 13:20:49 +01:00
Girish Ramakrishnan
f355403412 npm: make it work with ipv6 only servers 2022-08-01 14:15:09 +02:00
Girish Ramakrishnan
985320d355 switch registry url based on ipv6 availability 2022-08-01 14:15:09 +02:00