Commit Graph

152 Commits

Author SHA1 Message Date
Kévin Dunglas
d8f393900b fix(static): add back the cbrotli Caddy module (#1280) 2024-12-21 19:06:14 +01:00
Kévin Dunglas
cb37c3d66d docs: remove fibers from known issues 2024-12-20 15:38:31 +01:00
Kévin Dunglas
d276032e20 feat(static): add custom Caddy modules support (#1210)
* feat: add custom Caddy modules to the static binary

* cs

* missing Docker ARG and docs

* fix

* improve
2024-12-18 22:34:09 +01:00
Kévin Dunglas
2676bffa98 docs: apply #1243 to other languages 2024-12-14 01:45:01 +01:00
MK
047ce0c8b2 docs: fix user creation example in Ubuntu-based Docker images (#1243)
* Fix user creation in default docker images

The `adduser` command uses `-D` to mean "create with defaults". The `useradd` command uses `-D` to mean "show or edit the defaults".

man pages:

- [`useradd`](https://manpages.debian.org/jessie/passwd/useradd.8.en.html)
- [`adduser](https://manpages.debian.org/jessie/adduser/adduser.8.en.html)

(Those are for Debian, but they are very similar for every other distro that I checked)

* Use a different username that doesn't already exist
2024-12-14 01:41:56 +01:00
Kévin Dunglas
a396e64ad6 feat: build static binaries with 8.4 (#1193) 2024-11-25 19:23:02 +01:00
Kévin Dunglas
449a0e7191 ci: build PHP 8.4 Docker images (#1183)
* ci: add PHP 8.4 to the CD pipeline

* fix: revert to 8.3 for Static PHP CLI

* fix
2024-11-22 18:17:12 +01:00
Alexander Hofbauer
b40c5a64a8 docs: update instructions for xcaddy in Dockerfile (#1170) 2024-11-18 13:45:11 +01:00
Kévin Dunglas
2538849433 docs: fix xcaddy instructions 2024-11-13 07:11:39 +01:00
Kévin Dunglas
51e4445c00 docs: update php.ini path (#1110)
Co-authored-by: Rob Landers <landers.robert@gmail.com>
2024-11-11 23:25:01 +01:00
Kévin Dunglas
75dab8f33d chore: bump deps and misc improvements (#1135) 2024-11-04 16:42:15 +01:00
Kévin Dunglas
dad858b697 ci: remove remaining latest- prefix 2024-10-28 16:18:36 +01:00
Kévin Dunglas
afedeb9d58 refactor: use build tags to disable, instead of to enable a feature (#1113) 2024-10-24 14:14:47 +02:00
Kévin Dunglas
2532eb5887 chore: compile without nosql's support for Postgres and MySQL (#1112) 2024-10-22 22:50:31 +02:00
Kévin Dunglas
5601cc9640 chore(docker): download mlocati/docker-php-extension-installer (#1049) 2024-10-18 11:50:59 +02:00
Kévin Dunglas
cc21b4dfd3 docs(octane): explain how to get structured JSON logs 2024-10-18 11:50:04 +02:00
Kévin Dunglas
334139ca2b feat: improve install script (#1097) 2024-10-15 18:06:21 +02:00
Arnaud Lemercier
f1e2b3ad07 docs(fr): minor improvements in performance.md (#1091)
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-10-15 11:55:19 +02:00
Kévin Dunglas
e9c075a4a5 feat: add build tag to skip Watcher support (#1076)
* feat: add build tag to skip Watcher support

* fix

* fix

* cleanup
2024-10-08 23:23:53 +02:00
Kévin Dunglas
95c381ec78 feat: add build tag to skip Brotli support (#1070)
* feat: add build tag to skip Brotli support

* update docs
2024-10-08 18:57:34 +02:00
Alexander Stecher
8d9b6e755b feat: restart workers when on source changes (#1013)
* Adds filesystem watcher with tests.

* Refactoring.

* Formatting.

* Formatting.

* Switches to absolute path in tests.

* Fixes race condition from merge conflict.

* Fixes race condition.

* Fixes tests.

* Fixes markdown lint errors.

* Switches back to absolute paths.

* Reverts back to relative file paths.

* Fixes golangci-lint issues.

* Uses github.com/dunglas/go-fswatch instead.

* Stops watcher before stopping workers.

* Updates docs.

* Avoids segfault in tests.

* Fixes watcher segmentation violations on shutdown.

* Adjusts watcher latencies and tests.

* Adds fswatch to dockerfiles

* Fixes fswatch in alpine.

* Fixes segfault (this time for real).

* Allows queueing new reload if file changes while workers are reloading.

* Makes tests more consistent.

* Prevents the watcher from getting stuck if there is an error in the worker file itself.

* Reverts changing the image.

* Puts fswatch version into docker-bake.hcl.

* Asserts instead of panicking.

* Adds notice

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update dev.Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update alpine.Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update alpine.Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update dev-alpine.Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update dev-alpine.Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update dev.Dockerfile

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update docs/config.md

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Runs fswatch version.

* Removes .json.

* Replaces ms with s.

* Resets the channel after closing it.

* Update watcher_options.go

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update watcher_test.go

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Asserts no error instead.

* Fixes a race condition where events are fired after frankenphp has stopped.

* Updates docs.

* Update watcher_options_test.go

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Allows queuing events while watchers are reloading.

* go fmt

* Refactors stopping and draining logic.

* Allows extended watcher configuration with dirs, recursion, symlinks, case-sensitivity, latency, monitor types and regex.

* Updates docs.

* Adds TODOS.

* go fmt.

* Fixes linting errors.

* Also allows wildcards in the longform and adjusts docs.

* Adds debug log.

* Fixes the watcher short form.

* Refactors sessions and options into a struct.

* Fixes an overflow in the 'workersReadyWG' on unexpected terminations.

* Properly logs errors coming from session.Start().

* go fmt.

* Adds --nocache.

* Fixes lint issue.

* Refactors and resolves race condition on worker reload.

* Implements debouncing with a timer as suggested by @withinboredom.

* Starts watcher even if no workers are defined.

* Updates docs with file limit warning.

* Adds watch config unit tests.

* Adjusts debounce timings.

* go fmt.

* Adds fswatch to static builder (test).

* Adds a short grace period between stopping and destroying the watcher sessions.

* Adds caddy test.

* Adjusts sleep time.

* Swap to edant/watcher.

* Fixes watch options and tests.

* go fmt.

* Adds TODO.

* Installs edant/watcher in the bookworm image.

* Fixes linting.

* Refactors the watcher into its own module.

* Adjusts naming.

* ADocker image adjustments and refactoring.

* Testing installation methods.

* Installs via gcc instead.

* Fixes pointer formats.

* Fixes lint issues.

* Fixes arm alpine and updates docs.

* Clang format.

* Fixes dirs.

* Adds watcher version arg.

* Uses static lib version.

* Adds watcher to tests and sanitizers.

* Uses sudo for copying the shared lib.

* Removes unnused func.

* Refactoring.

* Update .github/workflows/sanitizers.yaml

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Adds fpic.

* Fixes linting.

* Skips tests in msan.

* Resets op_cache in every worker thread after termination

* Review fixes part 1.

* Test: installing libstc++ instead of gcc.

* Test: using msan ignorelist.

* Test: using msan ignorelist.

* Test: using msan ignorelist.

* Allows '/**/' for global recursion and '**/' for relative recursion.

* Reverts using the ignorelist.

* Calls opcache directly.

* Adds --watch to php-server command

* Properly free CStrings.

* Sorts alphabetically and uses curl instead of git.

* Labeling and formatting.

* Update .github/workflows/sanitizers.yaml

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update .github/workflows/sanitizers.yaml

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update .github/workflows/tests.yaml

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update .github/workflows/tests.yaml

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update caddy/caddy.go

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update docs/config.md

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update frankenphp_with_watcher_test.go

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update watcher/watcher.h

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update frankenphp.c

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update watcher/watcher.go

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update docs/config.md

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update frankenphp_with_watcher_test.go

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update testdata/files/.gitignore

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update watcher/watcher-c.h

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update watcher/watcher.c

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Fixes test and Dockerfile.

* Fixes Dockerfiles.

* Resets go versions.

* Replaces unsafe.pointer with uintptr_t

* Prevents worker channels from being destroyed on reload.

* Minimizes the public api by only passing a []string.

* Adds support for directory patterns and multiple '**' globs.

* Adjusts label.

* go fmt.

* go mod tidy.

* Fixes merge conflict.

* Refactoring and formatting.

* Cleans up unused vars and functions.

* Allows dirs with a dot.

* Makes test nicer.

* Add dir tests.

* Moves the watch directive inside the worker directive.

* Adds debug log on special events.

* Removes line about symlinks.

* Hints at multiple possible --watch flags.

* Adds ./**/*.php as default watch configuration.

* Changes error to a warning.

* Changes the default to './**/*.{php,yaml,yml,twig,env}' and supports the {bracket} pattern.

* Fixes linting.

* Fixes merge conflict and adjust values.

* Adjusts values.

---------

Co-authored-by: a.stecher <a.stecher@sportradar.com>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-10-07 13:17:24 +02:00
Rob Landers
aa585f7da0 handle worker failures gracefully (#1038)
* handle failures gracefully

* fix super-subtle race condition

* address feedback: panic instead of fatal log and make vars into consts

* pass the frankenphp context to worker-ready function

* reset backoff and failures on normal restart

* update docs

* add test and fix race condition

* fail sometimes but do not be pathological about it

* Use title case

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* fix code style in php

* define lifecycle metrics

* ensure we update unregister the metrics and fix tests

* update caddy tests and fix typo

* update docs

* no need for this

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-10-03 21:53:12 +02:00
Jamie Spittal
b8e5ad16cd docs: expand on how Laravel Octane uses Caddyfiles (#1028)
* Update laravel.md

* Update laravel.md

* Update laravel.md

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-10-03 15:28:47 +02:00
Rob Landers
5d43fc2c8d add basic metrics (#966)
* add metrics

* change how counting works

* also replace dots

* check that metrics exist

* rename NullMetrics to nullMetrics

* update go.sum

* register collectors only once

* add tests

* add tests for metrics and fix bugs

* keep old metrics around for test

* properly reset during shutdown

* use the same method as frankenphp

* Revert "keep old metrics around for test"

This reverts commit 1f0df6f6bdaebf32aec346f068d6f42a0b5f4007.

* change to require.NoError

* compile regex only once

* remove name sanitizer

* use require

* parameterize host port because security software sucks

* remove need for renaming workers

* increase number of threads and add tests

* fix where frankenphp configuration was bleeding into later tests

* adds basic docs for metrics

* Add caddy metrics link

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Fix typos

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* address feedback

* change comment to be much more "dangerous"

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-09-26 09:53:37 +02:00
Kévin Dunglas
f62244fb69 docs: fix markdown notices 2024-09-24 10:07:42 +02:00
Kévin Dunglas
47257ec919 docs: add performance docs (#1004)
* docs: add performance docs

* docs: add PHP performance section

* Update docs/performance.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update docs/performance.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update docs/performance.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update docs/performance.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update docs/performance.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update docs/performance.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update docs/performance.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* typo

* musl

* musl fixes

* add log section

* french translation

* typo

---------

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>
2024-08-27 11:45:56 +02:00
Kévin Dunglas
4a8555571c docs: fix build/curl instructions in more languages 2024-08-24 08:30:00 +02:00
David Legrand
d12551762f docs: fix build/curl instructions (#998)
The `z` was missing and there was an error after download:

```
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now
```
2024-08-23 16:07:42 +02:00
Kévin Dunglas
60e3aba981 docs: fix and improve compilation docs 2024-08-20 09:55:33 +02:00
Alexander Makarov
93859e3149 docs: fix assorted typos (#942) 2024-07-27 00:07:52 +02:00
Fabien Papet
a6572225f6 docs: fix port number in French version (#919) 2024-07-12 10:55:21 +02:00
Kévin Dunglas
4fab5a3169 docs: fix php.ini path for static binaries 2024-07-10 14:08:11 +02:00
Kévin Dunglas
e743f6ab87 docs: customizing the configuration (#911)
* docs: customizing the configuration

* Update docs/config.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update docs/fr/config.md

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

* Update embed.md

---------

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>
2024-07-09 16:13:55 +02:00
Kévin Dunglas
0500ebc191 perf: improve PHP thread management (#898) 2024-07-09 09:39:03 +02:00
Kevin Detournay
952dd7a79b docs: use octane:frankenphp instead of octane:start (#893)
to be more consistent with OFFICIAL laravel documentation

(basically octane:start comment , will
check your env octane server and call octane:frankenphp )

Co-authored-by: kevin <kevin@popsell.com>
2024-06-28 12:11:43 +02:00
Kévin Dunglas
213be22967 docs: fix linter 2024-06-27 14:10:51 +02:00
Simon
11e3745b8b docs: explain how to fix SSL/TLS-related issues (#888)
* mail tls issues documentation

* fix linting

* Update known-issues.md

* Update known-issues.md

* Update known-issues.md

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-06-27 13:49:16 +02:00
Kévin Dunglas
b47f4d3aa0 fix(static): unbundle parallel extension 2024-06-24 13:53:32 +02:00
Benedikt Franke
6b44b532f5 docs: improve Docker tags documentation (#866) 2024-06-12 15:17:59 +02:00
Tim Düsterhus
c0c56a8cf8 Fix typo in code sample in worker.md 2024-06-11 11:02:06 +02:00
DubbleClick
ce4732aa43 docs: fix worker example (#856)
* Update worker.md documentation if MAX_REQUESTS is not set

* Update worker.md
2024-06-08 13:06:40 +02:00
Kévin Dunglas
3714fdf3a1 fix: superglobals-realated crash with custom extensions in worker mode (#796)
* test: failing test reproducing #767

* fix

* Update frankenphp.c

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

* Update frankenphp.c

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

* review

* ZVAL_COPY

* fix

* add back current $_SERVER behavior

* add docs

* bad fix for the leak

* clean test

* improve tests

* fix test

* fix

* cleanup

* clarify destroy super globals name

* micro-optim: use zval_ptr_dtor_nogc to destroy super globals

* style

* fix

* better name for frankenphp_free_server_context

* more cleanup

* remove useless memset

* more cleanup

* continue refactoring

* fix and update docs

* docs

---------

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2024-06-05 15:24:16 +02:00
Kévin Dunglas
0b4a427cac feat: use the new RegisterDirectiveOrder to simplify config 2024-05-31 17:47:24 +02:00
Rob Landers
b96db939b7 feat: option to enable full duplex for HTTP/1 connections (#692)
* found another spot that was preventing http1 writes

* remove full-duplex from caddyfile

* update documentation

* fix: update http name

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* fix: update http name

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* fix: names

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* fix: update caddyfile name

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Add caution to docs

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* Update config.md

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* fix lint

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-05-31 14:38:31 +02:00
jeremyj11
ad2c18a6b7 docs: add missing -z to tar (#828) 2024-05-30 16:47:15 +02:00
Stephen Miracle
da342b6f2f docs: recommend FrankenWP for WordPress (#785)
* updating reference location to provide WordPress implementation supprt.

* correcting autoformat issue from previous commit. Should now only be updating wordpress references.
2024-05-27 13:29:16 +02:00
Kévin Dunglas
d01733dd3e docs: better Mercure hub schema 2024-05-16 14:42:30 +02:00
Kévin Dunglas
a2f0eb9140 ci: remove SHA tag for non-dev Docker images (#781)
* ci: remove SHA tag for non-dev Docker images

* docs: Docker variants
2024-05-13 14:52:13 +02:00
Kévin Dunglas
cd2049f611 docs: rootless Docker images with no capabilities 2024-05-13 11:11:52 +02:00
Kévin Dunglas
12fb11eead docs: embedding Laravel apps (#753)
* docs: embedding Laravel apps

* fix

* docs: embedding Octane apps

* fix

* fix

* cs

* cs

* fix md

* path explaination

* changing the storage path
2024-04-29 17:42:18 +02:00