Commit Graph

765 Commits

Author SHA1 Message Date
Robert Landers
cd7775790f move --build-cli to BUILD_ARGS 2025-06-07 15:30:34 +02:00
Robert Landers
a75ee18599 allow installing an embedded php-cli 2025-06-07 10:07:58 +02:00
Marc
6749ddbde5 ci: remove leading v from parsed version (#1626) 2025-06-03 15:01:24 +02:00
Kévin Dunglas
82ba882a4e chore: prepare release 1.7.0 caddy/v1.7.0 v1.7.0 2025-06-03 10:04:05 +02:00
Kévin Dunglas
4b1679e70f chore: bump deps 2025-06-02 17:36:51 +02:00
David Buchmann
75ce2e22c2 docs: clarify Mercure URLs (#916)
* clarify mercure URLs

* Update docs/mercure.md

Co-authored-by: David Buchmann <david@liip.ch>

* Update mercure.md

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-06-02 16:04:56 +02:00
Marc
5a43e9f4de feat: make frankenphp directive optional in Caddyfile (#1601)
* make frankenphp directive optional, thanks @francislavoie

* get rid of global variable

* update workers when adding to app

* suggestions

* goto instead of continue outer?

* remove empty frankenphp directives

* update config to reflect the optional frankenphp directive

* AI translations

* restore eol newlines

* don't double check for duplicate worker name

* add short form for php_server worker too

* translations

* AI hates EOL newlines now?

* suggestion to check for nil

* suggestion to use else if block
2025-06-02 15:55:55 +02:00
Alexandre Daubois
5542044376 feat: allow omitting value with the --watch flag of php-server (#1595) 2025-06-02 15:54:01 +02:00
Marc
52b65311c2 ci: get package tag version from binary instead (#1606)
* get package tag version from binary instead

* capture output for better debugging instead
2025-06-01 23:55:50 +02:00
MaximAL
2dc8048ad2 docs: optimize PNG images losslessly: 2 → 1.3 MiB (−36%) (#1623) 2025-06-01 21:47:08 +02:00
Rob Landers
a59b649dac fix: headers before flushing (#1622)
* add tests

* fix test

* attempt to send headers when flushing

* Update testdata/only-headers.php

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

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-06-01 14:58:36 +02:00
Indra Gunawan
68a4548bf4 skip worker name default value assignment on unmarshal (#1607) 2025-05-31 10:25:47 +02:00
Kévin Dunglas
6f049f9a9c ci: minor cleanup (#1619)
* ci: minor cleanup

* add .golangci.yaml
2025-05-31 08:01:38 +02:00
Kévin Dunglas
340b1fd1c2 docs: improve compilation instructions 2025-05-30 14:05:08 +02:00
wu
c9329bd717 docs: fix typo in French laravel.md (#1617) 2025-05-30 14:04:29 +02:00
Kévin Dunglas
f54a1fa85e fix: prevent cert install warning in Docker images 2025-05-30 14:03:50 +02:00
Kévin Dunglas
b4115ca9a2 fix: linking on OpenBSD 2025-05-29 08:23:17 +02:00
Kévin Dunglas
14469d4a0a chore: fix typo in test comment 2025-05-27 10:10:39 +02:00
Kévin Dunglas
ee394756b1 chore: prepare release 1.6.2 caddy/v1.6.2 v1.6.2 2025-05-23 10:41:10 +02:00
Laury S.
5a260c430a chore: improve style of the default index.php file (#1598)
* feat: improve style of index.php file

* feat: remove assets folder

* Update index.php

* Update index.php

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-05-23 10:24:57 +02:00
Kévin Dunglas
b6fcab5a95 ci: always login to Docker if not a Pull Request (#1599) 2025-05-23 00:53:03 +02:00
Kévin Dunglas
1e49586b0e chore: prepare release 1.6.1 caddy/v1.6.1 v1.6.1 2025-05-22 16:49:58 +02:00
Kévin Dunglas
b27cd1c986 ci: fix packages building (#1596)
* ci: fix packages building

* fix groupdel
2025-05-22 16:44:09 +02:00
Kévin Dunglas
c6483088c5 fix(docker): command to create /etc/frankenphp 2025-05-22 00:57:01 +02:00
Kévin Dunglas
5a9785d0d9 fix(docker): prevent BC break with the new Caddyfile path 2025-05-21 01:19:58 +02:00
Kévin Dunglas
c522b52804 fix: exit(), die() and uncaught exceptions must stop the worker 2025-05-21 01:19:22 +02:00
Kévin Dunglas
9a8ad979e0 ci: don't login to the Docker hub for PRs 2025-05-21 01:18:33 +02:00
Alexandre Daubois
663aff7cc4 chore: improve Homebrew compatibility 2025-05-20 20:40:14 +02:00
Kévin Dunglas
79f2b2347b chore: reduce write error level to warn in logs 2025-05-20 20:38:49 +02:00
Kévin Dunglas
bf5c98410b chore: log thread (#1589) 2025-05-20 10:10:46 +02:00
Kévin Dunglas
cf7541fde6 chore: add more logs for the worker 2025-05-19 22:43:54 +02:00
dependabot[bot]
25491068df ci: bump super-linter/super-linter in the github-actions group
Bumps the github-actions group with 1 update: [super-linter/super-linter](https://github.com/super-linter/super-linter).


Updates `super-linter/super-linter` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/v7.3.0...v7.4.0)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 13:49:56 +02:00
Kévin Dunglas
d72751b9fd ci: always login to the Docker Hub to mitigate rate limiting issues 2025-05-19 13:46:55 +02:00
Kévin Dunglas
8820e53819 ci: fix typo in dev Dockerfile 2025-05-16 12:00:04 +02:00
Kévin Dunglas
d2b6f9e723 chore: prepare release 1.6.0 caddy/v1.6.0 v1.6.0 2025-05-16 10:16:35 +02:00
Kévin Dunglas
13fbe126ea fix: automatically change cwd when embedding an app 2025-05-16 10:10:01 +02:00
Kévin Dunglas
afa7dafe1c chore: bump deps 2025-05-16 09:22:00 +02:00
Marc
39e22bd5e0 fix: use sudo to build packages (#1568) 2025-05-15 23:12:38 +02:00
Marc
bbbfdb31b5 ci: build .rpm and .deb packages (#1497)
* add ./create-rpm.sh file to build a "frankenphp" rpm package

* also build a deb package

* renamed to build-packages

* linter...

* add depends

* linter again?

* linter number 3

* linter number 4

* set default locations for ini file, conf files and extensions

* set unified path for modules that should be ok on all dists

* add default content into "package" folder

* make file executable

* worker is in public folder

* what on earth did I do x)

* use same FRANKENPHP_VERSION and make sure to let pr's run the rpm generation too (version 0.0.0) to see issues

* install ruby, fpm and rpm-build

* move to after changing base urls because it would fail with packages not found

* ruby 3 build needs gcc 10

* rpm-build is necessary too...

* and I forgot to link the package folder

* create directories if they don't exist

* copy out all frankenphp* files?

* lint fix

* only copy frankenphp-* files

* only copy frankenphp-* files

* the .deb file is name frankenphp_1.5.0... - create output folder instead and upload all things inside that
will simplify things when later adding xdebug.so and ffi.so

* update the last two steps to use the gh-output directory

* add post install script to set frankenphp able to bind to port 80 for non-root users

* dnf over yum, I think the yum alias was removed in RH 9.5

* newlines

* newlines

* add text what missing libcap means

* copy php.ini-production from php-src, linter, update ruby version

* move Caddyfile to /etc/frankenphp/Caddyfile

* linter

* fix a copy and paste error

* better describe fallback to 0.0.0

* linter

* copy installation scripts from official caddy packages, change user to frankenphp too

* bombombom

* make files executable

* tabs

* linter

* linter again

* use empty directory for three different destinations instead of keeping three empty local directories

* caddy says the file is incorrectly formatted without these spaces

* remove wildcard matcher from root directive

* Apply suggestions from code review

commit suggested changes to preinstall/postinstall scripts

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

* Update dev.Dockerfile

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

* remove misleading comment

* update documentation for paths

* update documentation for paths some more

* fix musl opcache-jit issue

* markdown linter

* the damn tab

* Apply suggestions from code review

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

* drop dev.Dockerfile php location from config.md

* add php config note to CONTRIBUTING.md

* dashes instead of asterisks in chinese docs

* fix package building

* create frankenphp user in case it doesn't exist for deb packages

* create users if they don't exist, delete them again if they didn't exist

* satisfy linter

* create the user with the same commands as the postinst/preinstall scripts

* Removes toolchain requirements.

* trigger

* Removes explicit calls to go get

* trigger

* setcap by default

* simplify example project

* bring page more in line with the caddy / apache / nginx default page

* update to html 5

* oopsies

* revert style to original

* remove https:// (caddy uses http:// on RHEL, :80 on Debian)

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Alliballibaba <alliballibaba@gmail.com>
2025-05-14 07:33:05 +02:00
Alexander Stecher
0b83602575 fix: makes response writer error a debug message. (#1549)
* Makes response writer error a debug message.

* trigger

* log at warn level

* Update frankenphp.go

---------

Co-authored-by: Alliballibaba <alliballibaba@gmail.com>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-05-13 17:34:10 +02:00
Kévin Dunglas
ecca9dc01d ci: use latest stable Go version for the mostly static binary (#1558)
* ci: use latest stable Go version for the mostly static binary

* fix
2025-05-13 16:10:02 +02:00
Kévin Dunglas
eb40c03a21 chore: use strings.ContainsAny() for needReplacement() 2025-05-13 10:27:35 +02:00
Alexander Stecher
c2390e7c3b fix: php-cli flag parsing conflicts (#1559)
* Fixes flag parsing.

* trigger

* trigger

* Fixes flag parsing.

---------

Co-authored-by: Alliballibaba <alliballibaba@gmail.com>
2025-05-13 10:24:59 +02:00
Kévin Dunglas
0d12a5162d fix: use local Go toolchain (#1546) 2025-05-11 22:30:19 +02:00
Alexander Stecher
a48db9422d fix: go toolchain versioning (#1545)
* Removes toolchain requirements.

* trigger

* Removes explicit calls to go get

* trigger

* Update static-builder-musl.Dockerfile

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

* Update static-builder-musl.Dockerfile

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

* Update static-builder-gnu.Dockerfile

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

* Update alpine.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>

* trigger

* trigger

---------

Co-authored-by: Alliballibaba <alliballibaba@gmail.com>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2025-05-11 09:18:45 +02:00
Alexander Stecher
ab0fcd80de Fixes metrics also with regular request timeouts. (#1550) 2025-05-10 14:31:58 +02:00
Tolsee
2f7b987198 feat: dequeue worker request on timeout (#1540) 2025-05-09 18:01:49 +02:00
Marc
1d74b2caa8 feat: define domain specific workers in php_server and php blocks (#1509)
* add module (php_server directive) based workers

* refactor moduleID to uintptr for faster comparisons

* let workers inherit environment variables and root from php_server

* caddy can shift FrankenPHPModules in memory for some godforsaken reason, can't rely on them staying the same

* remove debugging statement

* fix tests

* refactor moduleID to uint64 for faster comparisons

* actually allow multiple workers per script filename

* remove logging

* utility function

* reuse existing worker with same filename and environment when calling newWorker with a filepath that already has a suitable worker, simply add number of threads

* no cleanup happens between tests, so restore old global worker overwriting logic

* add test, use getWorker(ForContext) function in frankenphp.go as well

* bring error on second global worker with the same filename again

* refactor to using name instead of moduleID

* nicer name

* nicer name

* add more tests

* remove test case already covered by previous test

* revert back to single variable, moduleIDs no longer relevant

* update comment

* figure out the worker to use in FrankenPHPModule::ServeHTTP

* add caddy/config_tests, add --retry 5 to download

* add caddy/config_tests

* sum up logic a bit, put worker thread addition into moduleWorkers parsing, before workers are actually created

* implement suggestions as far as possible

* fixup

* remove tags

* feat: download the mostly static binary when possible (#1467)

* feat: download the mostly static binary when possible

* cs

* docs: remove wildcard matcher from root directive (#1513)

* docs: update README with additional documentation links

Add link to classic mode, efficiently serving large static files and monitoring FrankenPHP

Signed-off-by: Romain Bastide <romain.bastide@orange.com>

* ci: combine dependabot updates for one group to 1 pull-request

* feat: compatibility with libphp.dylib on macOS

* feat: upgrade to Caddy 2.10

* feat: upgrade to Caddy 2.10

* chore: run prettier

* fix: build-static.sh consecutive builds (#1496)

* fix consecutive builds

* use minor version in PHP_VERSION

* install jq in centos container

* fix "arm64" download arch for spc binary

* jq is not available as a rpm download

* linter

* specify php 8.4 default

specify 8.4 so we manually switch to 8.5 when we make sure it works
allows to run without jq installed

* Apply suggestions from code review

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

---------

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

* chore: update Go and toolchain version (#1526)

* apply suggestions one be one - scriptpath only

* generate unique worker names by filename and number

* support worker config from embedded apps

* rename back to make sure we don't accidentally add FrankenPHPApp workers to the slice

* fix test after changing error message

* use 🧩 for module workers

* use 🌍 for global workers :)

* revert 1c414cebbc

* revert 4cc8893ced

* apply suggestions

* add dynamic config loading test of module worker

* fix test

* minor changes

---------

Signed-off-by: Romain Bastide <romain.bastide@orange.com>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Indra Gunawan <hello@indra.my.id>
Co-authored-by: Romain Bastide <romain.bastide@orange.com>
2025-05-05 16:14:19 +02:00
Kévin Dunglas
92e92335e3 docs: fix warning markup 2025-05-05 15:12:04 +02:00
dependabot[bot]
8f5f9e4c8b ci: bump golangci/golangci-lint-action in the github-actions group
Bumps the github-actions group with 1 update: [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action).


Updates `golangci/golangci-lint-action` from 7 to 8
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v7...v8)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 14:28:35 +02:00