[PR #511] [MERGED] Add ability for sticky sessions to backend resource. #2304

Closed
opened 2026-04-16 09:19:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/pangolin/pull/511
Author: @x86txt
Created: 4/11/2025
Status: Merged
Merged: 4/22/2025
Merged by: @miloschwartz

Base: devHead: sticky_targets


📝 Commits (3)

  • ac8e315 Add ability for sticky sessions to backend resource.
  • 4a42aa3 Update sticky session to show only with 2+ targets and use IP strategy for TCP
  • 38528ae Merge branch 'dev' into sticky_targets

📊 Changes

5 files changed (+80 additions, -7 deletions)

View changed files

📝 server/db/schemas/schema.ts (+3 -0)
📝 server/routers/resource/updateResource.ts (+1 -0)
📝 server/routers/traefik/getTraefikConfig.ts (+28 -3)
📝 server/setup/scripts/1.3.0.ts (+5 -2)
📝 src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx (+43 -2)

📄 Description

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Allow 'sticky sessions' to backend resources. This is required if there are multiple targets and the targets aren't stateless, like the VNC console sessions to Proxmox. This keep the user pinned to a single target for the duration of their session.

image

How to test?

mkdir -p /tmp/server1 && echo "server1" > /tmp/server1/index.html && \
mkdir -p /tmp/server2 && echo "server2" > /tmp/server2/index.html && \
python3 -m http.server 10000 --bind 0.0.0.0 --directory /tmp/server1 && \
python3 -m http.server 20000 --bind 0.0.0.0 --directory /tmp/server2

Add two targets as shown in the screenshot below. Browse to your Resource and hit refresh and notice the webpage rotates from server1 to server 2, etc. Enable Sticky Sessions, hit refresh several more times, and notice that Traefik now keeps your session pinned to a single target.

image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/pangolin/pull/511 **Author:** [@x86txt](https://github.com/x86txt) **Created:** 4/11/2025 **Status:** ✅ Merged **Merged:** 4/22/2025 **Merged by:** [@miloschwartz](https://github.com/miloschwartz) **Base:** `dev` ← **Head:** `sticky_targets` --- ### 📝 Commits (3) - [`ac8e315`](https://github.com/fosrl/pangolin/commit/ac8e315fbd1dbaf568a7c9cd79f82ff1a3ce86b5) Add ability for sticky sessions to backend resource. - [`4a42aa3`](https://github.com/fosrl/pangolin/commit/4a42aa385ab7292eaf5db7198aba1e5b4236b3bc) Update sticky session to show only with 2+ targets and use IP strategy for TCP - [`38528ae`](https://github.com/fosrl/pangolin/commit/38528ae8c59e014e2c6a188118297792e9a88577) Merge branch 'dev' into sticky_targets ### 📊 Changes **5 files changed** (+80 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `server/db/schemas/schema.ts` (+3 -0) 📝 `server/routers/resource/updateResource.ts` (+1 -0) 📝 `server/routers/traefik/getTraefikConfig.ts` (+28 -3) 📝 `server/setup/scripts/1.3.0.ts` (+5 -2) 📝 `src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx` (+43 -2) </details> ### 📄 Description ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description Allow 'sticky sessions' to backend resources. This is required if there are multiple targets and the targets aren't stateless, like the VNC console sessions to Proxmox. This keep the user pinned to a single target for the duration of their session. ![image](https://github.com/user-attachments/assets/475826e4-95fe-4e79-8596-779ba8a7dc37) ## How to test? ```shell mkdir -p /tmp/server1 && echo "server1" > /tmp/server1/index.html && \ mkdir -p /tmp/server2 && echo "server2" > /tmp/server2/index.html && \ python3 -m http.server 10000 --bind 0.0.0.0 --directory /tmp/server1 && \ python3 -m http.server 20000 --bind 0.0.0.0 --directory /tmp/server2 ``` Add two targets as shown in the screenshot below. Browse to your Resource and hit refresh and notice the webpage rotates from server1 to server 2, etc. Enable Sticky Sessions, hit refresh several more times, and notice that Traefik now keeps your session pinned to a single target. ![image](https://github.com/user-attachments/assets/df681ecd-05e6-4261-aa2c-95ce256cf882) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 09:19:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#2304