Unfortunately, GitHub Actions is often blocked by the php.net CDN. This
patch adds a fallback to use GitHub to try to determine the PHP version
to use. This is less ideal because PHP currently doesn't use GitHub
extensively, and distribution archives aren't available in the GitHub
releases, only on php.net.
* delete source/downloads after building in script, not in dockerfile
* add editorconfig
* eol
* cs fix
* added \n there
* we expect Hello\n
* Change tab width for shell scripts to 4 spaces
* bring back embed comment
* simplify build-static script
* we don't require go anymore, since spc will install it
* bring back eof newline
* move to frankenphp-os-arch again
* shell fmt
* Add FrankenPHP Caddy modules to build script
* 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>
* 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>
* 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>
* simplify using mimalloc
* fix the duplication issue of mimalloc.o since the linker deduplicates archives automatically, but it's slightly suboptimal. better would be to prevent cgo from duplicating it in the first place.
* only set stack size for musl
* Update build-static.sh
* Add gnu static binary build support
* Remove --libc option
* configure ./build-static.sh to allow extension loading with glibc
* use tabs everywhere
* do not use prebuilt sources for glibc build
* ffi does not work with musl builds
* remove unnecessary tabs
* disable opcache jit on musl
* disable opcache jit on musl again
* err, build command, not download command
* cs fixes
* spellcheck
* even more cs fixes
* fix ar removing .a libs
* disable ffi extension for now
* add gnu static action
* add gnu-static target
* skip CHECKOV 2 and 3
* rename static-builder to static-builder-musl, gnu-static to static-builder-gnu
run arm64 gnu job on ubuntu-arm
* rename build-linux to build-linux-musl
* rename job description to specify musl
* higher optimisation flags
* Update docker-bake.hcl
---------
Co-authored-by: DubbleClick <m@pyc.ac>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>