add unstable build for testing
This commit is contained in:
parent
1c1b50d213
commit
78a5487293
4 changed files with 36 additions and 10 deletions
18
.github/workflows/release_docker.yml
vendored
18
.github/workflows/release_docker.yml
vendored
|
|
@ -2,6 +2,7 @@ name: Release - Build and publish docker, and trigger package release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- "feat/*"
|
||||||
- "develop"
|
- "develop"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [closed]
|
types: [closed]
|
||||||
|
|
@ -135,6 +136,23 @@ jobs:
|
||||||
# platforms: linux/amd64
|
# platforms: linux/amd64
|
||||||
# labels: ${{ steps.meta.outputs.labels }}
|
# labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
- name: Unstable build and push from develop branch
|
||||||
|
if: ${{ (github.ref_name == 'feat/*') && (github.event_name == 'push') }}
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
build-args: ${{ matrix.build-args }}
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:unstable${{ matrix.tags-suffix }}
|
||||||
|
${{ env.DH_REGISTRY_NAME }}:unstable${{ matrix.tags-suffix }}
|
||||||
|
build-contexts: ${{ matrix.build-contexts }}
|
||||||
|
file: ${{ matrix.dockerfile }}
|
||||||
|
cache-from: type=gha,scope=rpxy-unstable-${{ matrix.target }}
|
||||||
|
cache-to: type=gha,mode=max,scope=rpxy-unstable-${{ matrix.target }}
|
||||||
|
platforms: ${{ matrix.platforms }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
- name: Nightly build and push from develop branch
|
- name: Nightly build and push from develop branch
|
||||||
if: ${{ (github.ref_name == 'develop') && (github.event_name == 'push') }}
|
if: ${{ (github.ref_name == 'develop') && (github.event_name == 'push') }}
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ pub const MAX_CONCURRENT_STREAMS: u32 = 64;
|
||||||
pub const CERTS_WATCH_DELAY_SECS: u32 = 60;
|
pub const CERTS_WATCH_DELAY_SECS: u32 = 60;
|
||||||
pub const LOAD_CERTS_ONLY_WHEN_UPDATED: bool = true;
|
pub const LOAD_CERTS_ONLY_WHEN_UPDATED: bool = true;
|
||||||
|
|
||||||
|
pub const CONNECTION_TIMEOUT_SEC: u64 = 30; // timeout to serve a connection. this might limits the max length of response.
|
||||||
|
|
||||||
// #[cfg(feature = "http3")]
|
// #[cfg(feature = "http3")]
|
||||||
// pub const H3_RESPONSE_BUF_SIZE: usize = 65_536; // 64KB
|
// pub const H3_RESPONSE_BUF_SIZE: usize = 65_536; // 64KB
|
||||||
// #[cfg(feature = "http3")]
|
// #[cfg(feature = "http3")]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use super::proxy_main::Proxy;
|
use super::proxy_main::Proxy;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
constants::CONNECTION_TIMEOUT_SEC,
|
||||||
crypto::CryptoSource,
|
crypto::CryptoSource,
|
||||||
error::*,
|
error::*,
|
||||||
hyper_ext::body::{IncomingLike, RequestBody},
|
hyper_ext::body::{IncomingLike, RequestBody},
|
||||||
|
|
@ -10,7 +11,7 @@ use bytes::{Buf, Bytes};
|
||||||
use http::{Request, Response};
|
use http::{Request, Response};
|
||||||
use http_body_util::BodyExt;
|
use http_body_util::BodyExt;
|
||||||
use hyper_util::client::legacy::connect::Connect;
|
use hyper_util::client::legacy::connect::Connect;
|
||||||
use std::net::SocketAddr;
|
use std::{net::SocketAddr, time::Duration};
|
||||||
|
|
||||||
#[cfg(feature = "http3-quinn")]
|
#[cfg(feature = "http3-quinn")]
|
||||||
use h3::{quic::BidiStream, quic::Connection as ConnectionQuic, server::RequestStream};
|
use h3::{quic::BidiStream, quic::Connection as ConnectionQuic, server::RequestStream};
|
||||||
|
|
@ -70,8 +71,10 @@ where
|
||||||
let self_inner = self.clone();
|
let self_inner = self.clone();
|
||||||
let tls_server_name_inner = tls_server_name.clone();
|
let tls_server_name_inner = tls_server_name.clone();
|
||||||
self.globals.runtime_handle.spawn(async move {
|
self.globals.runtime_handle.spawn(async move {
|
||||||
if let Err(e) = self_inner
|
if let Err(e) = tokio::time::timeout(
|
||||||
.h3_serve_stream(req, stream, client_addr, tls_server_name_inner)
|
Duration::from_secs(CONNECTION_TIMEOUT_SEC + 1), // just in case...
|
||||||
|
self_inner.h3_serve_stream(req, stream, client_addr, tls_server_name_inner),
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
warn!("HTTP/3 error on serve stream: {}", e);
|
warn!("HTTP/3 error on serve stream: {}", e);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use super::socket::bind_tcp_socket;
|
use super::socket::bind_tcp_socket;
|
||||||
use crate::{
|
use crate::{
|
||||||
constants::TLS_HANDSHAKE_TIMEOUT_SEC,
|
constants::{CONNECTION_TIMEOUT_SEC, TLS_HANDSHAKE_TIMEOUT_SEC},
|
||||||
crypto::{CryptoSource, ServerCrypto, SniServerCryptoMap},
|
crypto::{CryptoSource, ServerCrypto, SniServerCryptoMap},
|
||||||
error::*,
|
error::*,
|
||||||
globals::Globals,
|
globals::Globals,
|
||||||
|
|
@ -88,9 +88,11 @@ where
|
||||||
let message_handler_clone = self.message_handler.clone();
|
let message_handler_clone = self.message_handler.clone();
|
||||||
let tls_enabled = self.tls_enabled;
|
let tls_enabled = self.tls_enabled;
|
||||||
let listening_on = self.listening_on;
|
let listening_on = self.listening_on;
|
||||||
|
let timeout_sec = Duration::from_secs(CONNECTION_TIMEOUT_SEC + 1); // just in case...
|
||||||
self.globals.runtime_handle.clone().spawn(async move {
|
self.globals.runtime_handle.clone().spawn(async move {
|
||||||
server_clone
|
timeout(
|
||||||
.serve_connection_with_upgrades(
|
timeout_sec + Duration::from_secs(1), // just in case...
|
||||||
|
server_clone.serve_connection_with_upgrades(
|
||||||
stream,
|
stream,
|
||||||
service_fn(move |req: Request<Incoming>| {
|
service_fn(move |req: Request<Incoming>| {
|
||||||
serve_request(
|
serve_request(
|
||||||
|
|
@ -102,6 +104,7 @@ where
|
||||||
tls_server_name.clone(),
|
tls_server_name.clone(),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.ok();
|
.ok();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue