mirror of
https://github.com/gotempsh/temps.git
synced 2026-04-24 22:06:00 +03:00
[PR #24] fix: proxy memory leak, domain pagination, and DomainSelector component #25
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/temps#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/gotempsh/temps/pull/24
Author: @dviejokfs
Created: 2/28/2026
Status: 🔄 Open
Base:
main← Head:feat/proxy-log-batch-writer📝 Commits (8)
1beb0d0feat(domains): implement paginated domain listing with search functionality07e9b6echore: merge remote-tracking branch 'origin/main' into feat/proxy-log-batch-writer40d0587feat(domains): enhance domain management with wildcard support and pagination48c8744docs: update CHANGELOG with proxy batch writer, domain pagination, and DomainSelector51b3877feat: add auth rate limiting, external plugin system, docs overhaul, and settings UI6304497chore: merge remote-tracking branch 'origin/main' into feat/proxy-log-batch-writer7d4c7e2feat: implement job queue for route table updates and enhance deployment handling6fc7d14feat: add Google Indexing API plugin for Temps📊 Changes
376 files changed (+58540 additions, -5858 deletions)
View changed files
📝
.gitignore(+2 -0)📝
CHANGELOG.md(+10 -0)📝
Cargo.lock(+100 -4)📝
Cargo.toml(+4 -0)📝
README.md(+18 -18)📝
crates/temps-auth/src/auth_service.rs(+237 -5)📝
crates/temps-auth/src/deployment_token_service.rs(+148 -2)📝
crates/temps-auth/src/handlers.rs(+19 -6)📝
crates/temps-auth/src/lib.rs(+1 -0)📝
crates/temps-auth/src/middleware.rs(+5 -7)➕
crates/temps-auth/src/rate_limit.rs(+235 -0)📝
crates/temps-auth/src/temps_middleware.rs(+8 -9)📝
crates/temps-auth/src/user_service.rs(+3 -0)📝
crates/temps-cli/src/commands/proxy.rs(+6 -0)📝
crates/temps-cli/src/commands/serve/console.rs(+45 -15)📝
crates/temps-cli/src/commands/serve/mod.rs(+57 -75)📝
crates/temps-cli/src/main.rs(+20 -0)📝
crates/temps-core/src/encryption.rs(+69 -1)➕
crates/temps-core/src/external_plugin/channel.rs(+260 -0)📝
crates/temps-core/src/external_plugin/manifest.rs(+139 -0)...and 80 more files
📄 Description
Summary
tokio::spawnfire-and-forget proxy log writes with a bounded channel (mpsc::channel(8192)) + batch INSERT writer that flushes up to 200 rows every 500ms with backpressurelist_domains_with_total()service method with search support (substring match), paginatedListDomainsResponsewithtotal/page/page_sizefieldsDomainSelectorcombobox: Searchable domain picker using Command+Popover pattern with server-side search, debounce, status badges, and "showing X of Y" hintlistDomainsOptions()call site now uses proper pagination or targeted search — no more fetching all domains into memoryProxy Batch Writer
The
LoadBalancerpreviously calledtokio::spawnon every request to fire-and-forget an individual INSERT for proxy logs. Under high traffic this created unbounded task growth and memory pressure.New approach:
ProxyLogBatchWriterruns on a dedicated OS thread with its own tokio runtimempsc::channel(8192)— producers use.send().await(backpressure) for HTML responses and.try_send()(drop if full) for static/error pathsDomain Pagination
Backend (
temps-domains):DomainService::list_domains_with_total()— returns(Vec<Model>, u64)with optional substring search on domain nameListDomainsParams— custom query params struct withpage,page_size,searchListDomainsResponse— now includestotal,page,page_sizeFrontend (
web/):DomainsManagement.tsx— search bar with debounce, numbered pagination controls, mobile-responsiveDomainSelector.tsx— new reusable combobox component with server-side search, used inDomainForm,AddRouteDomainForm.tsx— removeddomainsprop dependency; now self-contained (fetches wildcards internally when editing)listDomainsOptions()call sites reviewed and fixed:Domains.tsxDomainSelector.tsxAddRoute.tsxpage_size: 1, checkstotal > 0for existenceDomainChallengeStep.tsxsearch: wildcardDomain, page_size: 1useExternalConnectivity.tssearch: '*.', page_size: 100GitProviderFlow.tsxsearch: '*.', page_size: 10ImprovedOnboardingDashboard.tsxpage_size: 100, usestotalfor existenceAddDomainDialog.tsxEditDomainDialog.tsxFiles Changed (21 files, +1201 / -410)
Rust (proxy)
crates/temps-proxy/src/service/proxy_log_batch_writer.rs— new batch writer + 5 testscrates/temps-proxy/src/proxy.rs— removed sync log call, removedrequest_loggerfield, use batch handlecrates/temps-proxy/src/server.rs— create batch writer, spawn on dedicated threadcrates/temps-proxy/src/proxy_test.rs— updatedLoadBalancer::newcall sitesRust (domains)
crates/temps-domains/src/domain_service.rs—list_domains_with_total()crates/temps-domains/src/handlers/domain_handler.rs—ListDomainsParams, updated handlercrates/temps-domains/src/handlers/types.rs— response fieldsFrontend
web/src/components/domains/DomainSelector.tsx— new reusable comboboxweb/src/components/domains/DomainsManagement.tsx— search + pagination UIweb/src/pages/Domains.tsx— pagination state managementweb/src/pages/AddRoute.tsx— paginated existence check + DomainSelectorweb/src/components/project/settings/DomainForm.tsx— self-contained wildcard matchingweb/src/components/project/settings/AddDomainDialog.tsx— removed domains fetchweb/src/components/project/settings/EditDomainDialog.tsx— removed domains fetchweb/src/components/onboarding/ImprovedOnboardingDashboard.tsx— paginated queryweb/src/components/onboarding/DomainChallengeStep.tsx— targeted searchweb/src/components/git-providers/GitProviderFlow.tsx— wildcard searchweb/src/hooks/useExternalConnectivity.ts— wildcard searchweb/src/api/client/types.gen.ts— updated types🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.