Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from cloudflare:main #1

Open
wants to merge 317 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
317 commits
Select commit Hold shift + click to select a range
1b7d432
parse and send HTTP/1 reason phrase
eaufavor May 1, 2024
6229cc5
Always return HttpTask::Body on body done instead of HttpTask::done
andrewhavck Apr 26, 2024
b493ac0
Make `pop_closed` pub, to simplify DIY drains
bleggett Apr 17, 2024
cfb89c6
Add purge_response callback
drcaramelsyrup Apr 3, 2024
2625a1b
Add upstream_response_trailer_filter reference to user guide
andrewhavck May 1, 2024
8804889
Add `Service<HttpProxy<T>>` constructor for providing name
jamesmunns Apr 22, 2024
1a6af26
cargo fmt
johnhurt May 3, 2024
7507b69
Fix clipper warning on Rust 1.78
eaufavor May 10, 2024
3dbdcc6
Release 0.2.0
eaufavor May 10, 2024
0a6dabd
Add BasicPeer::new_uds constructor
drcaramelsyrup May 10, 2024
98af739
Client side TCP fast open support
eaufavor May 10, 2024
2272112
set SO_RCVBUF before connect
dqminh May 13, 2024
34b2a35
TCP fast open server side support.
eaufavor May 13, 2024
f38f3b9
Add request body filter
eaufavor May 13, 2024
8403673
Don't panic when h2 fails to allocate a stream
eaufavor May 16, 2024
a401754
avoid a possible race condition when releasing h2 connections
eaufavor May 16, 2024
cd51344
Ignore write_response_header on upgraded websockets
andrewhavck May 16, 2024
026f483
expose session to cache_hit_filter phase
zaidoon1 May 16, 2024
ac25f03
Track cache lookup time
eaufavor May 16, 2024
6f4f4cc
Allow the lookup_duration to be read
eaufavor May 17, 2024
6db86b6
Add ability to set server side tcp keepalive
andrewhavck May 17, 2024
795594d
Fixes #235 - Replace unmaintained structopt crate by clap
palant May 10, 2024
9dee8e6
Dropping the clap version to the most recent compatible with our rust…
johnhurt May 17, 2024
479d9ba
Addressing github #231 - Cleaning up cli-help text
johnhurt May 21, 2024
2902dc5
Redesign the API of HTTP module
eaufavor May 17, 2024
47844a7
Add ability to get TCP_INFO through SocketDigest, add get_recv_buf fu…
andrewhavck May 21, 2024
ea1db2f
Add read and write pending time info
eaufavor May 22, 2024
4019aa0
Simplify vectored write API
eaufavor May 22, 2024
fa071eb
Refactor Service API: Arc is no longer needed for apps.
eaufavor May 22, 2024
4579a78
get_tcp_info and get_recv_buf should return None for UDS
andrewhavck May 23, 2024
d412311
finish todo
cospectrum Apr 21, 2024
b7ac8a5
Fixes #231 - Remove Markdown code from the long CLI help
palant May 24, 2024
216d8e9
Pin triomphe to keep our MSRV
eaufavor May 29, 2024
7c49ef4
Add msrv (1.72) to build-check matrix
johnhurt Jun 7, 2024
e3c655b
update CacheKey to allow overriding primary key hash
zaidoon1 Jun 7, 2024
53e696d
Faster remove_header() call.
eaufavor Jun 7, 2024
11863d2
Introduce HttpModules to pingora-proxy.
eaufavor Jun 7, 2024
8a8302c
Respect the keepalive setting sent in HTTP client
eaufavor Jun 7, 2024
31d7b63
Add new_h1() back
eaufavor Jun 7, 2024
4d6690e
Update bleeper
gideontong Jun 14, 2024
1d32d06
Pin the stable Rust version
eaufavor Jun 14, 2024
20cac2e
expose new_uds err
cospectrum Apr 26, 2024
70b027e
Add trait for converting Options to Errors
andrewhavck May 31, 2024
a432c2d
Fix a couple of typos/grammar issues
jamesmunns Jun 3, 2024
35b9f1d
Remove Accept-Ranges header when response is compressed
andrewhavck Jun 8, 2024
d86c585
Track write duration on Poll::Ready(Err)
andrewhavck Jun 12, 2024
bf07ed3
add get_socket_cookie helper
bobrik Jun 12, 2024
708e032
Auto generate the size and verify it for setsockops calls
eaufavor Jun 12, 2024
4e251f6
Fxi clippy for Rust 1.79
eaufavor Jun 14, 2024
2d30077
Fixed typo in docs: connnection => connection
palant Jun 10, 2024
a1f1ad8
h2c support
andrewhavck Jun 10, 2024
0211151
Expose TCP_INFO fields as pub
drcaramelsyrup Jun 14, 2024
899d86c
change tinyufo test to be deterministic
gumpt Jun 17, 2024
9500e62
Make ipv6_only flag an Option<bool>
drcaramelsyrup Jun 15, 2024
c943fc1
compression: allow setting level per algorithm
gumpt Jun 17, 2024
05005e2
Fixes #234 - Clarify `ServerConf` documentation
palant Jun 8, 2024
648a6ad
ci: update targeted toolchains
gumpt Jun 14, 2024
c0b23c6
Expose a few more TLS APIs
eaufavor Jun 17, 2024
6e83d51
Add is_hit fn to RTCache CacheStatus
drcaramelsyrup Jun 19, 2024
fbf3a95
Add a write timeout to write body buf and an option to set a minimum …
andrewhavck Jun 13, 2024
03bd290
Always respect_keepalive when releasing http session
drcaramelsyrup Jun 19, 2024
f914843
Report evction/invalidtion types
eaufavor Jun 20, 2024
1176af3
Make type alias http::Module public
eaufavor Jun 20, 2024
dda7bec
Added `init_downstream_modules` phase allowing modules to be set up b…
palant Jun 15, 2024
62ddb7e
Move adding ResponseCompression module logic to init_downstream_modules
eaufavor Jun 21, 2024
92bbeb1
Parse UDS with prefix
eaufavor Jun 21, 2024
23c0378
Fixes #270 - Add `Session::digest_mut()` method
palant Jun 8, 2024
ace9d4f
Update comments on digest functions
andrewhavck Jun 24, 2024
86e6cd2
Fixes #261 - Better `Default` implementation for `Opt`
palant Jun 8, 2024
c67b5d0
Add a replacement cli-parsing function for `Opt` that can be used in …
johnhurt Jun 25, 2024
a483902
Change max allowed resp headers in HeaderSerde to match H1 max
drcaramelsyrup Jun 25, 2024
38a9d55
make seeded estimator and plumbing for tests
gumpt Jun 21, 2024
ee7f660
Allow to create a new connection when the current one is shutting down
eaufavor Jun 24, 2024
65b1d6c
Invoke request_body_filter of modules for proxies
eaufavor Jun 25, 2024
cdefa5c
Mark the error source from get_http_session()
eaufavor Jun 27, 2024
0035064
Provide a group key for connection reuse isolation
eaufavor Jun 28, 2024
5397e2b
Change from debug to display when socket mismatch happens
eaufavor Jun 28, 2024
9a68268
Add an example to create and import 3rd party modules
eaufavor Jun 28, 2024
09b5e03
Provide or_fail() for convenience error conversion.
eaufavor Jul 1, 2024
2ff09e7
Ignore 0.0.0.0 when checking fd mismatch
eaufavor Jul 2, 2024
aa06317
Correctly cast H2 error for GOAWAY
eaufavor Jul 11, 2024
3978afb
Upgrade to Rust 1.79
eaufavor Jul 11, 2024
604390c
Add support for setting DSCP on client and server sockets
andrewhavck Jul 11, 2024
9f70abe
Release 0.3.0
eaufavor Jul 12, 2024
42a847d
Update 0.3.0 CHANGELOG
eaufavor Jul 12, 2024
9220e6b
Fix bleep commit hash
eaufavor Jul 26, 2024
18db42c
Fixes #311 - Make timeouts Sync
palant Jun 28, 2024
60787db
chore(openssl): Update OpenSSL function signatures to use *mut instea…
pluveto Jun 26, 2024
7c122e7
Add the support for custom L4 connector
eaufavor Jul 18, 2024
a518740
Add callback function to Backends update() to address atomicity issue…
andrewhavck Jul 20, 2024
999e379
Support opaque extension field in Backend
eaufavor Jul 19, 2024
be97e35
Add ability to ignore informational responses when proxying downstream
andrewhavck Jul 24, 2024
ff2582a
Fix a rebase merge error
eaufavor Jul 25, 2024
32303b9
Address Rust 1.80 clippy warnings.
eaufavor Jul 26, 2024
8af7348
Allow unknown links
eaufavor Jul 26, 2024
29746f6
Upgrade latest Rust to 1.80
eaufavor Jul 26, 2024
9f50e6c
Handle bare IPv6 address in raw connect Host
eaufavor Jul 25, 2024
2a08042
Use Rust 1.80
eaufavor Jul 26, 2024
11b5882
Retry all h2 connection when encountering graceful shutdown
eaufavor Jul 26, 2024
e0ade32
Updated flurry and quick_cache (flurry being the only relavent change)
NathanielPrescott Jul 11, 2024
e5fda7c
Allow Stale phase in cache_miss
drcaramelsyrup Aug 1, 2024
e1c6e57
Add un-gzip support and allow decompress by algorithm
drcaramelsyrup Aug 1, 2024
ef5ed1a
docs: add docs for RateLimiter
xialeistudio Aug 2, 2024
76c4fda
Updating the rate-limiter documentation with a simpler example
johnhurt Aug 2, 2024
35810d6
add new_with_weight
v1xingyue Jul 31, 2024
7003ac3
Set stale-updating as an explicit CachePhase
drcaramelsyrup Aug 2, 2024
24d7229
Derive `Ord` and `PartialOrd` for `CompactCacheKey`
johnhurt Aug 7, 2024
8a0c73f
Support observe backend health status #225
vicanso Jul 31, 2024
50c3687
Add documentation on HealthObserve trait
andrewhavck Aug 9, 2024
a1f7b62
fix h2 request_summary
Congyuwang Aug 7, 2024
fba2c1d
move cargo config to toml
gumpt Aug 12, 2024
07a970e
add support for passing sentry release
gumpt Aug 12, 2024
b0bd0fb
fixup sentry unwrap
gumpt Aug 14, 2024
d425379
Edit github workflow to run audit on latest stable only
drcaramelsyrup Aug 16, 2024
91702bb
Make l4 module pub to expose Connect
andrewhavck Aug 14, 2024
55049c4
Fixes #229, #233 – Set proper response headers when compression is en…
palant Aug 10, 2024
6214b8d
Add more tests for setting vary response header
andrewhavck Aug 16, 2024
d8f3ffa
Add a dummy TLS implementation to be used as fallback
palant Aug 2, 2024
1b9e8ee
Refactor module into and relocate the no-op tls module
johnhurt Aug 29, 2024
4f45792
Weaken or remove etags when downstream compression applies
drcaramelsyrup Jul 23, 2024
e564cd5
Refactor `boringssl_openssl` into submodules in preparation for rustl…
johnhurt Aug 18, 2024
f3a5a85
Windows support 1/n: clean up cargo and certain tests
eaufavor Aug 23, 2024
acffb8a
Add error log when attempting to upgrade
jamesmunns Jul 15, 2024
d1d7a87
Add support for binding to local port ranges and retrying on EADDRNOT…
andrewhavck Aug 20, 2024
444186e
unset meta on cache miss
gumpt Aug 27, 2024
6170044
Replace non-breaking space with regular space
l2dy Aug 18, 2024
5a4a288
docs: fix doc comment for request_summary
eaufavor Aug 30, 2024
4446912
Fix `Opt::parse_args` doc typo
allan2 Aug 23, 2024
5e3e774
disable caching during error handling
gumpt Aug 27, 2024
e288bfe
change lock status memory ordering, tag spans
gumpt Sep 4, 2024
0597685
Windows support 2/n: Support FD types on different platforms
eaufavor Aug 30, 2024
96e561a
Allow miss handler to lookup storage using streaming write tag
drcaramelsyrup Aug 31, 2024
2a4e152
fix(proxy): typo in example
futurist Sep 2, 2024
6c8e7aa
document early_request_filter
spacewander Sep 2, 2024
0df7b0d
Adding semgrep yaml file
Sep 20, 2024
6d917b4
Only run clippy on the latest stable Rust
eaufavor Sep 23, 2024
760dda4
pingora-limits - Rate Estimator hashes & slots configuration
PawelJastrzebski Sep 13, 2024
9917177
Add support for gRPC-web module to bridge gRPC-web client requests to…
andrewhavck Aug 9, 2024
8ae4ebb
Update semgrep.yml
hrushikeshdeshpande Sep 22, 2024
5759d38
A couple of error message nits
gdavidsson Sep 16, 2024
0021d41
Add function for custom rate measurements
johnhurt Sep 13, 2024
cc96400
Safe guard for empty alpn.
eaufavor Sep 17, 2024
d811795
support retrieving rx timestamp for TcpStream
dqminh Sep 3, 2024
33fb157
Stream able to configure rx timestamp reading
dqminh Sep 9, 2024
ab1b717
Make sentry an optional feature
johnhurt Oct 4, 2024
44175e3
Rust 1.81
eaufavor Sep 24, 2024
4bc741c
Surface sentry feature at pingora crate
eaufavor Sep 25, 2024
2896879
Add a warning log if the dictionary for `HeaderSerde` is `None`
johnhurt Sep 26, 2024
4aadba1
Windows support
eaufavor Sep 26, 2024
2326142
feat(core): make 'sentry' optional
eaufavor Sep 27, 2024
af565b4
Fix all the warnings for non-linux unix
andrewhavck Sep 27, 2024
3c3dc7e
Merge extensions between old and new meta on revalidate
drcaramelsyrup Sep 3, 2024
2a62acd
Add Methods to SocketDigest for Retrieving SO_ORIGINAL_DST Information
ermakov-oleg Sep 20, 2024
f900450
Add windows compatibility for get_original_dest()
andrewhavck Sep 27, 2024
792d5fd
Detect h2 preface for h2c requests.
eaufavor Sep 30, 2024
894ca2d
Don't reuse session when downstream errors during cache miss
drcaramelsyrup Oct 4, 2024
9921fe4
document request_body_filter
spacewander Sep 26, 2024
b939776
Refactor openssl code one more time before rustls integration
eaufavor Oct 12, 2024
5151683
NOJIRA Update documentation to reflect changes in features
johnhurt Oct 4, 2024
70b7d81
Guard against excess cache put response body payloads
drcaramelsyrup Oct 4, 2024
7419b19
Check the current advertised h2 max streams
eaufavor Oct 8, 2024
63af8e2
Add into_inner() for HTTP client and server
sargun Oct 5, 2024
2c6190c
Auto snake case set-cookie header
eaufavor Oct 11, 2024
fbc93f8
windows: fixes for building pingora-core
fredr Oct 14, 2024
d46abae
Upgrade the latest Rust to 1.81
eaufavor Oct 18, 2024
3f60857
Upgrade Rust to 1.82
eaufavor Oct 18, 2024
04d7cfe
shutdown h2 connection gracefully with GOAWAYs
jordan-wu-97 Sep 18, 2024
1db55fc
Apply response_body_filter when serving from cache
drcaramelsyrup Oct 11, 2024
dd99314
pingora-core: Update socket dependency
sargun Oct 8, 2024
354a6ee
Add preliminary rustls support
johnhurt Oct 15, 2024
d445e74
Plumb errors through rustls implementation
johnhurt Oct 15, 2024
e9c3191
Update quickstart to support Opt::parse_args
gth828r Oct 16, 2024
e94c0a3
Make opt optional for frontends
mfleming Oct 21, 2024
418d9f7
Change `new_with_opt_and_conf` to accept `impl Into<Option<Opt>>` ins…
johnhurt Oct 21, 2024
7be56d4
Fix clippy lint for leaking private type in rustls
johnhurt Oct 21, 2024
54a641f
tag subrequests as such
gumpt Oct 21, 2024
80541d1
Rust 1.82
eaufavor Oct 21, 2024
fafc38a
change `CachePut::cacheable` to own `ResponseHeader`
gumpt Oct 21, 2024
fedb0a7
allow stale in cache_vary_lookup
gdavidsson Oct 23, 2024
5e31f74
Move the cache-lock timing data into a digest that is not cleared whe…
johnhurt Oct 22, 2024
1c6eed0
feat/remove-keys-from-tiny-ufo
TheDhejavu Oct 25, 2024
ab6f84c
fix audit workflow
fredr Oct 30, 2024
9a15986
Use OkOrErr on connect() + accept() when stream doesn't exist
andrewhavck Oct 22, 2024
ef1c9f1
add support for removing items from pingora-memory-cache
zaidoon1 Oct 29, 2024
3d2321e
Update Readme to reflect rustls and Windows
eaufavor Oct 31, 2024
28f6946
Release 0.4.0
eaufavor Oct 31, 2024
2228bfb
Update 0.4.0 CHANGELOG
eaufavor Nov 1, 2024
e18f41b
Check h2 stream end for error
drcaramelsyrup Oct 31, 2024
49e8d31
Remove unused `matches=0.1` dependency crate
cppcoffee Oct 9, 2024
3f564af
add builder api for pingora listeners:
Noah-Kennedy Nov 4, 2024
1b430c1
Allow errors from upstream_response_body_filter
drcaramelsyrup Nov 4, 2024
e87ee88
Fix cache meta trace tags
drcaramelsyrup Nov 6, 2024
bdb13a7
if-range support for cache ranges
drcaramelsyrup Nov 2, 2024
575d1aa
Check content-length on end of stream h2 header
drcaramelsyrup Nov 11, 2024
ae9c80b
Prune unused deps and run cargo-machete in ci
bobrik Nov 3, 2024
256323b
Only cache GET response after bypass
drcaramelsyrup Nov 12, 2024
57725ee
Don't parse CachePut payloads as chunked encoding
drcaramelsyrup Nov 15, 2024
1756948
update `impl<T> UniqueID` to use correct return type
georglauterbach Nov 15, 2024
e309436
Release cache lock after proxy upstream filter, serve stale
drcaramelsyrup Nov 12, 2024
a8a6e77
Improve support for sending custom response headers and bodies for er…
andrewhavck Nov 8, 2024
9850e92
Add the ability to trigger forced-miss behavior from the `cache_hit_f…
johnhurt Nov 18, 2024
fa4654a
Make cache eviction async
drcaramelsyrup Nov 16, 2024
36d68e8
expose getters for cache and hit spans
gumpt Nov 19, 2024
343fc98
change visibility of create_dummy_session
gumpt Nov 22, 2024
bb111aa
fix deadloop if proxy_handle_upstream exit early than proxy_handle_do…
taikulawo Nov 23, 2024
2a94183
add h2 server session tests
brk0v Dec 10, 2024
a37224b
add range_header_filter to proxy trait
gumpt Dec 13, 2024
42e11c4
Run cargo machete in github CI
drcaramelsyrup Dec 26, 2024
be4a023
add tweak_new_upstream_tcp_connection hook
Noah-Kennedy Dec 17, 2024
9287b82
Add a read-level check for h1 requests that contain both transfer-enc…
johnhurt Dec 13, 2024
1b3cc03
make `CacheKeyLock` a trait
gumpt Dec 17, 2024
fe2e3c9
add extensions to `CacheKey`
gumpt Dec 17, 2024
efc0748
test: update http test_single_header* test cases
XmchxUp Dec 11, 2024
900ba20
Revert "~~~: change visibility of create_dummy_session"
gumpt Jan 3, 2025
f697eee
Year 2025
eaufavor Jan 3, 2025
b6f24ff
Poll for H2 capacity before sending H2 body.
eaufavor Jan 3, 2025
795dfac
Add missing conf file for examples
eaufavor Jan 31, 2025
44a490d
Pin rand to 0.8 for now
eaufavor Jan 31, 2025
6c5d602
Add ability to configure max retries for upstream proxy failures
andrewhavck Dec 24, 2024
7e3eaf0
Fix downstream conditional filter causing dup header tasks
drcaramelsyrup Jan 1, 2025
bb28044
Add get_stale and get_stale_while_update for memory-cache
eaufavor Dec 31, 2024
d66923a
Update the bounds on the bounds on `MemoryCache` methods to accept br…
johnhurt Dec 17, 2024
c541904
Correctly send empty h2 data frames
eaufavor Jan 8, 2025
b14f402
Make the `test_random` test less flaky
johnhurt Jan 8, 2025
a571769
Add generic key type for get_stale
eaufavor Jan 9, 2025
048af57
Deflake `test_bind_to_port_range_on_connect`
johnhurt Jan 9, 2025
c0f47f3
lift cursor seek to `ServeFromCache`
gumpt Jan 17, 2025
2d977d4
This change supports building a server that can run Pingora without it
kriswuollett Jan 2, 2025
3a8f838
Fix comment formatting.
andrewhavck Jan 17, 2025
642c44e
Rename some H2 proxy function names
eaufavor Jan 17, 2025
5750e42
Signal that the response is done when body write finishes
eaufavor Jan 17, 2025
6ef2d8a
Move pingora to cf-rustracing
anthocf Jan 22, 2025
6662991
Use init_openssl_env_vars instead of init_ssl_cert_env_vars
andrewhavck Jan 23, 2025
8ad1503
Ignore h2 pipe error when finishing an H2 upstream.
eaufavor Jan 23, 2025
67bc7cc
Add finish_request_body() for HTTP healthchecks so that H2 healthchec…
areyia Jan 24, 2025
87ae8ce
allow proxy to set stream level downstream read timeout
xushichangdesmond Jan 15, 2025
3ea78a8
Fix formatting and comment.
andrewhavck Jan 17, 2025
e6b823c
Allow setting raw path in request
drcaramelsyrup Jan 24, 2025
043b69a
Add some comment for rr testcase
rongyi Jan 17, 2025
a6fd492
cache purge removes from eviction manager
drcaramelsyrup Jan 30, 2025
021770d
Pass hit handler size to eviction system on access
drcaramelsyrup Jan 30, 2025
81c7f48
Update openssl to address RUSTSEC-2025-0004
andrewhavck Feb 3, 2025
0860721
Require WritePermit to release lock, fix dangling detection
drcaramelsyrup Feb 1, 2025
0d979c6
Cleanup subrequest write permit
drcaramelsyrup Feb 2, 2025
6925467
server: accept in parallel
Noah-Kennedy Feb 6, 2025
c3ed76d
fix: use consistent type aliase Pools
ShyunnY Nov 26, 2024
f8d0127
Allow reusing session on errors prior to proxy upstream
drcaramelsyrup Feb 6, 2025
97b951e
Replace deprecated zipf with rand_distr
eaufavor Feb 11, 2025
ef234f5
Avoid allocating large buffer in the accept() loop
eaufavor Feb 6, 2025
c382ff6
Change leaf certs to v3 for rustls
eaufavor Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bleep
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20f290d8adc57ed489bcdd1b950833d0eb6bd8ed
9594f40a77159eeab93897a8f67347971a83d26b
14 changes: 10 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ design decisions to be made.
## Making a PR

After you've filed an issue, you can make your PR referencing that issue number. Once you open your
PR, it will be labelled _needs review_. A maintainer will review your PR as soon as they can. The
reviewer may ask for changes - they will mark the PR as _changes requested_ and _work in progress_
and will give you details about the requested changes. Feel free to ask lots of questions! The
maintainers are there to help you.
PR, it will be labelled _Needs Review_. A maintainer will review your PR as soon as they can. The
reviewer may ask for changes - they will mark the PR as _Changes Requested_ and will give you
details about the requested changes. Feel free to ask lots of questions! The maintainers are there
to help you.

Once we (the maintainers) decide to accept your change, we will label your PR as _Accepted_.
Later (usually within a week or two), we will rebase your commits onto the `main` branch in a
separate PR, batched alongside other _Accepted_ commits and any internal changes. (This process
allows us to sync the state of our internal repository with the public repository.) Once your
change lands in `main`, we will close your PR.

### Caveats

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Security Audit

on:
push:
branches:
- master
paths:
- "**/Cargo.toml"
schedule:
- cron: "0 2 * * *" # run at 2 AM UTC

permissions:
contents: read

jobs:
security-audit:
permissions:
checks: write # for rustsec/audit-check to create check
contents: read # for actions/checkout to fetch code
issues: write # for rustsec/audit-check to create issues
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Generate Cargo.lock
# https://github.com/rustsec/audit-check/issues/27
run: cargo generate-lockfile

- name: Audit Check
# https://github.com/rustsec/audit-check/issues/2
uses: rustsec/audit-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
42 changes: 16 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ jobs:
pingora:
strategy:
matrix:
# TODO: add nightly
toolchain: [stable]
profile: [minimal, default]
# nightly, MSRV, and latest stable
toolchain: [nightly, 1.72, 1.82.0]
runs-on: ubuntu-latest
# Only run on "pull_request" event for external PRs. This is to avoid
# duplicate builds for PRs created from internal branches.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: 'recursive'
submodules: "recursive"

- name: Install build dependencies
run: |
Expand All @@ -30,39 +29,30 @@ jobs:
sudo apt install -y openresty --no-install-recommends

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
profile: ${{ matrix.profile }}
components: rustfmt, clippy
override: true
default: true

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt --all -- --check

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --lib --bins --tests --no-fail-fast
run: cargo test --verbose --lib --bins --tests --no-fail-fast

# Need to run doc tests separately.
# (https://github.com/rust-lang/cargo/issues/6669)
- name: Run cargo doc test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --doc
run: cargo test --verbose --doc

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all -- --deny=warnings
run: |
[[ ${{ matrix.toolchain }} != 1.82.0 ]] || cargo clippy --all-targets --all -- --allow=unknown-lints --deny=warnings

- name: Run cargo audit
uses: actions-rust-lang/audit@v1
run: |
[[ ${{ matrix.toolchain }} != 1.82.0 ]] || (cargo install cargo-audit && cargo audit)

- name: Run cargo machete
run: |
[[ ${{ matrix.toolchain }} != 1.72.0 ]] || (cargo install cargo-machete && cargo machete)
16 changes: 4 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: 'recursive'
submodules: "recursive"

- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y cmake libclang-dev

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
default: true
uses: dtolnay/rust-toolchain@stable

- name: Run cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all-features
run: cargo doc --no-deps --all-features
23 changes: 23 additions & 0 deletions .github/workflows/mark-stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Close stale questions'
on:
schedule:
- cron: '30 1 * * *'
workflow_dispatch:

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This question has been stale for a week. It will be closed in an additional day if not updated.'
close-issue-message: 'This issue has been closed because it has been stalled with no activity.'
days-before-stale: -1
days-before-issue-stale: 7
days-before-issue-close: 1
stale-issue-label: 'stale'
only-issue-labels: 'question'
24 changes: 24 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
pull_request: {}
workflow_dispatch: {}
push:
branches:
- main
- master
schedule:
- cron: '0 0 * * *'
name: Semgrep config
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-latest
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
SEMGREP_URL: https://cloudflare.semgrep.dev
SEMGREP_APP_URL: https://cloudflare.semgrep.dev
SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v4
- run: semgrep ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dhat-heap.json
.vscode
.idea
.cover
bleeper.user.toml
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
edition = "2021"
131 changes: 131 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Changelog

All notable changes to this project will be documented in this file.

## [0.4.0](https://github.com/cloudflare/pingora/compare/0.3.0...0.4.0) - 2024-11-01

### 🚀 Features
- [Add preliminary rustls support](https://github.com/cloudflare/pingora/commit/354a6ee1e99b82e23fc0f27a37d8bf41e62b2dc5)
- [Add experimental support for windows](https://github.com/cloudflare/pingora/commit/4aadba12727afe6178f3b9fc2a3cad2223ac7b2e)
- [Add the option to use no TLS implementation](https://github.com/cloudflare/pingora/commit/d8f3ffae77ddc1edd285ab1d517a1b6748ce3d58)
- [Add support for gRPC-web module to bridge gRPC-web client requests to gRPC server requests](https://github.com/cloudflare/pingora/commit/9917177c646a0ab58197f15ec57a3bcbe1e0a201)
- [Add the support for h2c and http1 to coexist](https://github.com/cloudflare/pingora/commit/792d5fd3c14c1cd588b155ddf09c09a4c125a26b)
- [Add the support for custom L4 connector](https://github.com/cloudflare/pingora/commit/7c122e7f36de5c946ac960a1691c5dd41f26e6e6)
- [Support opaque extension field in Backend](https://github.com/cloudflare/pingora/commit/999e379064d2c1266a267abdf9f4f41b14bffcf5)
- [Add the ability to ignore informational responses when proxying downstream](https://github.com/cloudflare/pingora/commit/be97e35031cf4f5a01191f1848bdf491bd9f0d62)
- [Add un-gzip support and allow decompress by algorithm](https://github.com/cloudflare/pingora/commit/e1c6e57db3e613991eda3160d15f81e0669ea066)
- [Add the ability to observe backend health status](https://github.com/cloudflare/pingora/commit/8a0c73f174a27a87c54426a748c4818b10de9425)
- [Add the support for passing sentry release](https://github.com/cloudflare/pingora/commit/07a970e413009ee62fc4c15e0820ae1aa036af22)
- [Add the support for binding to local port ranges](https://github.com/cloudflare/pingora/commit/d1d7a87b761eeb4f71fcaa3f7c4ae8e32f1d93c8)
- [Support retrieving rx timestamp for TcpStream](https://github.com/cloudflare/pingora/commit/d811795938cee5a6eb7cd46399cef17210a0d0c5)

### 🐛 Bug Fixes
- [Handle bare IPv6 address in raw connect Host](https://github.com/cloudflare/pingora/commit/9f50e6ccb09db2940eec6fc170a1e9e9b14a95d0)
- [Set proper response headers when compression is enabled](https://github.com/cloudflare/pingora/commit/55049c4e7983055551b34feee397c736ffc912bb)
- [Check the current advertised h2 max streams](https://github.com/cloudflare/pingora/commit/7419b1967e7686b00aefb7bcd2a4dfe59b31e639)
- Other bug fixes and improvements


### ⚙️ Changes and Miscellaneous Tasks
- [Make sentry an optional feature](https://github.com/cloudflare/pingora/commit/ab1b717bf587723c1c537d6549a8f8096f0900d4)
- [Make timeouts Sync](https://github.com/cloudflare/pingora/commit/18db42cd2cb892432fd7896f0da7e9d19221214b)
- [Retry all h2 connection when encountering graceful shutdown](https://github.com/cloudflare/pingora/commit/11b5882a422774cffbd14d9a9ea7dfc9dc98b02c)
- [Make l4 module pub to expose Connect](https://github.com/cloudflare/pingora/commit/91702bb0c0c5e1f2d5e2f40a19a3f340bb5a6d82)
- [Auto snake case set-cookie header when downgrade to from h2 to http1.1](https://github.com/cloudflare/pingora/commit/2c6190c634f2a5dd2f00e8597902f2b735a9d84f)
- [shutdown h2 connection gracefully with GOAWAYs](https://github.com/cloudflare/pingora/commit/04d7cfeef6205d2cf33ad5704a363ee107250771)
- Other API signature updates

## [0.3.0](https://github.com/cloudflare/pingora/compare/0.2.0...0.3.0) - 2024-07-12

### 🚀 Features
- Add support for HTTP modules. This feature allows users to import modules written by 3rd parties.
- Add `request_body_filter`. Now request body can be inspected and modified.
- Add H2c support.
- Add TCP fast open support.
- Add support for server side TCP keep-alive.
- Add support to get TCP_INFO.
- Add support to set DSCP.
- Add `or_err()`/`or_err_with` API to convert `Options` to `pingora::Error`.
- Add `or_fail()` API to convert `impl std::error::Error` to `pingora::Error`.
- Add the API to track socket read and write pending time.
- Compression: allow setting level per algorithm.

### 🐛 Bug Fixes
- Fixed a panic when using multiple H2 streams in the same H2 connection to upstreams.
- Pingora now respects the `Connection` header it sends to upstream.
- Accept-Ranges header is now removed when response is compressed.
- Fix ipv6_only socket flag.
- A new H2 connection is opened now if the existing connection returns GOAWAY with graceful shutdown error.
- Fix a FD mismatch error when 0.0.0.0 is used as the upstream IP

### ⚙️ Changes and Miscellaneous Tasks
- Dependency: replace `structopt` with `clap`
- Rework the API of HTTP modules
- Optimize remove_header() API call
- UDS parsing now requires the path to have `unix:` prefix. The support for the path without prefix is deprecated and will be removed on the next release.
- Other minor API changes

## [0.2.0](https://github.com/cloudflare/pingora/compare/0.1.1...0.2.0) - 2024-05-10

### 🚀 Features
- Add support for downstream h2 trailers and add an upstream h2 response trailer filter
- Add the ability to set TCP recv buf size
- Add a convenience function to retrieve Session digest
- Add `body_bytes_read()` method to Session
- Add `cache_not_modified_filter`
- Add `SSLKEYLOG` support for tls upstream
- Add `Service<HttpProxy<T>>` constructor for providing name
- Add `purge_response` callback
- Make `pop_closed` pub, to simplify DIY drains

### 🐛 Bug Fixes
- Fixed gRPC trailer proxying
- Fixed `response_body_filter` `end_of_stream` always being false
- Fixed compile error in Rust <= 1.73
- Fixed non linux build
- Fixed the counting problem of used_weight data field in `LruUnit<T>`
- Fixed `cargo run --example server` missing cert
- Fixed error log string interpolation outside of proper context
- Fixed tinylfu test flake

### ⚙️ Changes and Miscellaneous Tasks
- API change: `Server::run_forever` now takes ownership and ensures exit semantics
- API change: `cleanup()` method of `ServerApp` trait is now async
- Behavior change: Always return `HttpTask::Body` on body done instead of `HttpTask::done`
- Behavior change: HTTP/1 reason phrase is now parsed and proxied
- Updated `h2` dependency for RUSTSEC-2024-0332
- Updated zstd dependencies
- Code optimization and refactor in a few crates
- More examples and docs

## [0.1.1](https://github.com/cloudflare/pingora/compare/0.1.0...0.1.1) - 2024-04-05

### 🚀 Features
- `Server::new` now accepts `Into<Option<T>>`
- Implemented client `HttpSession::get_keepalive_values` for Keep-Alive parsing
- Expose `ListenFds` and `Fds` to fix a voldemort types issue
- Expose config options in `ServerConf`, provide new `Server` constructor
- `upstream_response_filter` now runs on upstream 304 responses during cache revalidation
- Added `server_addr` and `client_addr` APIs to `Session`
- Allow body modification in `response_body_filter`
- Allow configuring grace period and graceful shutdown timeout
- Added TinyUFO sharded skip list storage option

### 🐛 Bug Fixes
- Fixed build failures with the `boringssl` feature
- Fixed compile warnings with nightly Rust
- Fixed an issue where Upgrade request bodies might not be handled correctly
- Fix compilation to only include openssl or boringssl rather than both
- Fix OS read errors so they are reported as `ReadError` rather than `ReadTimeout` when reading http/1.1 response headers

### ⚙️ Miscellaneous Tasks
- Performance improvements in `pingora-ketama`
- Added more TinyUFO benchmarks
- Added tests for `pingora-cache` purge
- Limit buffer size for `InvalidHTTPHeader` error logs
- Example code: improvements in pingora client, new LB cluster example
- Typo fixes and clarifications across comments and docs

## [0.1.0] - 2024-02-28
### Highlights
- First Public Release of Pingora 🎉
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ members = [
"pingora-openssl",
"pingora-boringssl",
"pingora-runtime",
"pingora-rustls",
"pingora-ketama",
"pingora-load-balancing",
"pingora-memory-cache",
Expand All @@ -26,9 +27,10 @@ tokio = "1"
async-trait = "0.1.42"
httparse = "1"
bytes = "1.0"
derivative = "2.2.0"
http = "1.0.0"
log = "0.4"
h2 = ">=0.4.2"
h2 = ">=0.4.6"
once_cell = "1"
lru = "0"
ahash = ">=0.8.9"
Expand Down
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM debian:latest as builder

ARG BUILDARCH
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends \
gcc g++ libfindbin-libs-perl \
make cmake libclang-dev git \
wget curl gnupg ca-certificates lsb-release \
&& wget --no-check-certificate -O - https://openresty.org/package/pubkey.gpg | gpg --dearmor -o /usr/share/keyrings/openresty.gpg \
&& if [ "${BUILDARCH}" = "arm64" ]; then URL="http://openresty.org/package/arm64/debian"; else URL="http://openresty.org/package/debian"; fi \
&& echo "deb [arch=$BUILDARCH signed-by=/usr/share/keyrings/openresty.gpg] ${URL} $(lsb_release -sc) openresty" | tee /etc/apt/sources.list.d/openresty.list > /dev/null \
&& apt-get -qq update \
&& apt-get -qq install -y openresty --no-install-recommends

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

WORKDIR /var/opt/pingora
COPY . .
RUN cargo build
Loading