119 Commits
Author SHA1 Message Date
Kasra Bigdeli 8d373e80e6 Merge release 1.16.2 back into master 2026-12-03 22:08:01 -08:00
Kasra Bigdeli e5e66b0151 Preserve a temporary configuration backup during startup (#2577)
* Preserve startup config backup until Captain initializes

* Bound startup backup memory and stabilize shadow timing tests

* Fix backup helper formatting

* Verify startup backup directory and file permissions

* Revert unnecessary startup backup permission checks

* Clarify temporary startup backup filename
2026-12-03 21:54:17 -08:00
Kasra Bigdeli dd86c769b4 Refine file handling and compatibility coverage 2026-12-03 21:45:37 -08:00
Kasra Bigdeli 95ce70afa6 Improve backup and deployment filesystem handling for 1.16.2 2026-12-03 21:44:05 -08:00
Kasra Bigdeli 4722df4b82 Validate a native JSON datastore on a persistent shadow copy (#2576)
* Validate native datastore operations on a persistent shadow copy

* Skip shadow comparison after a failed initial file stat

* Run datastore upgrade alongside Docker checks and simplify shadow diagnostics

* Bound shadow resources and stop comparison on infrastructure failure

* Read existing installation ID explicitly for shadow analytics

* Report shadow counts under a shared UUIDv4 fallback when installation ID is missing
2026-12-03 21:15:56 -08:00
Kasra Bigdeli d4e938ecd1 Revert datastore shadow mode (#2574) pending maintainer review (#2575) 2026-12-02 08:57:34 -08:00
Kasra Bigdeli eb823f04da Validate a native JSON datastore on a persistent shadow copy (#2574)
* Compare native datastore operations on an isolated persistent shadow file

* Cover first-boot shadow failure and direct aliases to the live config
2026-12-02 08:53:13 -08:00
Kasra Bigdeli 2e3fa37343 Support standard Docker Compose command/entrypoint semantics and One-Click v5 catalog (#2561)
* Support standard Docker Compose command/entrypoint semantics and One-Click v5 catalog

* Address PR review: simplify helpers/tests, reject NUL args, validate template response

* Address follow-up PR comments and wire Docker Swarm test into CI
2026-11-30 22:33:18 -08:00
Josué Trindade 57c49ea094 Allow wildcard glob arguments in custom Certbot commands (#2567)
ShellQuote.parse() returns { op: 'glob', pattern } objects instead of
strings for unquoted wildcard tokens such as *.${domainName}, causing
CertCommandGenerator.getCertbotCertCommand() to throw Invalid command.

Because CertbotManager executes commands directly via Docker exec without
a shell, unquoted glob tokens cannot trigger shell expansion and can be
passed through as their literal pattern strings while continuing to reject
shell control operators and comments.

Fixes #2222
2026-11-29 16:03:17 -08:00
Han Ming 7628860532 Allow 301 for "Redirect all domains to" (#2562)
Add an optional redirectDomainStatusCode (301 or 302) to the app
definition. The default server block template returns it instead of a
hard-coded 302. Apps without the field keep redirecting with 302.

Clients that do not send the field, such as the current caprover-api
updateConfigAndSave, keep the stored value instead of resetting it.

Refs #1857
2026-11-28 08:27:48 -08:00
Han Ming 52fd1e3f5e Remove the git credentials from the cloned repository (#2563)
An HTTPS clone keeps the remote URL, with the user and password, in .git/config, and git resolves relative submodule URLs against it, so the submodules' configs hold them too. A Dockerfile with COPY . . then puts them in the image. After cloning, set the remote to the URL without credentials and sync the submodules to it.

Refs #2157
2026-11-28 08:20:46 -08:00
Josué Trindade e9af9080af fix(auth): enforce 72-byte UTF-8 bcrypt limit in changepass
Characters encoded as multi-byte UTF-8 can keep newPass.length <= 29 while
making encryptionKey + newPass exceed bcryptjs's 72-byte input limit,
causing silent truncation of trailing bytes.

Reject new passwords when Buffer.byteLength(encryptionKey + newPass, 'utf8')
exceeds 72 before verifying oldPass or rotating tokenVersion, while keeping
oldPass unconstrained for legacy accounts.
2026-11-28 16:02:37 +00:00
Josué Trindade 9310a4561e fix(auth): reject new passwords longer than 29 characters
Login rejects passwords longer than 29 characters because bcrypt truncates
inputs after 72 bytes and Authenticator prepends a 43-character encryptionKey
(captain-salt + namespace), introduced in 7813f2f.

Authenticator.changepass previously checked only newPass.length < 8, allowing
a user to save a 30+ character password that cannot pass LoginRouter on the
next login. Enforce the same 29-character maximum on newPass before checking
oldPass or rotating tokenVersion, while keeping oldPass unconstrained so users
with pre-1.14 passwords can still change them.
2026-11-28 15:50:36 +00:00
Kasra Bigdeli 9d2320ac5b Fix One-Click dependency ordering for mapping-form depends_on (#2560)
* fix: allow mapping-form depends_on in service type

* fix: sort mapping-form service dependencies by key

* test: cover list and mapping-form dependency ordering
2026-11-22 10:26:49 -08:00
85929acd32 Redirect to https when the redirect domain has SSL (#2557)
Fixes #1858

Co-authored-by: Donald Murillo <dev@example.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:20:56 -08:00
Kasra Bigdeli 0715c54de6 Merge pull request #2549 from hanming5/fix/one-click-escape-values
Escape one-click variable values before inserting them into the template
2026-11-18 21:10:39 -08:00
hanming5 715a75470a Restore option B for one-click value escaping
As requested in review, keep the existing substitution for values that
are already valid JSON string contents and only escape values that
would fail to parse. Escaping every value broke overrides escaped by
hand, such as {\"text\":\"hello\"} with an empty default, which master
passes as {"text":"hello"}.

Add a regression test for that case, and expect the existing decoding
for the path and regex cases that contain valid JSON escapes.
2026-11-19 13:43:54 +09:00
Kasra Bigdeli 5b9c793fda Link Docker API upgrade errors to the upgrade guide 2026-11-18 17:18:52 -08:00
hanming5 0f1852c890 Only unescape hand-escaped quotes in unchanged template defaults
Unescaping \" in every value turned a backslash-quote pair typed by a
user, such as C:\data\"secret, into a plain quote. Keep every entered
value as is, and only unescape \" when the value is the variable's
unchanged default, which is where templates such as remark42 escape
quotes by hand.
2026-11-12 14:57:48 +09:00
hanming5 991f5c7676 Keep one-click values as entered, except hand-escaped quotes
Values that were already valid inside a JSON string were inserted
as-is, so backslash sequences such as \n in C:\new or \b in a regex
were still decoded. JSON-escape every value instead, and only unescape
\" first, which the remark42 template and the workaround from #1328
rely on. Values are converted to strings first because the deploy
route does not enforce string values.
2026-11-12 14:48:22 +09:00
hanming5 a99735576b Escape one-click variable values that are not valid in a JSON string
One-click values are inserted into the stringified template without
escaping, so a value containing a quote, a newline or a stray
backslash made the template fail to parse. Escape such values before
inserting them. Values that are already valid inside a JSON string,
including values escaped by hand such as \", are inserted unchanged so
existing templates keep working.

Fixes caprover/caprover-frontend#104
2026-11-09 13:45:45 +09:00
Kasra Bigdeli 9b5bf624c4 Fix missing backmerge branch lookup 2026-11-03 14:09:54 -08:00
Kasra Bigdeli 7db7638c19 test: cover compose deployment without app name 2026-10-31 08:39:02 -07:00
Kasra Bigdeli 27ec90e119 Update compatible backend npm dependencies 2026-10-25 14:35:58 -07:00
Kasra Bigdeli ee6ff26f16 Bound version-info lookup during self-update 2026-10-24 16:01:48 -07:00
Kasra Bigdeli dee872a3b6 Align Docker API preflight tests with neighboring style 2026-10-24 16:00:00 -07:00
Kasra Bigdeli 00f96f7214 Reuse existing Docker version method for upgrade preflight 2026-10-24 15:57:39 -07:00
Kasra Bigdeli 67294ca8ac Add minimal Docker API compatibility check before self-update 2026-10-24 15:54:17 -07:00
Kasra Bigdeli 9295f500da Test default WebSocket support for new apps 2026-10-23 21:32:40 -07:00
Kasra Bigdeli 48ec5d2ecc Finish runtime code style alignment 2026-10-22 21:32:46 -07:00
Kasra Bigdeli e10a7207fa Handle transient Swarm states and node lookup failures 2026-10-22 20:38:42 -07:00
Kasra Bigdeli f050736e27 Add typed application runtime status and bounded task history endpoints 2026-10-22 19:46:44 -07:00
Kasra Bigdeli 4b033dd21b Address disk usage API review feedback 2026-10-21 22:32:42 -07:00
Kasra Bigdeli 7e7ee32ae5 Add disk usage endpoint for the CapRover host 2026-10-21 22:13:05 -07:00
Kasra Bigdeli 4f4e9d81b9 Preserve legacy mount suffixes and share volume name validation 2026-10-18 22:21:13 -07:00
Kasra Bigdeli 34fe9d9beb Report exact Compose field paths and validate service mappings 2026-10-18 22:15:58 -07:00
Kasra Bigdeli 771fe25a0e Accept Compose environment lists and long-form mounts and ports 2026-10-18 22:10:07 -07:00
Kasra Bigdeli a91328fb76 test: cover build queue double advancement 2026-10-05 20:46:46 -07:00
Kasra Bigdeli 3811286def Merge pull request #2509 from libredb/fix/queued-build-promise
Settle the promise of a queued build when it finishes
2026-10-05 20:43:09 -07:00
Kasra Bigdeli cfedd66c78 Merge pull request #2507 from libredb/fix/project-name-leading-digit
Allow project names that start with a number
2026-10-05 09:31:39 -07:00
cevheri 582865118f fix: settle the promise of a queued build when it finishes
A build scheduled while another one ran was queued, and the promise handed to its caller never settled: onBuildFinished started the queued build and dropped its result. A one-click deploy registered during another app's build therefore stayed at "Registering" for good, although the build ran. Pass the result to the queued promise instead.
2026-10-05 18:54:55 +03:00
cevheri cfe716004d fix: allow project names that start with a number
be5d55d allowed a leading number in app names. A one-click deploy with
more than one service creates a project named after the app, so with the
old project rule such a name failed at "Creating project".

Fixes #2505
2026-10-05 12:53:04 +03:00
cevheri be9192c5f5 fix: check one-click app names before creating anything
A one-click deploy with more than one service checked each app name only
when it registered that app. A later name that was too long or already
taken failed after the project and the earlier apps were created, and
those stayed behind. Check every name before the first step instead, and
say the length limit in the error.

Fixes #2504
2026-10-05 12:53:04 +03:00
Kasra Bigdeli 2fc9d78e3a test: drain failed deploy response 2026-09-22 20:57:23 -07:00
Kasra Bigdeli 8b65665633 test: cover one-click deploy route handling 2026-09-22 20:57:01 -07:00
Kasra Bigdeli 73dc7cd1cf test: remove helper-specific one-click tests 2026-09-22 19:45:41 -07:00
Kasra Bigdeli a44a1be950 test: cover one-click deploy without values 2026-09-22 18:48:17 -07:00
Kasra Bigdeli 8629c4b08f test: cover omitted one-click values and job cleanup 2026-09-22 18:48:13 -07:00
Kasra Bigdeli e7c3faf7ee test: reject malformed backup without config 2026-09-21 22:29:58 -07:00
Kasra Bigdeli 275dedc36d Merge master into fix/restore-malformed-backup-layout 2026-09-21 22:28:56 -07:00