Skip to content

Commit

Permalink
Merge pull request #36 from shyim/fix-frankenphp-cve
Browse files Browse the repository at this point in the history
frankenphp: fix quick-go cve
  • Loading branch information
shyim authored Apr 7, 2024
2 parents f9366a0 + d78b7ba commit 89129dc
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 10 deletions.
45 changes: 40 additions & 5 deletions frankenphp-8.2.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: frankenphp-8.2
version: 1.1.2
epoch: 2
epoch: 3
description: "FrankenPHP"
copyright:
- license: MIT
Expand All @@ -17,11 +17,14 @@ environment:
- build-base
- busybox
- go
- gobump
- libxml2-dev
- patch
- php-frankenphp-8.2
- php-frankenphp-8.2-dev
- readline-dev
- sqlite-dev
- xcaddy

pipeline:
- runs: |
Expand Down Expand Up @@ -52,13 +55,45 @@ pipeline:
tag: "v${{package.version}}"
expected-commit: e7e0dbfa3dcea98f2d19fd9c275324094a2610e9

- uses: git-checkout
with:
expected-commit: 6d9a83376b5e19b3c0368541ee46044ab284038b
repository: https://github.com/caddyserver/caddy
tag: v2.7.6
destination: caddyserver

- uses: fetch
with:
uri: https://raw.githubusercontent.com/wolfi-dev/os/f453d99b209c90e8392a59cfc84442f1431890f0/caddy/quic-go.patch
expected-sha256: 3223d6d1418cd1c07db50297d8e9396ca662e63d29decb3e336fbc96040fb4b1
extract: false

- runs: |
set -e
mv quic-go.patch caddyserver
cd caddyserver
patch -p1 < quic-go.patch
- runs: gobump --packages "golang.org/x/[email protected] github.com/quic-go/[email protected] google.golang.org/[email protected] github.com/jackc/pgx/[email protected]"
working-directory: caddyserver

- name: Build
working-directory: caddy/frankenphp
runs: |
set -e
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build
export CGO_CFLAGS=$(php-config --includes)
export CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)"
export XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'"
export CGO_ENABLED=1
mkdir -p ${{targets.destdir}}/usr/bin/
cp frankenphp ${{targets.destdir}}/usr/bin/frankenphp
xcaddy build \
--output ${{targets.destdir}}/usr/bin/frankenphp \
--with github.com/dunglas/frankenphp=./ \
--with github.com/dunglas/frankenphp/caddy=./caddy/ \
--with github.com/caddyserver/caddy/v2=./caddyserver \
--with github.com/dunglas/caddy-cbrotli \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
- uses: strip

Expand Down
45 changes: 40 additions & 5 deletions frankenphp-8.3.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: frankenphp-8.3
version: 1.1.2
epoch: 2
epoch: 3
description: "FrankenPHP"
copyright:
- license: MIT
Expand All @@ -17,11 +17,14 @@ environment:
- build-base
- busybox
- go
- gobump
- libxml2-dev
- patch
- php-frankenphp-8.3
- php-frankenphp-8.3-dev
- readline-dev
- sqlite-dev
- xcaddy

pipeline:
- runs: |
Expand Down Expand Up @@ -52,13 +55,45 @@ pipeline:
tag: "v${{package.version}}"
expected-commit: e7e0dbfa3dcea98f2d19fd9c275324094a2610e9

- uses: git-checkout
with:
expected-commit: 6d9a83376b5e19b3c0368541ee46044ab284038b
repository: https://github.com/caddyserver/caddy
tag: v2.7.6
destination: caddyserver

- uses: fetch
with:
uri: https://raw.githubusercontent.com/wolfi-dev/os/f453d99b209c90e8392a59cfc84442f1431890f0/caddy/quic-go.patch
expected-sha256: 3223d6d1418cd1c07db50297d8e9396ca662e63d29decb3e336fbc96040fb4b1
extract: false

- runs: |
set -e
mv quic-go.patch caddyserver
cd caddyserver
patch -p1 < quic-go.patch
- runs: gobump --packages "golang.org/x/[email protected] github.com/quic-go/[email protected] google.golang.org/[email protected] github.com/jackc/pgx/[email protected]"
working-directory: caddyserver

- name: Build
working-directory: caddy/frankenphp
runs: |
set -e
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build
export CGO_CFLAGS=$(php-config --includes)
export CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)"
export XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'"
export CGO_ENABLED=1
mkdir -p ${{targets.destdir}}/usr/bin/
cp frankenphp ${{targets.destdir}}/usr/bin/frankenphp
xcaddy build \
--output ${{targets.destdir}}/usr/bin/frankenphp \
--with github.com/dunglas/frankenphp=./ \
--with github.com/dunglas/frankenphp/caddy=./caddy/ \
--with github.com/caddyserver/caddy/v2=./caddyserver \
--with github.com/dunglas/caddy-cbrotli \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
- uses: strip

Expand Down

0 comments on commit 89129dc

Please sign in to comment.