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.
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.
🔄 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.

## 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.

---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
dev← Head:sticky_targets📝 Commits (3)
ac8e315Add ability for sticky sessions to backend resource.4a42aa3Update sticky session to show only with 2+ targets and use IP strategy for TCP38528aeMerge 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.
How to test?
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.