Skip to content

shr-site does not apply to share links in /?shares listing page #1232

@odedd

Description

@odedd

Describe the bug

The --shr-site option (added in v1.20.2 via #1211) correctly overrides the URL when creating a new share, and also applies to the QR code link in the shares listing page. However, the actual share links displayed in the /?shares page still use the request origin instead of the configured shr-site value.

To Reproduce

  1. Configure copyparty behind a reverse proxy with internal/external domain split
  2. Set shr-site: https://publicurl.com/ in config
  3. Access copyparty via internal URL (http://privateurl.com)
  4. Go to /?shares to view existing shares
  5. Observe that share links show http://privateurl.com/shr/xxx instead of http://publicurl.com/shr/xxx

Expected behavior

Share links in the /?shares page should use the shr-site URL, matching the behavior of newly created shares and QR code links.

Server details (if you're NOT using docker/podman)

  • server OS / version: macOS (Mac Studio)
  • what copyparty did you grab: sfx
  • how you're running it: as a LaunchAgent via Automator app wrapper (for Full Disk Access)
  • copyparty version: 1.20.3
  • copyparty config:
[global]
p: 3923
e2dsa
e2ts
z
shr: /s
rproxy: 1
rp-loc: /studio
name: publicurl.com
xff-src: 192.168.2.0/24
xff-hdr: x-forwarded-for
shr-site: https://publicurl.com/

The rest of the stack

  • Synology Reverse Proxy on port 80 handles Tailnet access (privateurl.cominternal-ip:3923)
  • Caddy on NAS port 3924 handles Cloudflare tunnel routing for public access (publicurl.com)
  • Internal access is via Tailscale VPN

Additional context

Looking at the code in copyparty/web/shares.html line 44, the QR link uses {{ site }} but the share link uses {{ r }}:

<a href="{{ site }}{{ shr }}{{ k }}?qr">qr</a>   <!-- uses site ✓ -->
<a href="{{ r }}{{ shr }}{{ k }}">{{ k }}</a>    <!-- uses r (request root) ✗ -->

The second link should also use {{ site }} for consistency.

Related: #1211, commit 41d3bae

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions