229 Commits
Author SHA1 Message Date
Indra Gunawan d588d5c8f0 cmd: unbuffer default logger on startup failure (#8180)
* cmd: unbuffer default logger on startup failure

Restore default logger to unbuffered console logger on cmdRun error so WrapCommandFuncForCobra can output the error.

* add regression tests
2026-10-09 21:22:40 +00:00
4f45ded755 caddyconfig: unify Caddyfile lexer/parser/formatter (token-based formatter) (#7880)
* docs: add Caddyfile lexer/parser/formatter unification design spec

Design for unifying the Caddyfile lexer/parser and the standalone formatter
by making the token pipeline drive formatting: raw-source-span capture,
comment tokens, separator-kind metadata, follow-imports and (default-off)
braced-wrap modes. Includes adversarial-review hardening and empirically-found
intentional improvements over the legacy formatter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: add phased implementation plan for Caddyfile formatter unification

Task-by-task TDD plan: Phase 1 (token model + formatter rewrite + fuzz
invariants + legacy oracle), Phase 2 (follow-imports mode + caddy fmt
--imports), Phase 3 (default-off braced-wrap).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test: vendor legacy Caddyfile formatter as differential oracle

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: add format-mode Token fields and accessors

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: add Lex and LexOptions; Tokenize delegates to Lex

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: capture verbatim raw source spans in format mode

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: emit comment tokens in format mode

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: record token separator kind in format mode

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: split structural braces in format mode

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: rewrite Format as a token-based renderer (core layout)

Replace the rune-by-rune state machine with a renderer that consumes the
format-mode token stream (Lex with Comments+Raw). Adds FormatWithOptions and
FormatOptions{WrapUnbracedSite}; Format keeps its signature. Comment
placement, continuations, empty-block expansion, and the import/}-glue rules
land in Tasks 9-11; the six dependent TestFormatter cases are temporarily
skipped with annotations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: token renderer comments (I1/I3) and continuations (D1)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: token renderer empty blocks (I2) and post-} break (I4)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: import-brace exception, drop nesting cap, drop < quirk

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: fix formatter idempotency/semantic bugs, retire legacy oracle

Fix two fuzz-found bugs plus several related idempotency issues in the
token-based Caddyfile formatter, and retire the legacy byte-scanner
formatter used as a test oracle.

Bug B (formatter.go): a stray "}" at nesting 0 was glued to an unquoted
predecessor because precededBySpace is unreliable after an unquoted token.
Only suppress the separating space for an inline close brace when the
previous token is quoted (same guard as comment gluing), so "0 }" no longer
merges into "0}".

Bug A (lexer.go): an empty-bodied heredoc hitting EOF with no closing marker
was silently dropped, breaking Format idempotency. Surface it as an
"incomplete heredoc" error ONLY in format mode (opts.Comments || opts.Raw);
Tokenize/Parse keep the exact prior silent-drop behavior. Format then falls
back to preserving the trimmed input.

Additional format-mode-only fixes surfaced by property fuzzing: correct
line-break accounting for empty-bodied heredocs and continuation-framed
quoted tokens; normalize the raw slice / clear continuation on split and
standalone structural braces; guard the address/comment/brace fold so a
next-line "{" is not folded onto a comment trailing an opening brace; and a
fallback + idempotency backstop in FormatWithOptions for degenerate tokens
(ambiguous heredoc openers, unterminated/escaped quotes, dangling escapes,
messy/leading line continuations). The parse path is unchanged.

Property fuzz targets (formatter_test.go): keep FuzzFormatIdempotent,
FuzzFormatNoPanic, and a redesigned FuzzFormatSemanticPreserve that asserts
format-mode token-text preservation (robust to the parser's lenient grouping
of ambiguous brace layouts). Add regression tests
TestFormatStrayCloseBraceKeepsTokens and TestFormatIncompleteHeredocIdempotent.
Remove FuzzFormatParity, containsParityExclusion, maxNesting and delete
formatter_legacy_test.go (legacyFormat oracle + TestLegacyOracleMatchesCurrent).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: seed corpus and FormattingDifference stability tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: extract pure import-glob resolution helper

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: import discovery for follow-imports formatting

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: FormatImports formats root plus imported files

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* cmd: add 'caddy fmt --imports' to format imported files

Adds a --imports flag to 'caddy fmt' that calls caddyfile.FormatImports
to format the root Caddyfile and all files it references via import
directives. Rejects --imports with stdin (no source directory to resolve
against). With --overwrite each file is written back; otherwise each
file's output is printed to stdout with a '# <path>' header, with
optional per-file diff via --diff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: detect single unbraced site block

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: implement default-off unbraced->braced site wrapping

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: make WrapUnbracedSite decision on normalized stream (idempotency fix)

FormatWithOptions wrapped before formatting, deciding on the raw token
stream. isSingleUnbracedSite uses source-line gaps, but formatTokens
removes blank lines and folds dangling braces, so a shape read as "not a
single site" on pass 1 could read as a single unbraced site on pass 2 and
get wrapped, breaking Format(Format(x)) == Format(x).

Decide the wrap on the already-normalized stream instead: normalize, re-lex,
and wrap only if isSingleUnbracedSite holds there. tokens becomes the wrapped
stream so the backstop still compares like-for-like; once wrapped the output
is braced, so no double-wrap on re-runs. Format (zero options) still never
wraps.

Adds a regression reproducer and FuzzWrapUnbracedSiteIdempotent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: satisfy golangci-lint (rangeint + De Morgan)

Modernize three index loops to range-over-int and simplify a negated
boolean per staticcheck QF1001. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: modernize remaining index loops (rangeint)

Convert the remaining for-i index loops to range-over-int per golangci-lint
modernize. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* caddyfile: fix formatter and import correctness issues (#7881)

* caddyfile: fix formatter and import correctness issues

* noot

* noot

* caddyfile: document parser-driven import discovery

* test: make formatter import tests portable (#7882)

* caddyfile: propagate import observer into named route blocks

Named route blocks expand their imports through a separate parser built in
expandImportsInBlock, which copied only definedSnippets and importGraph. The
importObserver hook was left nil, so FormatImports never saw files imported
from inside a &(name) { ... } block and "caddy fmt --imports" silently skipped
them.

Carry the observer into that parser and cover it with a discovery test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* caddyfile: detect end-of-input-swallowing tokens from token shape

hasUnformattableToken documented an unterminated quote/backtick as a shape
that cannot be rendered idempotently, but never implemented the check. The
condition was only caught dynamically by trailingNewlineChangesTokens, which
returns early for input that already ends in a newline. That early return is
wrong for a token that swallowed the newline: once Format's mandatory trailing
newline sits inside an unterminated quote, appending another one no longer
changes the stream, so the second pass rendered what the first pass had
preserved verbatim.

    Format(`"""`)   => `"""`     (fallback, preserved)
    Format(`"""` + newline) => `"" "` (rendered, space inserted)

Decide it from the token instead: a non-quoted token whose verbatim source
ends in a newline swallowed it, since a newline otherwise terminates a token.
This also covers an escaped quote ("\"") running to end-of-input, which has
the same shape. A lone "\r" is kept in raw but does not terminate a token, so
it is deliberately excluded; heredoc tokens carry wasQuoted == '<'.

Master's rune-based formatter was idempotent on these inputs, so this restores
parity. Found by FuzzFormatIdempotent; the inputs are added as portable seeds
and table cases rather than testdata/fuzz files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* caddyfile: stop Format from mutating its input buffer

The three fallback paths returned append(bytes.TrimSpace(input), '\n').
TrimSpace returns a subslice sharing the caller's backing array, so the append
wrote the newline into the caller's buffer. os.ReadFile returns a slice with
one byte of spare capacity, which is exactly what the append needs, so this
reached real callers:

    $ printf 'foo "unterminated  \n\n' > Caddyfile
    $ caddy fmt --diff
      foo "unterminated      <- reported unchanged; its trailing
    -                           whitespace was in fact stripped

cmd/commandfuncs.go compares input against output after calling Format, and by
then input had been overwritten to match. The same aliasing corrupted
FuzzFormatIdempotent, which reported failures whose recorded inputs did not
reproduce.

Copy into a fresh buffer instead, and assert both non-mutation and
non-aliasing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* caddyfile: preserve repeated import expansions during formatting

Deduplicate formatted files without skipping imports with different arguments,
block substitutions, or lexical aliases. Track active physical-file ancestry
to prevent symlink cycles, including snippet and block expansion contexts.

Add regression coverage and align the upstream glued-brace expectation with
the token-based formatter's literal-token behavior.

Validation: go test -race -short ./..., go build ./..., and golangci-lint run
--timeout 10m all pass.

AI assistance: OpenAI Codex (GPT-6) assisted with implementation and testing.

* docs: remove formatter implementation plan and design spec

* caddyfile: require whitespace before line continuations

Preserve attached trailing backslashes as literal text, including Windows root paths. Require a space or tab before an unquoted continuation backslash, and preserve significant leading whitespace in formatter fallback output.

Add lexer, formatter, CRLF, adapter, and fuzz regression coverage. Validated with race tests, build, lint, formatter fuzzing, and the 165-example forum corpus.

AI assistance: OpenAI Codex (GPT-6) assisted with implementation, regression tests, and validation.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: a <a@tuxpa.in>
2026-10-07 17:14:16 -04:00
Zen Dodd 90ccea768f build: bump all dependencies - (Go 1.26 floor) (#8056)
* build: bump deps

* chore: note HTTP/2 migration follow-ups
2026-09-30 10:54:12 -06:00
wangjingshuiku a75817f550 fix: require module path boundaries when matching packages (#7957)
Signed-off-by: wangjingshuiku <wangjingshuiku@163.com>
2026-09-13 12:08:09 +10:00
Mohammed Al Sahaf 7cc98d4d3f cmd: make splitModule strictly conform to Go module spec (#7974)
Per https://go.dev/ref/mod#go-mod-file-ident, '@' is not a valid module
path character. The old implementation used strings.LastIndex to allow
inputs like github.com/@user/module@v1.0.0 to parse, but such inputs
are not valid module paths per the spec. Reject them explicitly.

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2026-09-03 07:43:34 +10:00
Kévin Dunglas d0e93c23a1 cmd: upgrade automemlimit to v1.0.0 (#7978)
v1.0.0 renamed SetGoMemLimitWithOpts to Set and dropped the other Set*
helpers. The options this call passes are unchanged, as are the 0.9
default ratio and the AUTOMEMLIMIT handling, so behavior is the same.

Only the already-deprecated AUTOMEMLIMIT_DEBUG and AUTOMEMLIMIT_EXPERIMENT
environment variables are gone, and neither is used here.
2026-08-31 19:18:31 +03:00
yangshenghui 0bbda5c728 fix: close resources on error paths (#7940) 2026-08-16 21:02:39 +10:00
futurehua 93c0721156 chore: fix sabotage spelling in nolint comments (#7892)
Signed-off-by: futurehua <futurehua@outlook.com>
2026-07-18 08:14:38 +00:00
Y.HorieandMohammed Al Sahaf d730df2a83 cmd: colored error message in WrapCommandFuncForCobra (#7760) (#7768)
Signed-off-by: Y.Horie <u5.horie@gmail.com>
Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2026-06-04 21:41:35 -04:00
Zen Dodd 6628c4a9de cmd: support caddy start on IPv6-only hosts (#7744) 2026-05-20 10:17:34 -04:00
Zen Dodd 88037f1666 chore: clean up wording and typo fixes (#7745)
* chore: clean up wording and typo fixes
* chore: ASCII -> alphanumeric in lexer for heredoc marker
2026-05-20 16:36:30 +10:00
Zen Dodd d2172bea61 chore: Fix golangci-lint 2.12.1 findings (#7690) 2026-05-07 03:40:26 -04:00
Matthew Holt 1fbb28720b Fix lint errors
Use VerifyConnection instead of VerifyPeerCertificate; the other 2 fixes are "meh" not really a big deal or an issue at all.
2026-03-11 13:33:59 -06:00
Francis Lavoie 45cf61b127 logging: Ensure slog error level logs don't print stack traces (#7512) 2026-03-03 14:44:42 -07:00
Alexandre Daubois f283062d37 cmd: Custom binary names through CustomBinaryName and CustomLongDescription (#7513) 2026-03-02 06:04:28 -05:00
Matt HoltandFrancis Lavoie cd9e1660aa cmd: Pass configFile, not configFlag, for reload command (#7532)
* cmd: Pass configFile, not configFlag, for reload command

This *should* fix #7528.

* Remove debug log line

---------

Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2026-02-27 15:24:05 -07:00
Matt Holt 95941a71e8 chore: Add nolints to work around haywire linters (#7493)
* chore: Add nolints to work around haywire linters

* More lint wrangling
2026-02-17 16:52:54 -07:00
Francis Lavoie d269405eab core: Show JSON error offsets where possible (#7437) 2026-01-14 22:54:19 -05:00
Francis Lavoie cbebc1292b core: Embed time/tzdata (#7432) 2026-01-13 15:11:35 -07:00
Paulo Henrique 9eabd443cb cmd: Add --json flag to list-modules command (#7409) 2025-12-26 12:32:03 -05:00
Francis Lavoie 65e0ddc221 core: Reloading with SIGUSR1 if config never changed via admin (#7258) 2025-09-26 16:50:15 +00:00
Mohammed Al Sahaf 25be2f26fc chore: ugh, lint fix... (#7275)
* chore: ugh, lint fix...

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* more lint fixes

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

---------

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-09-26 03:14:48 -04:00
Francis Lavoie 39ace450de logging: Adjustments to BufferedLog to keep logs in the correct order (#7257)
* logging: Adjustments to BufferedLog to keep logs in the correct order

* Ignore lints
2025-09-15 09:29:50 -06:00
Francis Lavoie 012b4b3d40 logging: Buffer the logs before config is loaded (#7245) 2025-09-10 16:03:52 +00:00
Bobby Dhillon 19ff47a63b cmd: Allow caddy adapt to read from stdin (#7163) 2025-08-06 20:04:28 -04:00
emmmmandMohammed Al Sahaf 291987ac23 chore: fix dead link (#7136)
* fix dead link

* Update cmd/commands.go

Co-authored-by: Mohammed Al Sahaf <mohammed@caffeinatedwonders.com>

---------

Co-authored-by: Mohammed Al Sahaf <mohammed@caffeinatedwonders.com>
2025-07-20 12:52:28 +00:00
Herman Slatman e633d013f6 cmd: fix Commands function not returning all registered commands (#7059) 2025-06-12 17:17:51 -06:00
Mohammed Al Sahaf e039a5bb5c chore: upgrade .golangci.yml and workflow to v2 (#6924)
* chore: upgrade .golangci.yml and workflow to v2

run `golangci-lint fmt`

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* run `golangci-lint run --fix`

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* more lint fixes

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* bring back comments to .golangci.yml

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* appease the linter some more

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* oops

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* use embedded structs

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* use embedded structs where they were used before

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* disable rule  `-QF1006`

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* missed a spot

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

---------

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-06-03 02:24:32 +03:00
eveneast a76d005a94 Use maps.Copy for simpler map handling (#7009)
Signed-off-by: eveneast <qcqs@foxmail.com>
2025-05-13 15:16:47 -06:00
Matthew Holt 19876208c7 cmd: Promote undo maxProcs func to caller 2025-03-06 16:47:02 -07:00
Matthew Holt a686f7c346 cmd: Only set memory/CPU limits on run (fix #6879) 2025-03-06 15:11:38 -07:00
Kévin Dunglas 066d770409 cmd: automatically set GOMEMLIMIT (#6809)
* feat: automatically set GOMEMLIMIT

* add system support

* comments

* add logs
2025-01-27 09:32:24 -07:00
Matthew Holt 66c80caf23 cmd: Disable go1.23 tlskyber=1 experiment
Compilation with go 1.24 fails with it, since the experiment has ended. We'll reintroduce post quantum soon.
2024-12-19 12:17:07 -07:00
Aziz Rmadi fb72793269 cmd: Reject multiple configs for fmt command (#6717) 2024-12-04 05:43:52 -07:00
santhoshkumar b3ce260389 cmd: ignore missing keys during storage export (#6697) 2024-11-18 14:40:51 +00:00
Lucas VerÍssimo Botelho d398898b35 cmd: Allow add-package to select version of package (#6665)
* feat: allow versioning of packages

* docs: remove xcaddy issue reference
2024-10-30 16:48:36 +00:00
Mohammed Al Sahaf 01be1b54a8 ci: install xcaddy to fix release flow (#6602) 2024-10-02 16:12:29 +00:00
Matt Holt c8adb1b553 cmd: Better error handling when reloading (#6601)
* caddyhttp: Limit auto-HTTPS error logs to 100 domains

* Improve error message and increase error size limit
2024-10-01 20:31:30 -06:00
Aaron Paterson 4b1a9b6cc1 core: Implement socket activation listeners (#6573)
* caddy adapt for listen_protocols

* adapt listen_socket

* allow multiple listen sockets for port ranges and readd socket fd listen logic

* readd logic to start servers according to listener protocols

* gofmt

* adapt caddytest

* gosec

* fmt and rename listen to listenWithSocket

* fmt and rename listen to listenWithSocket

* more consistent error msg

* non unix listenReusableWithSocketFile

* remove unused func

* doc comment typo

* nonosec

* commit

* doc comments

* more doc comments

* comment was misleading, cardinality did not change

* addressesWithProtocols

* update test

* fd/ and fdgram/

* rm addr

* actually write...

* i guess we doin' "skip": now

* wrong var in placeholder

* wrong var in placeholder II

* update param name in comment

* dont save nil file pointers

* windows

* key -> parsedKey

* osx

* multiple default_bind with protocols

* check for h1 and h2 listener netw
2024-09-30 10:55:03 -06:00
Bas Westerbaan dcbf38d0b3 tls: use Go default kex for the moment that include PQC (#6542)
By default Go 1.23 enables X25519Kyber768, a post-quantum key agreement
method that is enabled by default on Chrome. Go 1.23 does not expose
the CurveID, so we cannot add it by specifying it in CurvePreferences.
The reason is that X25519Kyber768 is a preliminary key agreement that
will be supplanted by X25519MLKEM768. For the moment there is value
in enabling it.

A consequence of this is that by default Caddy will enable support
for P-384 and P-521.

This PR also removes the special code to add support for X25519Kyber768
via the Cloudflare Go branch.

Cf #6540
2024-08-27 17:08:16 -06:00
aandFrancis Lavoie 8ccfedf2bb cmd: Use a factory to create the caddy root command (#6533)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-08-22 03:29:42 +00:00
WeidiDengandMohammed Al Sahaf 9ddb78fadc cmd: ignore exec.ErrDot when starting caddy in background (#6512)
Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2024-08-12 20:26:20 -06:00
Mohammed Al Sahaf 243351b2b1 cmd: remove zealous check of Caddyfile auto-detection (#6370)
* cmd: remove zealous check of Caddyfile auto-detection

* add test case

* remove redundant check, add comment

* one more case
2024-06-05 08:57:15 -06:00
Mohammed Al SahafandGit'Fellow 7088605cc1 cmd: fix regression in auto-detect of Caddyfile (#6362)
* cmd: fix regression in auto-detect of Caddyfile

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* fix typo

Co-authored-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

* add tests

* address review comments

---------

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Co-authored-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-06-02 11:40:56 +00:00
Mohammed Al Sahaf 15faeacb60 cmd: fix auto-detetction of .caddyfile extension (#6356)
* cmd: fix auto-detetction of .caddyfile extension

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* move conditions around and add clarifying comment

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* reject ambiguous config file name

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

---------

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2024-06-02 03:49:38 +00:00
Matt HoltandFrancis Lavoie 6d97d8d87b caddyhttp: Address some Go 1.20 features (#6252)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-04-24 00:05:57 +00:00
Mohammed Al Sahaf 8f87c5d993 cmd: Only validate config is proper JSON if config slice has data (#6250)
* cmd: fix error when running without config

* ci: add smoke test
2024-04-18 15:40:12 -06:00
Matt Holt 81413caea2 caddytls: Upgrade ACMEz to v2; support ZeroSSL API; various fixes (#6229)
* WIP: acmez v2, CertMagic, and ZeroSSL issuer upgrades

* caddytls: ZeroSSLIssuer now uses ZeroSSL API instead of ACME

* Fix go.mod

* caddytls: Fix automation related to managers (fix #6060)

* Fix typo (appease linter)

* Fix HTTP validation with ZeroSSL API
2024-04-13 21:31:43 -04:00
Matthew Holt e1f4b83ffa cmd: Fix panic related to config filename (fix #5919) 2024-04-11 17:04:43 -06:00
Omar HusseinandMatt Holt 185ed6fe7c cmd: Assume Caddyfile based on filename prefix and suffix (#5919)
This can be helpful if editors only consider file extensions for certain features.

* added special case support for caddyfile suffix, case insensitive

* Update cmd/main.go

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

* skip caddyfile adapter for registered file extensions

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2024-04-11 15:28:16 -06:00